Hi,
I try to program a gui for some simple things and I want to save the window size (it is a resizeable gui), when the program is closed. After a restart the gui should have the same size as before closing. The problem is, that WinGetPos and WinGetClientSize give me weird values. Have a look at this example.
CODE#include <GUIConstants.au3>
#include <WindowsConstants.au3>
$gui = GUICreate ("",500,500,100,100,$WS_MAXIMIZEBOX+$WS_MINIMIZEBOX+$WS_CAPTION+$WS_SIZEBOX)
$size1 = WinGetPos($gui)
$size2= WinGetClientSize($gui)
MsgBox(1,"created a gui with 500x500","Style: $WS_MAXIMIZEBOX+$WS_MINIMIZEBOX+$WS_CAPTION+$WS_SIZEBOX" & @crlf & @crlf & "WinGetPos: " & $size1[2] & " " & $size1[3] & " WinGetClientSize: " & $size2[0] & " " & $size2[1])
$gui = GUICreate ("",500,500,100,100,$WS_SIZEBOX)
$size1 = WinGetPos($gui)
$size2= WinGetClientSize($gui)
MsgBox(1,"created a gui with 500x500","Style: $WS_SIZEBOX" & @crlf & @crlf & "WinGetPos: " & $size1[2] & " " & $size1[3] & " WinGetClientSize: " & $size2[0] & " " & $size2[1])
$gui = GUICreate ("",500,500,100,100,$WS_SYSMENU)
$size1 = WinGetPos($gui)
$size2= WinGetClientSize($gui)
MsgBox(1,"created a gui with 500x500","Style: $WS_SYSMENU" & @crlf & @crlf & "WinGetPos: " & $size1[2] & " " & $size1[3] & " WinGetClientSize: " & $size2[0] & " " & $size2[1])
on my computer the first gui is:
WinGetPos 508 529, WinGetClientSize 500 500
the second gui:
WinGetPos 506 506, WinGetClientSize 498 477
the third gui:
WinGetPos 500 500, WinGetClientSize 494 473
??? This means WinGetPos and WinGetClientSize show different gui sizes than created. How should I handle this?