Jump to content
Sign in to follow this  
AoRaToS

How to disable minimize button..

Recommended Posts

AoRaToS

Hello again!I've made a program but I want it so that if you press a button it disable the minimize button so you can't minimize it and it appears again once finished,I believe it's a GUICtrlSetState but how do I define the minimize button?How is it called?Any help appreciated...


s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites
therks

I didn't think this was possible, so I had to test it myself. And rather than let my test go to waste, I figured I might as well show it here as an example.

#include <GUIConstants.au3>
#include <WindowsConstants.au3>

$iStyle1 = BitOr($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style with minimize box
$iStyle2 = BitOr($WS_MAXIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU); Style without minimize box

$gui = GUICreate('', 200, 200, -1, -1, $iStyle1)
$bt1 = GUICtrlCreateButton('Click me to enable', 5, 5, 120, 25)
$bt2 = GUICtrlCreateButton('Click me to disable', 5, 35, 120, 25)
GUISetState()

While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $bt1
            GUISetStyle($iStyle1)
        Case $bt2
            GUISetStyle($iStyle2)
    EndSwitch
WEnd

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.