Sign in to follow this  
Followers 0
Penny

GUI Get Height?

3 posts in this topic

#1 ·  Posted (edited)

Hey again, the script I'm making needs to be able to run in multiple resolutions and OSs, as such I need to know what's the height of a maximized window (that is, excluding the taskbar, however tall it might be)

Local $g = GUICreate("MAXIMIZED",-1,-1,-1,-1,BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX))
GUISetState(@SW_SHOW)
Sleep(800)
GUISetState(@SW_MAXIMIZE)
Sleep(1500)
ConsoleWrite(@DesktopWidth & ". h: " &  @DesktopHeight & @CRLF)

how would I get the window's actual height from there?

also I would actually like to have the top/left/right/bottom of the form.

Edited by Penny

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I tried using _WinAPI_GetWindowPlacement but that doesn't work with the maximized window, it gives me the normal-state coords.

basically what I want is the Position / Size as given by the Window Info utility by AutoIt.

Edited by Penny

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

try

WinGetClientSize
...

Local $g = GUICreate("MAXIMIZED",-1,-1,-1,-1,BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX))
GUISetState(@SW_SHOW)
Sleep(800)
GUISetState(@SW_MAXIMIZE)
Sleep(1500)
ConsoleWrite(@DesktopWidth & ". h: " &  @DesktopHeight & @CRLF)



$win_size = WinGetClientSize("MAXIMIZED")

MsgBox(0,"",$win_size[0]&" x "&$win_size[1])
Edited by Mison

Hi ;)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0