koffeeman Posted October 14 Posted October 14 1st of all, if this is in the wrong forum, please delete ..... and sorry. i am writing a program and i want control of ALL of the destop and i want to take into account the taskbar so that everything (labels, buttons, input fields, etc) are relative to each other (my aim is that the program will look as identical as possible at any resolution). i use the following code (that i got from this forum al long time ago): If (BitAND(WinGetState("[CLASS:Shell_TrayWnd]"),$WIN_STATE_VISIBLE) = 2) Then $taskBar = WinGetPos("[CLASS:Shell_TrayWnd]") $taskBarHeight = $taskBar[3] EndIf on one laptop (ASUS i5 Win11 1536x864 14"- the one that stays home) this returns a value of 72. on another machine (ASUS i3 Win11 1536x864 14" - also at home but i take to client's place) it returns a value of 48. on an (ACER i3 Win10 1366x768 16"- older machine, also at home) it returns it returns 30 and finally (Acer netbook atom Win7 1024x600 10"- taken when i work at the coffee shop, if i drop it, too bad, so sad, no big loss) also returns 30 on the i3 machines and the netbook the value returned allows me to maximize the remaining space for all controls so they are relative to each other and this worlks wonderfully. but i am confused why the two ASUS machines, both with windows 11 and at the same resolution, are returning different values - as best i can determine all of the taskbar settings are identical. this makes the "useable" resolution off by 24 and leaves the desktop viewable on top by 12 pixel rows and bottom before the taskbar by 12 pixel rows, forcing me to add the following glitch to the above code before the Endif: If ($taskBarHeight = 72) Then $taskBarHeight = 48 this makes the ASUS i5 appear identical to the ASUS i3. does anyone know why this is? is there something i need to change on the taskbar settings on the i5 ASUS? this is no big deal, but i was just wondering if anyone might know what is going on with why both Win11 set at 1536x864 returns differnt values for the taskbar height - i just hate having to add that hardcoded line.
ioa747 Posted October 14 Posted October 14 Check Scale and layout in Display settings, apparently it's not common to all. try putting at the beginning of your script DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", "int", -4) ; -4=PerMonitorAwareV2 (the script must run in 32 bit) Parsix 1 I know that I know nothing
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now