Jump to content

About "Always On Top" attribute


zhao
 Share

Recommended Posts

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 6 months later...

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
 Share

  • Recently Browsing   0 members

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