如何找到在系统托盘图标的位置 [英] How to find the location of the icon in the system tray

查看:504
本文介绍了如何找到在系统托盘图标的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示在系统托盘中的NotifyIcon控件。我如何才能找到的位置在屏幕上的图标(X,Y)?

I have a NotifyIcon control that appears in the system tray. How can I find the location (x, y) of the icon on the screen?

感谢

推荐答案

您不能。这是不难得到的窗口句柄系统托盘,GetClassName()返回ToolbarWindow32,标准工具栏公共控件的类名。要注意的是一个64位操作系统有两个。然后,你可以发送邮件到它像TB_GETBUTTONINFO。首席挂起等,你将不知道该怎么选择按钮的ID和返回的信息不包括按钮的位置。

You can't. It isn't hard to get the window handle for the system tray, GetClassName() returns "ToolbarWindow32", the class name of the standard TOOLBAR common control. Beware that a 64-bit OS has two of them. Then you can send messages to it like TB_GETBUTTONINFO. Chief hang-ups are that you won't know what button ID to choose and the returned info does not include the button position.

这对更好,按钮移动身边没有你能锁定它们。

Which is for the better, buttons move around without you being able to lock them.

这篇关于如何找到在系统托盘图标的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆