Sign in to follow this  
Followers 0
Tenaya

WinList not only with topmost windows

9 posts in this topic

Hi

I want to determine the title of all open windows. I've tried WinList but it only delivers windows with the top most flag set. Is there a general function to get a list of all existing windows?

Any ideas?

Share this post


Link to post
Share on other sites



Hmm... this works fine for me

$list = WinList()
For $i = 0 to $list[0][0]
if $list[$i][0] <> "" then
msgbox(0,'',$list[$i][0]
endif
Next

makes a msgbox of every window hidden or whatever. I hope i understood what you meant

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

Thank's for the snippet. Now I get all the window titles. I didn't expect empty entries in the WinList - so checking for empty entries solved my previous problem. But I want to know the order of the windows on the screen. How can I determine the title of the top most open window visible on the screen?

Share this post


Link to post
Share on other sites

Thank's for the snippet. Now I get all the window titles. I didn't expect empty entries in the WinList - so checking for empty entries solved my previous problem. But I want to know the order of the windows on the screen. How can I determine the title of the top most open window visible on the screen?

i think i remember valik posting a dll call a while back to check the z-order of windows, i could be mistaken, but i am pretty certain.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

maybe

; get Active Window  (Title)(Text)
; Author - SmOke_N & Valuater

$MyText = WinGetText(FindActiveWindow())
$MyTitle = WinGetTitle(FindActiveWindow())
MsgBox(0, $MyTitle, $MyText)
Func FindActiveWindow()
    Local $HidOpt = Opt("WinDetectHiddenText", 1);0=don't detect, 1=do detect
    Local $w_WinList = WinList()
    For $i = 1 to $w_WinList[0][0]
      If $w_WinList[$i][0] <> "" AND BitAnd(WinGetState($w_WinList[$i][1]), 2) _
          And BitAnd(WinGetState($w_WinList[$i][1]), 8) Then Return $w_WinList[$i][0]
      Next
    Opt("WinDetectHiddenText", $HidOpt);0=don't detect, 1=do detect
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

How can I determine the title of the top most open window visible on the screen?

you can use

Opt("WinTitleMatchMode",4)
WinGetTitle("active")

that will give the title of the active window... not necessarily topmost though


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

you can use

Opt("WinTitleMatchMode",4)
WinGetTitle("active")

that will give the title of the active window... not necessarily topmost though

Ok, your advise helped me a lot and I have nearly the job done. But now, I think I have to tell you the whole story:

We are using PCs with touch panels and there is no keyboard attached. There is allways one application running in kiosk or full screen mode. There are always some entry fields and I have to create an on screen keyboard or SIP. Due to the fullscreen mode it's not easy to have access to the Windows built-in SIP - and the Windows SIP is too bulky and doesn't fit well to the overall application. So what I made is a window with buttons like a SIP and in addition with an edit field. Due to the applications kiosk mode, I have to set my own created SIP allways on top. My first problem was to get the entry field data to the underlaying application window. Thanks to you, this I have solved now with WinGetTitle. But in order to get the title of the applications window I have to disable my SIP window in a certain way. I've solved it now with minimizing the SIP windows, checking the active window with WinGetTitle("active") and restoring the SIP. But of course, there is now always a nervous flickering of the SIP window during this operation. Is there another method to deactivate the SIP window? I've tried @SW_DISABLE but then I get the title of my SIP window.

Share this post


Link to post
Share on other sites

I spose you could do

WinSetOnTop("mySIpTitle", 1)
Winactivate("kiosk title")
;do w/e
winactivate("mysiptitle")

it shouldn't flicker if you do that... i think

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

I've sold it now by launching the underlaying application form within my AutoIt script. Now it works fine.

Great support here in the forum! Thank's.

Share this post


Link to post
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
Sign in to follow this  
Followers 0