Link to home
Start Free TrialLog in
Avatar of MugWumpBW
MugWumpBW

asked on

Closing a window from an external process

I am writing a VC++ 6.0 monitor program which monitors the graphics of a third party application window.  This application periodically pops up advertising dialog boxes which mess up the graphics monitoring and I would like to automatically close those dialogs.  I can enumerate the windows on the screen and get the handle to the dialog window, but when I send a WM_CLOSE message to that window nothing happens.  Is there another message or window method I could use to cause the dialog to go away?

If I can't close this window directly, then I have thought I could get the window handle for the OK button and send that button a mouse click event to simulate the user closing the dialog manually.

Any suggestions would be appreciated.
SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MugWumpBW
MugWumpBW

ASKER

Thanks - that worked.  For some reason neither WM_CLOSE or WM_DESTROY worked.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My answer os OK (IDOK).