I\'m trying to use the following code to press a button on my other application:
HWND ButtonHandle;
if( (wnd = FindWindow(0, \"Do you want to save?\")) )
{
If you can raise the window containing the button you can send raw mouse event to a position within the boundaries of button.
There are two function to simulate mouse event SendInput and mouse_event. I recommend using mouse_event
function. To raise a window you can use ShowWindow. I don't know how to get the handle of a button, but if you have its hWnd its easy to find its absolute position using GetWindowRect function. Try using these, if you run into any problems I will be glad to help.
Or define a custom WM within your application window to handle save request. WM_CUSTOM
or WM_USER
(cant remember which) marks the start of user defined window messages.