PxPlus User Forum

Twitter Twitter Twitter

Author Topic: taskbar location and size  (Read 664 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
taskbar location and size
« on: September 29, 2021, 09:16:12 AM »
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

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: taskbar location and size
« Reply #1 on: September 29, 2021, 10:29:57 AM »
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.

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com