Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • September 30, 2016, 10:12:40 AM
  • Proudly celebrating 10 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 2944 times)

Contro

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,570
    • View Profile
    • Donate to Member
Determine if a window on top is active or not
« on: January 12, 2014, 02:59:43 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: 4,634
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #1 on: January 12, 2014, 03:57:21 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: 4,634
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #2 on: January 12, 2014, 04:10:25 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

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,570
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #3 on: January 12, 2014, 04:48:00 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

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,570
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #4 on: January 12, 2014, 04:52:57 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

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,570
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #5 on: January 12, 2014, 04:58:23 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

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


IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 6,053
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #7 on: January 12, 2014, 07:13:25 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:
Quote
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: 6,053
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #8 on: January 12, 2014, 07:22:07 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: 4,634
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #9 on: January 12, 2014, 11:32:53 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: 2,922
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #10 on: January 13, 2014, 04:13:48 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

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,570
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #11 on: January 13, 2014, 05:05:40 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

  • Participant
  • Joined in 2007
  • *
  • Posts: 2,570
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #12 on: January 13, 2014, 05:07:27 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: 6,053
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #13 on: January 13, 2014, 10:22:37 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: 6,053
  • Slartibartfarst
    • View Profile
    • Donate to Member
Re: Determine if a window on top is active or not
« Reply #14 on: January 13, 2014, 10:50:12 PM »
Oops. Posted in wrong place.

Contro

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

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