JusGellin Posted March 31, 2008 Share Posted March 31, 2008 I'm making an application that can set the active window to be on top or not using hotkeys. I know how to do this part. But how can I list all the windows that have been set to always be on time? I want to be able list all of them and then put them back to normal mode using my code. Thanks Link to comment Share on other sites More sharing options...
covaks Posted April 1, 2008 Share Posted April 1, 2008 Use GetWindowLong to get extended styles. Then go through with WinList and see which ones have $WS_EX_TOPMOST set. The help for WinList already does this almost, we just have to add the check for the extended style #include <WinAPI.au3> #include <Misc.au3> $aWin = WinList() $iExStyles = 0 For $x = 1 to $aWin[0][0] $iExStyles = _WinAPI_GetWindowLong($aWin[$x][1],$GWL_EXSTYLE) If $aWin[$x][0] <> "" AND IsVisible($aWin[$x][1]) Then If BitAND($iExStyles,$WS_EX_TOPMOST) Then msgbox(1,"",$aWin[$x][0] & " is Topmost") EndIf EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Link to comment Share on other sites More sharing options...
JusGellin Posted April 1, 2008 Author Share Posted April 1, 2008 Fantastic!! It works great. How did you know how to do this? Did you know this already or just know where to look? Thanks so very much, I really appreciate it. Link to comment Share on other sites More sharing options...
covaks Posted April 1, 2008 Share Posted April 1, 2008 Get familiar with the Windows API. It can be confusing at first, but once you figure out the basic concepts you can find some neato stuff. A lot of autoit functions are wrappers for these. And there's a bunch of _WinAPI functions in the help. ->http://msdn2.microsoft.com/en-us/library/a...688(VS.85).aspxhttp://msdn2.microsoft.com/en-us/library/a...686(VS.85).aspx Link to comment Share on other sites More sharing options...
JusGellin Posted April 1, 2008 Author Share Posted April 1, 2008 Thanks for the encouragement and tips. This is really good stuff. I'm going to look into this. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now