我在想WM_CLOSE
一个窗口Explorer进程在发送消息时,然后会尝试关闭Windows Shell中的Explorer进程,并提示用户关闭Windows问题的特定实例。这不是预期的行为,我想知道如何解决它?关闭Windows资源管理器
如何关闭个人资源管理器窗口摆好,没有在同一时间关闭整个PC?目标是具有与用户自己单击X按钮时相同的行为。
编辑:我发现我能够获得所有浏览器进程的子窗口,但从这一点我不知道如何确定哪些窗口是实际的,用户可见/可交互的资源管理器窗口。
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
嘿,感谢其他探险实例之间的关系为提示。我已经找到一种方法来列出Explorer进程的所有子窗口,肯定会比较的hWnd与返回者之一返回由GetDesktopWindow,但在我上面贴的情况下,我只有两个Windows资源管理器窗口打开,所以看起来缩小比它更复杂。 :) –
班级是否一样? FindWindow也寻找类。 shell进程是否始终是桌面的子进程而其他进程不是?必须有一些方法来区分shell和shell之间的区别。 –
另外,是从GetDesktopWindow的shell处理?桌面是最高级别的父级。当我使用spy ++时,我发现资源管理器实例有一个它所在目录的标题。这应该有助于区分。 –