Sign in to follow this  
Followers 0
racerrunner

Disable Minimise and Close button

6 posts in this topic

Hi all,

Is there a way to disable the Minimise and Close button?

GUICreate("Testing", 200, 200)

$today = GuiCtrlCreateButton("Add", 30, 20, 140, 30)

$yesterday = GuiCtrlCreateButton("Remove", 30, 60, 140, 30)

How to remove the min n close button that come with the GUI windows.

Thank You.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Look at the opt

#include <GUIConstants.au3>
#NoTrayIcon
Opt('GUIEventOptions', 1)
HotKeySet('{esc}', '_Exit');Press the Esc key to exit out

$GUI = GUICreate('')
GUISetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ToolTip('You tried to close me!!')
    Case $msg = $GUI_EVENT_MINIMIZE
        ToolTip('You tried to minimize me!!')
    EndSelect
WEnd

Func _Exit()
    Exit 0
EndFunc
Edit:

LOL, It had the tongue.gif in the CODE AUTOIT .... just changed the : p to !!

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thank You SmOke_N. What I mean is there a way not to show the minimise and close buttons at all

or disable it like the maximum button?

Thank You.

Share this post


Link to post
Share on other sites

Have a look at GuiCreate in the helpfile and note the options of using Styles and ExStyles

Share this post


Link to post
Share on other sites

Thank You SmOke_N. What I mean is there a way not to show the minimise and close buttons at all

or disable it like the maximum button?

Thank You.

#include <GUIConstants.au3>
#NoTrayIcon
HotKeySet('{esc}', '_Exit');Press the Esc key to exit out

$GUI = GUICreate('', 200, 100, 100, 100, $WS_DLGFRAME)
$Button = GUICtrlCreateButton('button 1', 10, 10, 60, 30)
GUISetState(@SW_SHOW)

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $Button
        ToolTip('You clicked the button!!')
    EndSelect
WEnd

Func _Exit()
    Exit 0
EndFunc

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thank You SmOke_N and MHZ.

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  
Followers 0