Jump to content

[Solved] All windows taken off WinSetOnTop


Recommended Posts

Hello,

I'm wondering if there is a way to remove all windows with the status set on top? 

I know this can be easily done if you know the title or have the window as an active window, but I'm wondering if there is something that will apply to all windows at once to remove this status?

Thanks

Edited by AnonymousX
Link to comment
Share on other sites

15 hours ago, spudw2k said:

You can try using the WinList function in conjuntion with the _WinAPI_SetWindowPos function.

https://www.autoitscript.com/autoit3/docs/functions/WinList.htm

https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_SetWindowPos.htm


 

Thanks that was exactly what I needed. 

For future reference here's the function I used:

HotKeySet("^\", "Toggletop"); toggles window from being set to top
Global $topstatus = 0; determins if a window has been set on top

while true
wend

Func Toggletop()

    if $topstatus== 0 Then;No window is on top
        $hWnd = WinGetHandle("[ACTIVE]")
        $topstatus=1
        WinSetOnTop($tWnd,"",$topstatus)
    Else;A window is on top
        $topstatus=0
        $allwind = WinList()
        For $i=0 to UBound($allwind)-1 step 1
            WinSetOnTop($allwind[$i][0],"",$topstatus)
        Next
    EndIf

    ;WinSetOnTop($window,"",1);My GUI that I permanently want on top

EndFunc

 

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

×
×
  • Create New...