Jump to content

Disable close window in GUI top right (X)


njdev1k
 Share

Recommended Posts

  • Administrators

Is there a way to grey out or disable the Close window button on the GUI window?

I am speaking of the "X" in the top right corner of the window.

In the current unstable version the close button just sends a message saying "close was clicked". You can decide what to do after getting the message, i.e. close the window or ignore it.
Link to comment
Share on other sites

I think there would be a way to use DllCall.... but the following fails :)

$hWnd = GuiCreate("foo", 300, 200)
GuiSetState()

$hMenu = DllCall("user32.dll", "long", "GetSystemMenu", "hwnd", $hWnd, "long", 0)
DllCall("user32.dll", "long", "DeleteMenu", "long", $hMenu, "long", 6, "long", 0x2)
DllCall("user32.dll", "long", "DrawMenuBar Lib", "hwnd", $hWnd)

While GuiGetMsg() <> -3
WEnd
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

$hWnd = GuiCreate("foo", 300, 200)

$hMenu = DllCall("user32.dll", "long", "GetSystemMenu", "hwnd", $hWnd, "long", 0)
DllCall("user32.dll", "long", "RemoveMenu", "long", $hMenu[0], "long", 6, "long", 0x400)

GuiSetState()

While GuiGetMsg() <> -3
WEnd

<{POST_SNAPBACK}>

Nice tip. :)
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...