Sign in to follow this  
Followers 0
zhao

About "Always On Top" attribute

12 posts in this topic

How can I know whether a window is already on top ?


Share this post


Link to post
Share on other sites



winwaitactive?

Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by pjotterke

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by zhao

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Could anyone help with it?


Share this post


Link to post
Share on other sites

Have you tested

I'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

Share this post


Link to post
Share on other sites

the return value of WM_QUERYUISTATE has no use


Share this post


Link to post
Share on other sites

#11 ·  Posted (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 by StooJ

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0