Sign in to follow this  
Followers 0
Danyg

Window titles

11 posts in this topic

#1 ·  Posted (edited)

I've been working with a window with a title that contains Danish letters (Patientsøgning...). The only thing that works 100% is the AutoIt Window Info tool.

------------ EDIT --------------------

Okay. I've attached 6 screenshots to show you whats going on:
 

This picture shows the window I'm looking for. As you can see the title is "Patientsøgning".

1.png

 

 

Here I get the info from AutoIt v3 Window Info - notice that it has the correct Title.

2.png

 

Not having closed the window I use the handle manually provided by the AutoIt Window Info Tool (0x0009027C). It merely returns a "P"

3.png

 

Here I attempt to get the handle of the window by using it's exact title "Patientsøgning..." However the handle returned is 0x00000000 (failed)

4.png

 

Then I try getting all handles and titles of all windows using WinList. The one with the title “?” and handle 0x00120262 is the correct one according to AutoIt v3 Window Info (I checked manually)

5.png

 

Last one I'm manually activating the window and the CaptureHandle function that get the active windows title and process ID. Returns "P" as title

6.png

Edited by Danyg

Share this post


Link to post
Share on other sites



You can use the class of the window too. This can get the handle for Notepad

WinGetHandle("[Class:Edit;Instance:1]")

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Can't reproduce:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Local $hGUI = GUICreate("søg", 400, 100)
GUISetState(@SW_SHOW, $hGUI)

ConsoleWrite("GuiCreate=" & $hGui & @CRLF)
ConsoleWrite("WinGetTitle=" & WinGetTitle($hGui) & @CRLF)
ConsoleWrite("WinGetHandle=" & WinGetHandle("søg") & @CRLF)
Sleep(5000)
Exit

output:

GuiCreate=0x0004030E
WinGetTitle=søg
WinGetHandle=0x0004030E

Maybe upgrade your autoit?  You can also use a regexp to get the window by title, or use the class, or use a regexp on the class.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Thanks for the replies. I updated my original post with screendumps and extra info. Does it help?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Interesting, post the full info from the autoit tool for the application.

Edited by InunoTaishou

Share this post


Link to post
Share on other sites
15 hours ago, InunoTaishou said:

Interesting, post the full info from the autoit tool for the application.

Thanks a lot for taking your time. See attached image

8.png

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Run the application with Run, get the pid, loop for the window with WinList, and verify it's the same PID with wingetprocess...no title required:

Run
WinList("[CLASS:32770]")
WinGetProcess()

 

Edit: screenshots like that are not helpful for lazy people like me that just want to copy an paste...it's damn difficult to get text out of an image, reliably.  I'd suggest you copy the content into your buffer, and paste it as text.  Generally, if it would take an ounce more effort, I won't help at all, or will just post function names like above.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

I'm not sure, you could try using the visible text in the $sText field of the WinGetHandle and see if that works. But my suspicion is it won't because it's also using special characters.

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