Location of app on the Windows 7 Taskbar

核能气质少年 提交于 2019-12-12 12:31:32

问题


Is there a way to know where my application is located (in pixel) on the Windows 7 Taskbar? I am asking because I would like to show notification above the icon of my app in the Taskbar.

Thanks!


回答1:


There algorithm you ask for is described in detail on this blog: How to find the position of a taskbar button on Windows 7 or Vista




回答2:


While there are a number of P/Invokes available to locate an icon in the notification area, I don't think there are any to determine the location of an icon in the taskbar.

Anyway, the notification area is still there in Windows 7, so why not use a notification icon? In fact, the Windows UX Guidelines specify this:

  • Does your program need to display a notification? If so, you must use a notification area icon.

Or if you don't need a notification balloon to display textual information of a notification, you can try using an overlay icon instead.

Or flash the taskbar icon if it's critical that it has the user's attention.




回答3:


The way to draw the user's attention to your taskbar icon is to make it flash using the FlashWindowEx API. http://pietschsoft.com/post/2009/01/26/CSharp-Flash-Window-in-Taskbar-via-Win32-FlashWindowEx.aspx



来源:https://stackoverflow.com/questions/5931566/location-of-app-on-the-windows-7-taskbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!