Is it possible to send WM_QUERYENDSESSION messages to a window in a different process?
问题 I want to debug a windows C++ application I've written to see why it isn't responding to WM_QUERYENDSESSION how I expect it to. Clearly it's a little tricky to do this by just shutting the system down. Is there any utility or code which I can use to send a fake WM_QUERYENDSESSION to my application windows myself? 回答1: I've used the Win32::GuiTest Perl module to do this kind of thing in the past. 回答2: The Windows API SendMessage can be used to do this. http://msdn.microsoft.com/en-us/library