C# 如何检查进程图标并确定它正在使用哪个进程
我有一个程序需要检查系统托盘中图标的状态。系统托盘中的程序根据与服务器的通信状态交换其图标,我需要检查它现在正在使用哪个图标。我找到了一种提取当前图标的方法,但如何检查是哪个图标?
I have a program that needs to check the state of an icon in the system tray. The program in the system tray swaps it's icon depending on it's communication status with the server and I need to check which Icon it is using right now. I found a way to extract the current icon, but how do I check which Icon that is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您的意思是您想要检查图标本身的内容,如图像内容中所示。
如果是这种情况,则有多种图像比较算法 您可以使用。
然而,这可能有点矫枉过正。由于图标非常小,您可能需要确定可以检查状态的像素或像素组,因为您可能知道它们始终处于给定图标的特定唯一状态。
I assume you mean you want to do a check the contents of the icon itself, as in the image contents.
If this is the case, then there are a number of image comparison algorithms that you can use.
However, that might be a little overkill. Since the icons are so small, you might want to determine a pixel or groups of pixels that can be checked for the state, because you might know that they will always be in a certain unique state given the icon.