Jump to content

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)
    Next
    Sleep(500)
WEnd

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...