1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| ; Example of external program
Run("calc")
WinWait("Calculator")
$calcHwnd = WinGetHandle("Calculator")
$menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $calcHwnd, "int",0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE
; Example with own AutoIt GUI
$GUI = GuiCreate("Example")
$menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $GUI, "int",0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE
GuiSetState(@SW_SHOW)
While 1
; WE COULD ALSO CHOOSE NOT TO DO ANYTHING UPON A CLOSE EVENT
sleep(100)
WEnd |
Partager