Jump to content
Sign in to follow this  
Sundance

GUI resize

Recommended Posts

Sundance

Hiho,

does anyone of you know if i can create a gui which is only resizeable in height and not in width? Haven't found any clear solution.

greetz

Sundance

Share this post


Link to post
Share on other sites
Zedna

#include <GUIConstants.au3>
Global $size, $width

$gui = GUICreate("Test GUI",500,500,-1,-1,BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX))
$size = WinGetPos($gui)
$width = $size[2] ; width of window (GUICreate is ClientSize)
GUISetState (@SW_SHOW)
GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO")

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
    
Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam)
 $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam)
 DllStructSetData($minmaxinfo,7,$width) ; min X
 DllStructSetData($minmaxinfo,8,250) ; min Y
 DllStructSetData($minmaxinfo,9,$width) ; max X
 DllStructSetData($minmaxinfo,10,700) ; max Y
 Return 0
EndFunc

#cs
typedef struct {
    POINT ptReserved;
    POINT ptMaxSize;
    POINT ptMaxPosition;
    POINT ptMinTrackSize;
    POINT ptMaxTrackSize;
} MINMAXINFO;
#ce

Share this post


Link to post
Share on other sites
Sundance

Perfect Zedna!

After inserting the GuiConstantsEx.au3 it works. Many thanks !!!!

greetz

Sundance

Share this post


Link to post
Share on other sites
v3rt1g0

Thank you Zedna :P

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  

×