However, there is a it took me several hours to figure out how to do it on other windows in runtime, so I tought it might help others. So you want to remove buttons like this: #include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
$h = WinGetHandle("Untitled - Note")
$iOldStyle = _WinAPI_GetWindowLong($h, $GWL_STYLE)
ConsoleWrite("+ old style: " &amp; $iOldStyle &amp; @CR)
$iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZE
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