I'm having a problem trying to WM_CLOSE
a Window Explorer process in that sending that message will then try to close the Windows Shell explorer process and prompt the user to shut down windows. This is not the intended behaviour and I was wondering how I could work around it?
How can I close individual explorer windows gracefully, without shutting down the whole PC at the same time? The goal is to have the same behaviour as if the user had clicked on the X button themselves.
EDIT: I've found that I'm able to get all the child windows of the explorer process but from that point I'm not sure how to identify which windows are the actual, user visible / interactable Explorer windows.
11/21/2012 16:27:49 [12] DEBUG - Closing process with PID: 2680
11/21/2012 16:27:49 [12] DEBUG - Window has 11 descendant windows
11/21/2012 16:27:49 [12] DEBUG - Found child window: hWnd: 590746 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: 4:27 PM hWnd: 656010 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: hWnd: 2294392 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: hWnd: 1245586 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: User Promoted Notification Area hWnd: 2949496 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: System Promoted Notification Area hWnd: 1245548 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: hWnd: 852646 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: hWnd: 918356 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: Running applications hWnd: 1769950 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: Running applications hWnd: 1179980 Window State: Normal
11/21/2012 16:27:49 [12] DEBUG - Found child window: TF_FloatingLangBar_WndTitle hWnd: 458926 Window State: Normal