Firstly thanks for all your help over the past couple of years - much appreciated.
My current problem is this: I run a VNC server on my PC, and it's not terribly stable. So every so often, it crashes leaving me with the standard "Application has performed an illegal operation" and sometimes gives me the opportunity to bebug in VC++.
I would like to write a program that will find the appropriate buttons on the dialog boxes and press them, such that the program is closed down and cleared away, ready for me to restart it (eg. with the system command).
Since if I'm using VNC, that implies I won't be at the console, so I can't press the buttons myself. I don't need to auto-detect when something goes wrong - I can trigger the program manually, remotely.
Any suggestions appreciated. If there's a better way than simulating button presses etc, I'd be glad to hear it.