Jump to content

$WS_SIZEBOX size (stretch min/max value)


Recommended Posts

Hello,

I once found this here in the forum:

Global $aUtil_MinMax[4]

Func initMinMax($x0,$y0,$x1,$y1)
    Local Const $WM_GETMINMAXINFO = 0x24
    $aUtil_MinMax[0]=$x0
    $aUtil_MinMax[1]=$y0
    $aUtil_MinMax[2]=$x1
    $aUtil_MinMax[3]=$y1
    GUIRegisterMsg($WM_GETMINMAXINFO,'MY_WM_GETMINMAXINFO')
EndFunc

Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam)
    Local $minmaxinfo = DllStructCreate('int;int;int;int;int;int;int;int;int;int',$lParam)
    DllStructSetData($minmaxinfo,7,$aUtil_MinMax[0]); min X
    DllStructSetData($minmaxinfo,8,$aUtil_MinMax[1]); min Y
    DllStructSetData($minmaxinfo,9,$aUtil_MinMax[2]); max X
    DllStructSetData($minmaxinfo,10,$aUtil_MinMax[3]); max Y
    Return 0
EndFunc

ciao

Xandl

Link to comment
Share on other sites

The array has to be global :(

Use initMinMax() to set the bounds.

GUIRegisterMsg() does the rest :)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $aUtil_MinMax[4]

GUICreate('WM_GETMINMAXINFO',400,400,-1,-1,$WS_SIZEBOX)
GUISetState()
initMinMax(100,100,600,600)

Do
    Sleep(20)
Until GUIGetMsg() = -3

Func initMinMax($x0,$y0,$x1,$y1)
    Local Const $WM_GETMINMAXINFO = 0x24
    $aUtil_MinMax[0]=$x0
    $aUtil_MinMax[1]=$y0
    $aUtil_MinMax[2]=$x1
    $aUtil_MinMax[3]=$y1
    GUIRegisterMsg($WM_GETMINMAXINFO,'MY_WM_GETMINMAXINFO')
EndFunc

Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam)
    Local $minmaxinfo = DllStructCreate('int;int;int;int;int;int;int;int;int;int',$lParam)
    DllStructSetData($minmaxinfo,7,$aUtil_MinMax[0]); min X
    DllStructSetData($minmaxinfo,8,$aUtil_MinMax[1]); min Y
    DllStructSetData($minmaxinfo,9,$aUtil_MinMax[2]); max X
    DllStructSetData($minmaxinfo,10,$aUtil_MinMax[3]); max Y
    Return $GUI_RUNDEFMSG
EndFunc

ciao

Xandl

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...