Can the Gui's close button be disabled Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
songdg
Posts: 597
Joined: 04 Oct 2017, 20:04

Can the Gui's close button be disabled

18 Apr 2024, 22:00

Can the Gui's close button(upper right corner) be disabled, like the enlarge button turn grey.
Attachments
close_button.png
(9.02 KiB) Downloaded 175 times
Last edited by songdg on 18 Apr 2024, 23:06, edited 1 time in total.
ntepa
Posts: 432
Joined: 19 Oct 2022, 20:52

Re: Can the Gui's close button be disabled

18 Apr 2024, 22:29

Return 1 on gui close:

Code: Select all

MyGui := Gui()
MyGui.OnEvent("Close", (*)=>1)
MyGui.Show("w200 h50")
songdg
Posts: 597
Joined: 04 Oct 2017, 20:04

Re: Can the Gui's close button be disabled

18 Apr 2024, 23:17

ntepa wrote:
18 Apr 2024, 22:29
Return 1 on gui close:

Code: Select all

MyGui := Gui()
MyGui.OnEvent("Close", (*)=>1)
MyGui.Show("w200 h50")
Thanks, I just want it to turn grey, so no one would even bother to click on it.
Rohwedder
Posts: 7704
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Can the Gui's close button be disabled  Topic is solved

19 Apr 2024, 01:35

Hallo,
try:

Code: Select all

#Requires AutoHotkey v2.0
MyGui := Gui()
DllCall("user32\DeleteMenu", "UInt", DllCall("user32\GetSystemMenu"
, "UInt", MyGui.Hwnd, "UInt", False), "UInt", 0xF060, "UInt", 0)
MyGui.Show("w200 h50")
"Min": 0xF020
"Max": 0xF030
"Close": 0xF060
songdg
Posts: 597
Joined: 04 Oct 2017, 20:04

Re: Can the Gui's close button be disabled

20 Apr 2024, 07:54

Rohwedder wrote:
19 Apr 2024, 01:35
Hallo,
try:

Code: Select all

#Requires AutoHotkey v2.0
MyGui := Gui()
DllCall("user32\DeleteMenu", "UInt", DllCall("user32\GetSystemMenu"
, "UInt", MyGui.Hwnd, "UInt", False), "UInt", 0xF060, "UInt", 0)
MyGui.Show("w200 h50")
"Min": 0xF020
"Max": 0xF030
"Close": 0xF060
Danke schön :thumbup:

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Descolada, Google [Bot] and 46 guests