Main Board > Programming

taskbar location and size


Thomas Bock:
How can I retrieve the location and size of the taskbar?
I can determine the current monitor with fin(0,"XYMonitors") and obj(0). But a call to *winapi;getMonitorInfo only seems to work for monitor #1.

Mike King:
Why are you looking for the location of the Windows Taskbar?

If you maximize ('SHOW'(2)) a dialog which has an 'F' and '*' option set it will cover the full screen. 

Technically you could read the XYPos of this window and from that deduce the location of the toolbar when comparing it to FIN(0,"XYMonitors").

print 'dialog'(5,5,20,20,"",opt="*F"),'show'(2),; x$=fin(0,"XYPOS"); print 'pop',

Now generally I would not suggest you try to code based on toolbar location as it can change at any time and the user may have selected the "auto-hide" tool bar option which minimizes the toolbar when not in use.  Adding to the complexity the size of the task bar varies based on the monitor thus dragging a window from one screen to another could change the useable size.

Setting a window to fill the screen (option "F") will fill the usable region of the screen the application is running on and is dynamic, that is adjusts as the physical display area changes.


[0] Message Index

Go to full version