Ok, I didn't realized, there is a nice UDF for manipulating menus, so it's even easier: ; Original script: http://www.autoitscript.com/forum/topic/100125-disable-close-button/#entry716490 ; USer32.dll functions: http://msdn.microsoft.com/en-us/library/ms647985(v=vs.85).aspx #include <GuiMenu.au3> Run("Notepad") WinWait("Untitled - Notepad") $handle = WinGetHandle("Untitled - Notepad") ConsoleWrite('+ Window Handle: ' & $handle & @CRLF) DisableButton($handle, $SC_CLOSE) ;~ Enab