Jump to content

Search the Community

Showing results for tags 'tagminmaxinfo'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. At some point we've all seen the example for WM_GETMINMAXINFO floating around the forum, in regards to restricting the size of the GUI. I therefore decided to have a look at this and see if it could be rearranged to use structures and code already predefined in AutoIt and the UDFs. Sometimes users like to duplicate variables that may already exist in WindowsConstants.au3 or StructureConstants.au3 and it can cause problems down the line if the variable values change. You never know $GUI_EVENT_CLOSE (-3) might change to -99 one day, so this is why 'magic numbers' are bad to use in examples. So having read about WM_GETMINMAXINFO on MSDN, the structure that was required turned out to be tagMINMAXINFO, which was made up of 5 tagPOINT structures (long X;long Y;) strung together. So I created the following code below and will probably propose that the tagMINMAXINFO structure be added to the AutoIt UDFs. So my questions is: Does the structure look correct? Or should I use a different approach? Any feed back is much appreciated. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <Windowsconstants.au3> ; MINMAXINFO Struct >> http://msdn.microsoft.com/en-us/library/windows/desktop/ms632605(v=vs.85).aspx ; It uses a $tagPOINT structure which is long X; long Y; Global Const $tagMINMAXINFO = "struct; long ReservedX;long ReservedY;long MaxSizeX;long MaxSizeY;long MaxPositionX;long MaxPositionY;" & _ "long MinTrackSizeX;long MinTrackSizeY;long MaxTrackSizeX;long MaxTrackSizeY; endstruct" ; GUI API for setting the minimum an maximum sizes of the GUI. These don't need to be called by the end user, but rather use _GUISetSize(). Global Enum $__iMinSizeX, $__iMinSizeY, $__iMaxSizeX, $__iMaxSizeY, $__iGUISizeMax Global $__vGUISize[$__iGUISizeMax] Example() Func Example() ; Create a resizable GUI. Local $hGUI = GUICreate('', Default, Default, Default, Default, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) GUISetState(@SW_SHOW, $hGUI) ; Set the minimum and maximum sizes of the GUI. _GUISetSize(150, 150, 500, 500) ; Register the WM_GETMINMAXINFO message. GUIRegisterMsg($WM_GETMINMAXINFO, 'WM_GETMINMAXINFO') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUISetSize($iMinWidth, $iMinHeight, $iMaxWidth, $iMaxHeight) $__vGUISize[$__iMinSizeX] = $iMinWidth $__vGUISize[$__iMinSizeY] = $iMinHeight $__vGUISize[$__iMaxSizeX] = $iMaxWidth $__vGUISize[$__iMaxSizeY] = $iMaxHeight EndFunc ;==>_GUISetSize Func WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) ; Original idea by Zedna & updated by guinness 21/09/12. #forceref $hWnd, $iMsg, $wParam Local $tMINMAXINFO = DllStructCreate($tagMINMAXINFO, $lParam) DllStructSetData($tMINMAXINFO, 'MinTrackSizeX', $__vGUISize[$__iMinSizeX]) DllStructSetData($tMINMAXINFO, 'MinTrackSizeY', $__vGUISize[$__iMinSizeY]) DllStructSetData($tMINMAXINFO, 'MaxTrackSizeX', $__vGUISize[$__iMaxSizeX]) DllStructSetData($tMINMAXINFO, 'MaxTrackSizeY', $__vGUISize[$__iMaxSizeY]) EndFunc ;==>WM_GETMINMAXINFO
×
×
  • Create New...