Jump to content

GUI minimum size (no max)


MISIIM
 Share

Recommended Posts

I'm trying to get a GUI to have a minimum size but no maximum.

Func WM_GETMINMAXINFO($hWnd, $MsgID, $wParam, $lParam)
    #forceref $MsgID, $wParam
    If $hWnd = $window Then; the main GUI-limited
        Local $size = WinGetPos($window);
        
        Local $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
        DllStructSetData($minmaxinfo, 7, 515); min width
        DllStructSetData($minmaxinfo, 8, 400); min height
        DllStructSetData($minmaxinfo, 9, $size[2] + 20); max width
        DllStructSetData($minmaxinfo, 10, $size[3] + 20); max height
        Return 0
    Else
        Return 0
    EndIf
EndFunc

This can be resized to 20 px + the width but then you have to stop resizing (one can keep dragging but that is annoying). Does anyone know how to do this?

Thanks.

Link to comment
Share on other sites

Hi,

???

Func WM_GETMINMAXINFO($hWnd, $MsgID, $wParam, $lParam)
    #forceref $MsgID, $wParam
    If $hWnd = $window Then; the main GUI-limited
        Local $size = WinGetPos($window);
        
        Local $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
        DllStructSetData($minmaxinfo, 7, 515); min width
        DllStructSetData($minmaxinfo, 8, 400); min height
        Return 0
    Else
        Return 0
    EndIf
EndFunc

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...