Jump to content

Disable Minimise and Close button


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

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

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.

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