Jump to content

Recommended Posts

Posted

I'm specifying $WS_SIZEBOX to allow resizing of my main GUI window ... which works. But I only want to allow resizing of the window height. How can I inhibit any change to the width?

Thanks for any help.

Posted

I had tried $GUI_DOCKWIDTH as the default at the top of my script. It only affected controls within the window — not the whole window.

I've since placed it immediately after the GUICreate and specifically for the ContolID of the window ... but that didn't work, either.

Is there a different way to use it?

Posted (edited)

Try this

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$hGUI = GUICreate ( "Lock Width", 500, 200, -1, -1, $WS_SIZEBOX )
GUISetState ( )
GUIRegisterMsg ( $WM_GETMINMAXINFO, "_WM_GETMINMAXINFO" )

While 1
    If GUIGetMsg ( ) = -3 Then Exit
WEnd

Func _WM_GETMINMAXINFO ( $hwnd, $Msg, $wParam, $lParam )
    $tagMaxinfo = DllStructCreate ( "int;int;int;int;int;int;int;int;int;int", $lParam )
    DllStructSetData ( $tagMaxinfo,  7, 500 ) ; width Min 500
    DllStructSetData ( $tagMaxinfo,  9, 500 ) ; width Max 500
    Return $GUI_RUNDEFMSG
EndFunc ;==> _WM_GETMINMAXINFO ( )
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Posted

Indeed, that does work. Rather than disallow resizing (and not show <-> cursor change), it restricts width to a range ... which is set "500 to 500".

Interesting. I certainly would have never thought of such an approach. But unless someone knows how to "disallow", I'll go with it.

Thanks very much.

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
  • Recently Browsing   0 members

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