Jump to content

Window titles


Danyg
 Share

Recommended Posts

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

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.
Link to comment
Share on other sites

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.
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...