Created
January 13, 2013 01:01
-
-
Save kissgyorgy/4521498 to your computer and use it in GitHub Desktop.
AutoIt: Set window style in runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; For explanation, see this forum topic: http://www.autoitscript.com/forum/topic/147424-disable-or-remove-close-minimize-maximize-buttons-on-any-window-in-runtime/ | |
#include <WinAPI.au3> | |
#include <Constants.au3> | |
#include <WindowsConstants.au3> | |
$h = WinGetHandle("Untitled - Note") | |
$iOldStyle = _WinAPI_GetWindowLong($h, $GWL_STYLE) | |
ConsoleWrite("+ old style: " & $iOldStyle & @CR) | |
;~ $iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX) | |
$iNewStyle = BitXOr($iOldStyle, $WS_SYSMENU) | |
_WinAPI_SetWindowLong($h, $GWL_STYLE, $iNewStyle) | |
_WinAPI_SetWindowPos($h, 0, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment