Jump to content
Sign in to follow this  
Quinch

Resizable GUI

Recommended Posts

Quinch

Quick question - how do I create a GUI window that can be resized by dragging the borders, and can I set minimum possible size, i.e. width and height values that the window cannot be resized under?

Share this post


Link to post
Share on other sites
Achilles

When you create the GUI add $WS_SIZEBOX to the style.

For setting the max/min use this

GUIRegisterMsg($WM_GETMINMAXINFO, 'WM_GETMINMAXINFO')
with this function

Func WM_GETMINMAXINFO($hWnd, $MsgID, $wParam, $lParam)
    #forceref $MsgID, $wParam
    If $hWnd = $nowPlayingGUI Then; the main GUI-limited  
        Local $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
        DllStructSetData($minmaxinfo, 7, 300); min width
        DllStructSetData($minmaxinfo, 8, 200); min height
    EndIf
    
    Return 0
EndFunc
  • Like 1

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
Quinch

Thanks {though I have no idea how the second codebox works}.

That brings out another problem, though... if I set the style as sizebox, I lose the window controls in the title bar.

Edit: Ergh, disregard that. I mucked up the GuiCreate line.

Edited by Quinch

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  

×