开发者

SystemTray Icon Coordinate - C#

How can I get those coordinates of Application Icon which is find in the Window taskbar's status area (a开发者_开发技巧.k.a. System Tray) in C#?


You cannot do this by fair means. No such API exists. There are, of course, various hacky ways to find it out, but I won't get into that.

Normally what you want to do is show a menu in response to a click on the tray icon. The message that Windows sends you when this happens contains the cursor coordinates where the click occurred. That's usually enough information to show whatever it is you show in response to the click.

In C# this translates to reading the coordinates out of the MouseEventArgs in NotifyIcon.MouseUp.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜