哪个 Windows 进程正在显示给定的任务栏系统托盘图标?

发布于 2024-10-20 11:00:36 字数 41 浏览 5 评论 0原文

如何找到哪个 Windows 进程正在显示给定的任务栏系统托盘图标?

How do I find which Windows process is displaying a given taskbar system tray icon?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

高跟鞋的旋律 2024-10-27 11:00:36

我刚刚意识到,在 Windows 7 中,“选择在任务栏上显示哪些图标和通知”菜单在这里有点帮助。右键单击任务栏,转到“属性”,然后单击“通知区域”框架中的“自定义...”按钮即可找到它。

该窗口中的每一行代表 Windows 资源管理器看到的一个任务栏图标。在左边的两个 rwo 中,我相信顶部的一个是任务管理器中显示的进程描述,底部的一个是显示任务栏图标的窗口的窗口标题。

这将帮助我找到我原来的问题! VisualSVN 弹出“注册我!”尽管没有明显的 VisualSVN 进程在运行,但系统托盘中仍显示 nag 窗口。最终,我注意到当我关闭 Visual Studio 时,这个 nag 窗口消失了,因此很明显 Visual Studio 中加载的 VisualSVN 加载项 DLL 正在创建 nag 窗口。

I've just realised that in Windows 7 the 'Select which icons and notifications appear on the taskbar' menu helps a bit here. Find it by right-clicking the taskbar, go to 'Properties', then click the 'Customize...' button in the 'Notification area' frame.

Each row in that window represents a taskbar icon that Windows Explorer has seen. Of the left two rwos, I believe the top one is the process's description as shown in Task Manager, and the bottom one is the window title for the window showing the taskbar icon.

This would've helped me track down my original problem! VisualSVN was popping up a 'Register me!' nag window in the system tray, despite no obvious VisualSVN processes running. Eventually I noticed that this nag window disappeared when I closed Visual Studio, so it was clear that the VisualSVN add-in DLL loaded in Visual Studio was creating the nag window.

夏见 2024-10-27 11:00:36

Shell_NotifyIcon 通过发送特殊的 < a href="http://www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/shell32/api/shlnot/copydata.htm" rel="nofollow">发送到任务栏的 WM_COPYDATA 消息,如果您注入资源管理器并子类化任务栏,您可以捕获此消息,然后可以通过在 COPYDATAstruct.NOTIFYICONDATA.hwnd 上调用 GetWindowThreadProcessId 来获取进程 id。

...当然,这是一种黑客攻击,并且依赖于随时可能更改的未记录信息!

Shell_NotifyIcon works by sending a special WM_COPYDATA message to the taskbar, if you inject into explorer and subclass the taskbar you could catch this message, you could then get the process id by calling GetWindowThreadProcessId on COPYDATAstruct.NOTIFYICONDATA.hwnd.

...and of course, this is a hack and relies on undocumented information that could change at any time!

时光倒影 2024-10-27 11:00:36

我不相信这是可能的。当然,Spy++ 报告通知区域是一个名为“用户升级通知区域”的窗口。该窗口最终是桌面窗口的父级,并且与创建通知图标的进程没有明显的关联。


好吧,我所说的“可能”是指无需像安德斯建议的那样采用黑客手段,这无疑是可行的,但不是我想象的OP正在寻找的!

I don't believe this to be possible. Certainly Spy++ reports that the Notification area is a single window named "User Promoted Notification Area". This window is ultimately parented with the desktop window and has no obvious association with the process that created the notification icon.


Well, by possible I mean possible without resorting to hacks like Anders suggests which is no doubt feasible, but not what I imagine the OP is looking for!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文