Jump to content
Sign in to follow this  

Why is this script to disable the minimize button not working?

Recommended Posts


So I saw this this Superuser answer saying that I could use that script to disable the window buttons. I adapted it into this:

#include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <GuiMenu.au3>

While 1
    $windows = WinList()
    For $i =1 To $windows[0][0]
        $windowState =  WinGetState($windows[$i][1])
            $isVisible = BitAND($windowState,2) = 2
            If $windows[$i][0] = '' Or not $isVisible Then ContinueLoop
        $h = $windows[$i][1]
        $iOldStyle = _WinAPI_GetWindowLong($h, $GWL_STYLE)
            $iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX)
            _WinAPI_SetWindowLong($h, $GWL_STYLE, $iNewStyle)
            _WinAPI_ShowWindow($h, @SW_SHOW)

so that any new windows would have the button disabled. However, it just flickers it. What should I do?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.