[SOLVED] Taskbar size

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 497
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

[SOLVED] Taskbar size

Post by Grovkillen » Thu Oct 06, 2016 8:32 am

Hi,

I have managed to get the taskbar size by running this script and before the 5 second wait is over I click on the taskbar.

Code: Select all

Wait>5
GetActiveWindow>Shell_TrayWnd,X_POS_TASKBAR,Y_POS_TASKBAR,W_POS_TASKBAR,H_POS_TASKBAR
H_POS_TASKBAR is the height of the taskbar.

Could it be done in a simpler way? It would be nice to have all these information in a GetWorkSpace> command since we only get the screen resolution with the GetScreenRes> command.
Last edited by Grovkillen on Mon Oct 31, 2016 12:48 pm, edited 1 time in total.
Let>ME=%Script%

Running: 15.0.9
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7231
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Taskbar size

Post by Marcus Tettmar » Thu Oct 06, 2016 1:35 pm

How about:

Code: Select all

FindObject>0,Shell_TrayWnd,,1,hWnd,leftPos,topPos,rightPos,bottomPos,text
Or:

Code: Select all

LibFunc>User32,FindWindowA,h1,Shell_TrayWnd,
Let>WIN_USEHANDLE=1
GetWindowPos>h1,xPos,yPos
GetWindowSize>h1,width,height
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Grovkillen
Automation Wizard
Posts: 497
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

Re: Taskbar size

Post by Grovkillen » Fri Oct 07, 2016 5:48 am

HERO! :)

Both worked great!
Let>ME=%Script%

Running: 15.0.9
version history

User avatar
Grovkillen
Automation Wizard
Posts: 497
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

Re: [SOLVED] Taskbar size

Post by Grovkillen » Mon Jul 06, 2020 9:01 am

I've been poking around with the user32 API and came across this one:

SPI_GETWORKAREA which is part of this call SystemParametersInfoA.

Calling this:

Code: Select all

LibFunc>user32,SystemParametersInfoA,res,48,0,rect,0
will get me a success (res=1) but since the LibFunc isn't giving me the return value of "rect" I cannot use this. Is there any chance of this being implemented? Perhaps as a GetWorkSpaceRes> command?

https://docs.microsoft.com/en-us/window ... etersinfoa
Let>ME=%Script%

Running: 15.0.9
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts