Reputation:
In Google's Chrome App Launcher for Windows, does anyone know how they managed to show the window such that it's centered above the application's icon in the TaskBar? Any kind of solution for C#/.NET would be fine (p/invoke, etc.).
I've searched high and low and there are solutions for the System Tray based on identifying the screen rect of a notify icon, but I have not found one for the TaskBar (except one approach that is based on a screen capture, but it's too fragile for production applications).
Thanks!
-Tom B.
Upvotes: 3
Views: 1442
Reputation:
Thanks to NETscape's hint, I found that the way that the Chrome App Launcher makes it look like the window is appearing over the TaskBar icon is by checking the mouse position immediately after starting up, and if the mouse is in the TaskBar area then it shows the window directly above the TaskBar and horizontally centered over the mouse.
You can test this by moving the mouse left or right immediately after clicking the icon, in which cases the window appears to the left or right of the TaskBar icon. If you move the mouse outside the TaskBar area right after clicking it (or launch the app from a Desktop icon) then the window is just anchored to the lower-left corner of the screen.
Upvotes: 5