Jump to content

Recommended Posts

Posted (edited)

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)
GUISetState()

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
            Exit
    EndSwitch
Wend

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

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
×
×
  • Create New...