You can disable any of you want with these functions: The following forum topic solution is very good: (The close button is "greyed" out, the other two are still visible. Now, what if you want only disable the buttons, but don't want to remove them ? You can find more about Window styles on MSDN or Autoit help So it is very important to run it after setting the style. To show up properly after the style change, I tried redrawing the window, redrawing everything, sending WM_PAINT message to the Window, calling SetWindowLong() with different handles and options, nothing worked, until I found this comment. The trickiest part caused me the biggest headache that if you just set the window style with a SetWindowLong() API call, but don't run _WinAPI_ShowWindow ( $h, ) the following can happen. The cool part about these is that you can still close the window with ALT+F4 or minimize it clicking the tray icon. $iNewStyle = BitXOr ( $iOldStyle, $WS_SYSMENU ) $iNewStyle = BitXOr ( $iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX ) #include #include #include $h = WinGetHandle ( "Untitled - Note" ) $iOldStyle = _WinAPI_GetWindowLong ( $h, $GWL_STYLE ) ConsoleWrite ( "+ old style: " & amp $iOldStyle & $iNewStyle = BitXOr ( $iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX ) _WinAPI_SetWindowLong ( $h, $GWL_STYLE, $iNewStyle ) _WinAPI_ShowWindow ( $h, ) 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |