Skizmata Posted November 23, 2010 Share Posted November 23, 2010 (edited) I am looking for a way to know if a window has the topmost attribute. I feel I have searched high and low and greatly look forward to your help.***EDIT*** To be clear I mean the attribute set by WinSetOnTop() not the current highest window in z order. (Thanks for point this out JohnOne)I don't want to have to do a work around hack (invisible windows over other windows sort of thing).If you find a thread I have missed in my searching that addresses this I would gladly have this one deleted.I found some info on msdn(http://msdn.microsoft.com/en-us/library/system.windows.window.topmost.aspx) that I thought looked promising. Is this telling me that a DllCall to PresentationFramework.dll is what I need to get the .Topmost property out of a window? If so how do I learn how to go about that. I have had little success with understanding how to track down how to do a DllCall.If I'm barking up the wrong tree a nudge in the right direction would be appreciated.Thanks Edited November 23, 2010 by Skizmata AutoIt changed my life. Link to comment Share on other sites More sharing options...
JohnOne Posted November 23, 2010 Share Posted November 23, 2010 (edited) I have found that winlist returns windows in there z order, so the first window found in winlist() is the topmost. Actually, its asked quite a few times, perhaps is one of the devs confirms this, it might one day be added to the remarks in the documentation, if its worth it. Edited November 23, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Skizmata Posted November 23, 2010 Author Share Posted November 23, 2010 Thanks JohnOne that is a good place to start looking. Unfortunately I think I wasn't clear in my first post (I hope I can fist it after I post this in case no one reads on). I'm looking for the attribute set in AutoIt by WinSetOnTop() not necessarily the windows that are at the top at any given moment. True these are likly one and the same but a window with WinSetOnTop() true can be minimized or under another window with that attribute also set to true. I hope I am making myself more clear. Thanks again JohnOne for a quick interaction. AutoIt changed my life. Link to comment Share on other sites More sharing options...
JohnOne Posted November 23, 2010 Share Posted November 23, 2010 Then maybe wingetstate is what you want, to test if its active? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 23, 2010 Moderators Share Posted November 23, 2010 Skizmata,You can get the currently set styles by calling the API like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> $hGUI = GUICreate("Test", 500, 500, -1, -1, -1, $WS_EX_TOPMOST) GUISetState() $iExStyle = _WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE) If BitAnd($iExStyle, $WS_EX_TOPMOST) Then ConsoleWrite("TopMost set!" & @CRLF) Else ConsoleWrite("Normal" & @CRLF) EndIf While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($hGUI) ExitLoop EndSwitch WEnd $hGUI = GUICreate("Test", 500, 500) GUISetState() $iExStyle = _WinAPI_GetWindowLong($hGUI, $GWL_EXSTYLE) If BitAnd($iExStyle, $WS_EX_TOPMOST) Then ConsoleWrite("TopMost set!" & @CRLF) Else ConsoleWrite("Normal" & @CRLF) EndIf While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndIf you use $GWL_STYLE in the API call, you get the normal styles in case that was your next question. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skizmata Posted November 23, 2010 Author Share Posted November 23, 2010 Wonderful! Melba23! Stop the clock at just under 15 minutes the AutoIt forums does it again. This is as I'm sure you well know, exactly what I was hunting for. I can't thank you enough. But just to make this thread even better for any future seekers that discover it. If you where to reverse engineer my situation using the help file, the forums and web searches what is the most likely way I would have found this on my own? It appears to me I need to read and understand WinAPI.au3 thank you so much! AutoIt changed my life. Link to comment Share on other sites More sharing options...
GEOSoft Posted November 23, 2010 Share Posted November 23, 2010 The trick is to read and understand the Help file. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 23, 2010 Moderators Share Posted November 23, 2010 Skizmata,Reading the Setting Styles tutorial in the Wiki would have given you the solution immediately. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skizmata Posted November 23, 2010 Author Share Posted November 23, 2010 Thanks Melba23 I didn't even know the wiki existed. Those who can actually help instead of posting obvious flame bate have no doubt earned the MVP group status. Thanks for adding this to the wiki. AutoIt changed my life. 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