Jump to content
Sign in to follow this  
njdev1k

Disable close window in GUI top right (X)

Recommended Posts

njdev1k

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.

Share this post


Link to post
Share on other sites
Jon

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.

Share this post


Link to post
Share on other sites
CyberSlug

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!

Share this post


Link to post
Share on other sites
Josbe

$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. :)

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.