Location of Taskbar (Top, Bottom, Left or Right)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to figure out the location of the taskbar (top, bottom, left or
right). I am creating an owner drawn tooltip for a NotifyIcon and trying to
figure out where to position the form when the user hovers over the
NotifyIcon in the system tray. Is there another way to approach the issue of
the form placement?
Thanks in advance,
Terry
 
You can use the relative sizes of Screen.Bounds and Screen.WorkingArea to
determine the position of the taskbar.
I think this will work only if there are no other appbars on the screen.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
 
Thanks for the reply. My goal is to pop a window up above the system tray if
the taskbar is on the bottom, below the system tray if the taskbar is on top,
to the left of the system tray if the taskbar is on the right and to the
right of the system tray if the task bar is on the left. I will investigate
screen.bounds and workingarea to see if they help. I'm bummed that there is
not an easy way to determine the taskbar position.

Thanks again,
Terry
 
Terry,
Thanks for the reply. My goal is to pop a window up above the system tray if
the taskbar is on the bottom, below the system tray if the taskbar is on top,
to the left of the system tray if the taskbar is on the right and to the
right of the system tray if the task bar is on the left.

Excellent! Kudos for keeping in mind that the taskbar can be docked to
any edge. Personally I always keep it on the top of the screen, and I
see way too many apps that assume that it's on the bottom.

I will investigate
screen.bounds and workingarea to see if they help. I'm bummed that there is
not an easy way to determine the taskbar position.

You can call SHAppBarMessage(ABM_GETTASKBARPOS) to get the location of
the task bar, and then derive the edge from there. See

How To Find the Edge of a Task Bar
http://support.microsoft.com/kb/179908


Mattias
 
Back
Top