4
Does anyone know of an application which would close a window given its handle? Command line is good.
Note, that I do not wish to kill the respective application, rather a modal window owned by that application.
Rationale:
Sometime, a modal dialog is opened beneath the main window on my laptop. This happened not once for VS and Firefox. Very annoying.
I can locate the window with Spy++, but have no means of killing it.
EDIT:
An application allowing to send messages to an arbitrary window is good as well, I guess I can then send something like WM_CLOSE or whatever.
EDIT:
I wish to stress, that I am not interesting in closing a visible window. The whole point is to deal with ugly abnormalities when a modal dialog gets open beneath the owning window, which did happen and not once for me while working with VS and Firefox. So, the desired solution is to close a window by its handle or, if it could specifically locate obscured windows and bring them forth.
Alt-Tab usually brings the modal dialog back on top. – Remus Rusanu – 2009-08-26T18:59:06.497
Well, not in my scenarios. It only does so if the modal dialog is open with a certain window style (do not remember exactly) which makes the dialog appear in the task bar. – None – 2009-08-26T20:36:30.780