本帖最后由 xiehuahere 于 2011-11-10 13:21 编辑
官网的这个帖子有详细回答。
http://www.autoitscript.com/foru ... _hl__disable++close; Example of external program
Run("calc")
WinWait("Calculator")
$calcHwnd = WinGetHandle("Calculator")
$menu = DllCall("user32.dll", "hwnd", "GetSystemMenu", "hwnd", $calcHwnd, "bool", False)
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, "bool", False)
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
DllCall还是很强大的,一起来学习吧:你DllCall了吗? |