zhao Posted February 21, 2007 Posted February 21, 2007 How can I know whether a window is already on top ?
zhao Posted February 21, 2007 Author Posted February 21, 2007 I mean the "Always On Top" ,not the "active". I just want to know whether a window is "Always On Top". My English is not very well,I wish you could understant.
Moderators SmOke_N Posted February 21, 2007 Moderators Posted February 21, 2007 I'm not entirely sure, but you may be able to get it with _SendMessage() and WM_QUERYUISTATE. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
pjotterke Posted February 21, 2007 Posted February 21, 2007 (edited) Don't know what you exactly want to try... But maybe this? winsetontop if you want that a window is on top and want to be sure of it you can use it... but explain what you want to do with that piece of code... Edited February 21, 2007 by pjotterke
zhao Posted February 22, 2007 Author Posted February 22, 2007 (edited) Here is the code, maybe I need to use Windows API #include <GuiConstants.au3> GuiCreate("MyGUI", 241, 80,-1,-1,-1,$WS_EX_TOPMOST) $Label_1 = GuiCtrlCreateLabel("Windows title:", 10, 10, 90, 20) $Input_2 = GuiCtrlCreateInput("", 110, 10, 120, 20) $Button_3 = GuiCtrlCreateButton("set on top flag", 120, 40, 110, 30) GuiSetState() While 1 $newtitle = WinGetTitle ("") If $newtitle <> GUICtrlRead($Input_2) And $newtitle <> "MyGUI" Then GUICtrlSetData($Input_2,$newtitle) ;If the windows is "Always On Top" ,then GUICtrlSetData($Button_3,"remove on top flag") ;If the windows is not "Always On Top" ,then GUICtrlSetData($Button_3,"set on top flag") EndIf $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_3 ;If the windows is "Always On Top" ,then WinSetOnTop (GUICtrlRead($Input_2), "", 0) ;If the windows is not "Always On Top" ,then WinSetOnTop (GUICtrlRead($Input_2), "", 1) EndSelect WEnd Exit Edited February 22, 2007 by zhao
theguy0000 Posted February 22, 2007 Posted February 22, 2007 interesting question...I'll look into it. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
Shevilie Posted February 22, 2007 Posted February 22, 2007 Have you testedI'm not entirely sure, but you may be able to get it with _SendMessage() and WM_QUERYUISTATE. Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
zhao Posted February 22, 2007 Author Posted February 22, 2007 the return value of WM_QUERYUISTATE has no use
StooJ Posted September 6, 2007 Posted September 6, 2007 (edited) I know I'm a little late to this one. How about : GUICreate ( "Always On Top" , 220 , 360 , -1 , -1 , -1 , $WS_EX_TOPMOST ) Edited September 6, 2007 by StooJ
weaponx Posted September 6, 2007 Posted September 6, 2007 I'm pretty sure all he wants is to be able to check if an existing window is set to "Always on top", not create a gui on top or even move a window to the top of the stack.
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