Jump to content
Sign in to follow this  

Winmove size wrong?

Recommended Posts


How is it that a GUICreate("TESTING", 185, 340) is bigger then after a resize with WinMove($GUI,default,default,default,185, 340)?

In this case there's a loss of Width: 6 and Height: 32

Here's a script to test:

#include <GUIConstantsEx.au3>

$GUI = GUICreate("TESTING", 185, 340)
$go = GUICtrlCreateButton("Resize", 8, 177, 90, 17)

While 1
    $nmsg = guigetmsg()
    switch $nmsg
        case $Go
            $SizeReturns = WinGetClientSize($GUI)
            MsgBox(0,"","Width: "&$SizeReturns[0]&@CRLF&"Height: "&$SizeReturns[1]&@CRLF&"..Now moving window to same position..press OK")
            WinMove($GUI,default,default,default,185, 340)
            $SizeReturns = WinGetClientSize($GUI)
            MsgBox(0,"","Width: "&$SizeReturns[0]&@CRLF&"Height: "&$SizeReturns[1])
        case $GUI_EVENT_CLOSE

Update; I think i figured this one out by myself, seems Winmove doesn't take the Title bar into consideration when resizing.

For the default XP theme, Width: +6 and Height: +32 is needed to compensate..Its another value for the classic themes.

Edited by Datenshi

Share this post

Link to post
Share on other sites

Yes. Width,Height in GUICreate() is meant for client area not for whole window size.

WinMove() uses whole window's size.

In latest Autoit beta this is explicitly described in helpfile at GUICreate()

Here is related ticket


Edited by Zedna

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.