Jump to content

"Always on top" window attribute


 Share

Recommended Posts

Does Autoit provide a mechanism of determining whether the currently active window is defined to be "always ontop". I'm not sure if I have the name of this attribute correctly but some windows are defined to always stay on top of all others.

Thanks

SHX

Link to comment
Share on other sites

Does Autoit provide a mechanism of determining whether the currently active window is defined to be "always ontop". I'm not sure if I have the name of this attribute correctly but some windows are defined to always stay on top of all others.

Thanks

SHX

Anyone?

Link to comment
Share on other sites

No, i don think that there any specific command that can get this info (and to bad), this example is show that even WinGetState() can not get this info:

$Gui = GUICreate("test", 200, 200)
GUISetState()
WinSetOnTop($Gui, "", 0)

MsgBox(262144, "", WinGetState($Gui))

Just change the 0 to 1, and run it after, and before, and you will always get 15.

But maby it is possible using DllCals, but you should ask someone ho work better then me with DllCalls funcs :whistle:.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

No, i don think that there any specific command that can get this info (and to bad), this example is show that even WinGetState() can not get this info:

$Gui = GUICreate("test", 200, 200)
GUISetState()
WinSetOnTop($Gui, "", 0)

MsgBox(262144, "", WinGetState($Gui))

Just change the 0 to 1, and run it after, and before, and you will always get 15.

But maby it is possible using DllCals, but you should ask someone ho work better then me with DllCalls funcs :whistle:.

Thanks, but I don't know who to ask. I think that "GetwindowsLong" gives that info but I don't know how to use it.

Link to comment
Share on other sites

  • Moderators

See if this works:

$hWin = WinGetHandle('Window Name Here')
If _WinIsOnTop($hWin) Then MsgBox(64, 'Info', 'Window has On Top Attribute')

Func _WinIsOnTop($hWnd)
    If IsHWnd($hWnd) = 0 And WinExists($hWnd) Then $hWnd = WinGetHandle($hWnd)
    Local $aU32DLL = DllCall('User32.dll', 'long', 'GetWindowLong', 'hwnd', $hWnd, 'int', -20)
    If IsArray($aU32DLL) Then Return BitAND(0x00000008, $aU32DLL[0])
    Return SetError(1, 0, 0)
EndFuncoÝ÷ ØGb´LZ^¡û¬y«­¢+Ù1½°ÀÌØí]0ô]¥¹1¥ÍÐ ¤°ÀÌØíÍ]¥¹Ì)½ÈÀÌØí¥
ôÄQ¼U    ½Õ¹ ÀÌØí]0¤´Ä(%%ÀÌØí]1lÀÌØí¥

ulÁt±ÐìÐìÌäìÌäì¹}]¥¹%Í=¹Q½À ÀÌØí]1lÀÌØí¥

ulÅt¤Q¡¸($$ÀÌØíÍ]¥¹ÌµÀìôÌäí9µèÌäìµÀìÀÌØí]1lÀÌØí¥

ulÁtµÀì
I1µÀìÌäí!¹±èÌäìµÀìÀÌØí]1lÀÌØí¥

ulÅtµÀì
I1(%¹%)9áÐ)5Í   ½à À°ÌäìÌäì°ÀÌØíÍ]¥¹Ì¤()Õ¹}]¥¹%Í=¹Q½À ÀÌØí¡]¹¤(%%%Í!]¹ ÀÌØí¡]¹¤ôÀ¹]¥¹á¥ÍÑÌ ÀÌØí¡]¹¤Q¡¸ÀÌØí¡]¹ô]¥¹Ñ!¹± ÀÌØí¡]¹¤(%1½°ÀÌØíTÌÉ10ô±±
±° ÌäíUÍÈÌȹ±°Ìäì°Ìäí±½¹Ìäì°ÌäíÑ]¥¹½Ý1½¹Ìäì°Ìäí¡Ý¹Ìäì°ÀÌØí¡]¹°Ìäí¥¹ÐÌäì°´ÈÀ¤(%%%ÍÉÉä ÀÌØíTÌÉ10¤Q¡¸IÑÕɸ ¥Ñ9 ÁàÀÀÀÀÀÀÀà°ÀÌØíTÌÉ11lÁt¤(%IÑÕɸMÑÉÉ½È Ä°À°À¤)¹Õ¹

Edited by SmOke_N

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

See if this works:

$hWin = WinGetHandle('Window Name Here')
If _WinIsOnTop($hWin) Then MsgBox(64, 'Info', 'Window has On Top Attribute')

Func _WinIsOnTop($hWnd)
    If IsHWnd($hWnd) = 0 And WinExists($hWnd) Then $hWnd = WinGetHandle($hWnd)
    Local $aU32DLL = DllCall('User32.dll', 'long', 'GetWindowLong', 'hwnd', $hWnd, 'int', -20)
    If IsArray($aU32DLL) Then Return BitAND(0x00000008, $aU32DLL[0])
    Return SetError(1, 0, 0)
EndFuncoÝ÷ ØGb´LZ^¡û¬y«­¢+Ù1½°ÀÌØí]0ô]¥¹1¥ÍÐ ¤°ÀÌØíÍ]¥¹Ì)½ÈÀÌØí¥
ôÄQ¼U    ½Õ¹ ÀÌØí]0¤´Ä(%%ÀÌØí]1lÀÌØí¥

ulÁt±ÐìÐìÌäìÌäì¹}]¥¹%Í=¹Q½À ÀÌØí]1lÀÌØí¥

ulÅt¤Q¡¸($$ÀÌØíÍ]¥¹ÌµÀìôÌäí9µèÌäìµÀìÀÌØí]1lÀÌØí¥

ulÁtµÀì
I1µÀìÌäí!¹±èÌäìµÀìÀÌØí]1lÀÌØí¥

ulÅtµÀì
I1(%¹%)9áÐ)5Í   ½à À°ÌäìÌäì°ÀÌØíÍ]¥¹Ì¤()Õ¹}]¥¹%Í=¹Q½À ÀÌØí¡]¹¤(%%%Í!]¹ ÀÌØí¡]¹¤ôÀ¹]¥¹á¥ÍÑÌ ÀÌØí¡]¹¤Q¡¸ÀÌØí¡]¹ô]¥¹Ñ!¹± ÀÌØí¡]¹¤(%1½°ÀÌØíTÌÉ10ô±±
±° ÌäíUÍÈÌȹ±°Ìäì°Ìäí±½¹Ìäì°ÌäíÑ]¥¹½Ý1½¹Ìäì°Ìäí¡Ý¹Ìäì°ÀÌØí¡]¹°Ìäí¥¹ÐÌäì°´ÈÀ¤(%%%ÍÉÉä ÀÌØíTÌÉ10¤Q¡¸IÑÕɸ ¥Ñ9 ÁàÀÀÀÀÀÀÀà°ÀÌØíTÌÉ11lÁt¤(%IÑÕɸMÑÉÉ½È Ä°À°À¤)¹Õ¹
Thanks, I tried it and it looks great. Also it gives me a chance to learn how to use DLLs like "GetWindowLong" .

Have a great day.

Steven

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

  • Recently Browsing   0 members

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