我正在尝试将代码添加到通知区域中可见的所有图标的列表中,在时间的左侧.我一直在试验,EnumDesktopWindows并GetWindowLong没有找到任何方法来挑出系统托盘图标.谢谢!
我正在尝试创建获取具有systray图标的进程列表的应用程序。
我搜索了很多,发现了一些参考文献:
http://www.raymond.cc/blog/find-out-what-program-are-running-at-windows-system-tray/
http://www.codeproject.com/Articles/10497/A-tool-to-order-the-window-buttons-in-your-taskbar
它们都是很好的资源,但对我来说最有用的是3和4。
在1中,有一个我想要的例子。
我想要具有systray图标的进程列表:
名为“ AnVir任务管理器”的应用程序示例
使用链接6中的代码,我成功遍历了系统托盘按钮并看到每个按钮的文本:

但是我不确定如何找到与每个纸盘图标相关的过程。
他在代码项目中提到可以帮助识别过程的信息是,dwData但是问题是当我发现Systray中出现的按钮时,它的dwData = 0:

码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SystrayIcons
{
public partial class Form1 : Form
{
public Form1()
{
Engine.findProcessInSystray();
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Engine.findProcessInSystray();
}
}
}
Run Code Online (Sandbox Code Playgroud)
using System;
using System.Collections.Generic;
using …Run Code Online (Sandbox Code Playgroud)