topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 3:17 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Determine if a window on top is active or not  (Read 8906 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Determine if a window on top is active or not
« on: January 12, 2014, 02:59 PM »
I would like to know what is written in the windows registry or any other place to determine when and what window is on top of all the other ones.


Best Regards
 :-*

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #1 on: January 12, 2014, 03:57 PM »
Nothing is written to the registry to indicate if a window is on top or not.  It's what is called a window "style" or "property" and, again, it has nothing to do with the registry.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #2 on: January 12, 2014, 04:10 PM »
Here's a short script that demonstrates how to find out if the active window is set for Always on Top.

Code: Autohotkey [Select]
  1. #1:: ; Win+1, change as necessary.
  2. {
  3.     WinGet, myStyle, ExStyle, A
  4.     If ( myStyle & 0x8 ) ; 0x8 is WS_EX_TOPMOST.
  5.     {
  6.         MsgBox, This window is set for Always on Top
  7.     }
  8. }
  9. Return

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #3 on: January 12, 2014, 04:48 PM »
Nothing is written to the registry to indicate if a window is on top or not.  It's what is called a window "style" or "property" and, again, it has nothing to do with the registry.
Understood

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #4 on: January 12, 2014, 04:52 PM »
I am using this code , but don't give me results.
What am i doing bad ?
Must have I the top windows maximized ?
Best Regards

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Recommended for catching common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
^#1:: ; Control+Win+1, change as necessary.
{
   WinGet, myStyle, ExStyle, A
   If ( myStyle & 0x8 ) ; 0x8 is WS_EX_TOPMOST.
   {
       MsgBox, This window is set for Always on Top
   }
}
Return

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #5 on: January 12, 2014, 04:58 PM »
Sorry. The little windows appear at the center of the screen and i can't see.
I usually use this max-max size as appear in the screenshot....
and the little window don't indicate the window on top.
Specially if is minimized.
 :-[

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #6 on: January 12, 2014, 05:01 PM »
How can i indicate that control+win+1 is with the 1 in the numerical keypad ?


IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #7 on: January 12, 2014, 07:13 PM »
Just looking in the AHK Help manual, if you wanted to know which window was "active" (on top) at any given point, I think (but I have not tried this) that the AHK command WinGet with the cmd parameter should be able to do it:
ID: Retrieves the unique ID number (HWND/handle) of a window. If there is no matching window, OutputVar is made blank. The functions WinExist() and WinActive() can also be used to retrieve the ID of a window; for example, WinExist("A") is a fast way to get the ID of the active window. To discover the HWND of a control (for use with Post/SendMessage or DllCall), use ControlGet Hwnd or MouseGetPos.
_____________________

Not sure if that is what you want though.

Otherwise, using AHK, you can get a specified window and make it active - bring it to the top - or make it always topmost with a toggle switch.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #8 on: January 12, 2014, 07:22 PM »
I also recall reading about a free download from somewhere, for a proggy that enabled you to make little screens from different concurrently running programs/videos - and you could resize and drag each little screen to somewhere you wanted and they could all stay on top. Each little screen could display either a minimized full window or a section of a window. Could be useful where you wanted to monitor several things at once.

I'm sorry I didn't make a note of it and can't recall the name of the thing at the moment, but will search it up and see if I can find it.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #9 on: January 12, 2014, 11:32 PM »
How can i indicate that control+win+1 is with the 1 in the numerical keypad ?

C'mon...open up the AHK help file and search for "keylist."

http://www.autohotke...com/docs/KeyList.htm

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #10 on: January 13, 2014, 04:13 PM »
a proggy that enabled you to make little screens from different concurrently running programs/videos - and you could resize and drag each little screen to somewhere you wanted and they could all stay on top.

I'm sorry I didn't make a note of it [...]
Maybe Contro found it - see his thread - OntopReplica?

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #11 on: January 13, 2014, 05:05 PM »
No rjbull. But is a help indeed.
What i am looking for is a text in the right zone of my screen that express what window is on top.
Here we have additional problems because a window can have the same final folder.
But even express if any window is commanded to be on top may be useful for me. Because usually we are the single users of our pc's during a lapse of time. If I obtain the indication a window is on top then I know what hotkey apply for the next launching of a link .
Miles Ahead have a script that may be adapted to put a window on top executing a script directly for that or the reverse action. But the point is to express this in the right portion of my screen, or definable position.

 :-*

Miles Ahead Software

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #12 on: January 13, 2014, 05:07 PM »
How can i indicate that control+win+1 is with the 1 in the numerical keypad ?

C'mon...open up the AHK help file and search for "keylist."

http://www.autohotke...com/docs/KeyList.htm

Oh my God : Beautiful
Numlock ON    Numlock OFF
Numpad0    NumpadIns
Numpad1    NumpadEnd
Numpad2    NumpadDown
Numpad3    NumpadPgDn
Numpad4    NumpadLeft
Numpad5    NumpadClear
Numpad6    NumpadRight
Numpad7    NumpadHome
Numpad8    NumpadUp
Numpad9    NumpadPgUp
NumpadDot (.)    NumpadDel
NumpadDiv (/)    NumpadDiv (/)
NumpadMult (*)    NumpadMult (*)
NumpadAdd (+)    NumpadAdd (+)
NumpadSub (-)    NumpadSub (-)
NumpadEnter    NumpadEnter

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #13 on: January 13, 2014, 10:22 PM »
a proggy that enabled you to make little screens from different concurrently running programs/videos - and you could resize and drag each little screen to somewhere you wanted and they could all stay on top.
I'm sorry I didn't make a note of it [...]
Maybe Contro found it - see his thread - OntopReplica?

 :Thmbsup:  Thankyou, I had completely missed that in the thread. That looks to be exactly the one I was talking about.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #14 on: January 13, 2014, 10:50 PM »
Oops. Posted in wrong place.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #15 on: January 14, 2014, 10:53 AM »
Oops. Posted in wrong place.
What !!!!!!!. Nice indeed. Almost 4.000 posts  :-*

CapicĂșaaaaaaaa !!!!!!!!!!!!!!!