Spy++是如何构建它的进程列表的?

2022-01-12 00:00:00 windows winapi mfc spy++ window-messages

TL;DR - Spy++ 工具是如何真正构建其进程列表的?

舞台

我们有一个挂起的 MFC 桌面应用程序(在 Windows XP 上运行),它不再对任何用户输入做出反应.但是,当通过 alt-tab 切换到它时,它会被重绘.(它确实收到 WM_SETFOCUSWM_ACTIVATE 等.它显然没有收到任何鼠标或键盘消息.)

由于应用程序陷入了困境,我们提取了一些进程转储,但到目前为止这些都没有什么帮助.输入:

Spy++ 和 我们的应用程序不是显示在此进程列表中.在应用正常运行的另一台PC上交叉检查,该进程也正常显示在Spy++的进程列表中.

是否可以从该进程未显示在 Spy++ 的进程视图中这一事实推断出有关行为不端的应用程序的任何信息,但应用程序的主窗口显示在 Windows 视图中.为什么主窗口可见的进程不会显示在 Spy++ 的进程视图中?

该进程列在任务管理器和 Visual Studio 2005 的附加进程"窗口中.因此这些工具显然使用与 Spy++ 不同的方法来列出进程...?

应用当前挂起的系统是 Windows XP SP2 系统,我们使用了 Visual Studio 2005 附带的 Spy++ 实用程序.

该行为偶尔会再次出现,但仅在应用运行数天后才会出现!

解决方案

运行 Vista 或更高版本?你的进程可能被提升了,而 Spy++ 没有.较新版本的 Spy++ 需要提升.因此,请尝试显式提升 Spy++,看看是否有帮助.

TL;DR - How does the Spy++ tool really construct its process list?

Stage

We have an MFC desktop application (running on Windows XP) that is hanging in that it doesn't react to any user input anymore. It is redrawn when switching to it via alt-tab however. (It does receive WM_SETFOCUS, WM_ACTIVATE, etc. It apparently does not receive any mouse or keyboard messages.)

Since the app is hanging in some limbo, we pulled a few process dumps, but these were of little help so far. Enter:

Spy++

We used Spy++ to find the information I gave above about the window messages this application seems to be processing. We did this by Opening the Windows View and selecting our application Window and in the Messages properties selected Windows of same process and Messages to View : Select All.

However we first tried to view all messages of this process by opening the Processes View of Spy++ and our application is not shown in this process list. Cross checking on another PC where the app is running normally, the process is also normally shown in the processes list of Spy++.

Can anything about the misbehaving app be inferred from the fact that the process is not shown in Spy++'s Process View, but the main window of the app is shown in the Windows View. Why would a process with a main window that is visible not be shown in Spy++'s Processes View?

The process is listed in Task Manager and in the Attach Process Window of Visual Studio 2005. So these tools apparently use a different method to list processes than Spy++ ... ?

The system where the app is currently hanging is a Windows XP SP2 system and we've used the Spy++ Utility that comes with Visual Studio 2005.

The behavior does recur occasionally, but only after the App has been running for several days!

解决方案

Running Vista or later? Your process is probably elevated and Spy++ is not. Newer versions of Spy++ require elevation. So, try elevating Spy++ explicitly and see if that helps.

相关文章