Reputation: 40573
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!
Upvotes: 3
Views: 1473
Reputation: 619
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
Upvotes: 2
Reputation: 723378
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.
Upvotes: 7
Reputation: 29073
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
Upvotes: 2