puttygen --ssh-keygen writes ~/.ssh/id_rsa easily

This code isn't great; it effectively drives the UI by clicking
buttons on it... but, then, if you're going to put all the code
directly into WndProc, what do you expect?
pagent's add ~/.ssh/id_rsa calls puttygen if available
ensure ~/.ssh exists (and encrypt it for people)