Jump to content

Recommended Posts

Posted

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
Posted

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.

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
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
Posted

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

  • 6 months later...
Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...