Danyg Posted February 12, 2016 Share Posted February 12, 2016 (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". Here I get the info from AutoIt v3 Window Info - notice that it has the correct Title. Not having closed the window I use the handle manually provided by the AutoIt Window Info Tool (0x0009027C). It merely returns a "P" 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) 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) 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 Edited February 13, 2016 by Danyg Link to comment Share on other sites More sharing options...
InunoTaishou Posted February 12, 2016 Share Posted February 12, 2016 You can use the class of the window too. This can get the handle for Notepad WinGetHandle("[Class:Edit;Instance:1]") Link to comment Share on other sites More sharing options...
jdelaney Posted February 12, 2016 Share Posted February 12, 2016 (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 February 12, 2016 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 More sharing options...
Danyg Posted February 13, 2016 Author Share Posted February 13, 2016 Thanks for the replies. I updated my original post with screendumps and extra info. Does it help? Link to comment Share on other sites More sharing options...
InunoTaishou Posted February 13, 2016 Share Posted February 13, 2016 AutoItSetOption("WinTitleMatchMode", -2) Global $hWnd_window = WinGetHandle("Patient") That should do it. Link to comment Share on other sites More sharing options...
Danyg Posted February 13, 2016 Author Share Posted February 13, 2016 6 hours ago, InunoTaishou said: AutoItSetOption("WinTitleMatchMode", -2) Global $hWnd_window = WinGetHandle("Patient") That should do it. Unfortunately it doesn't work Link to comment Share on other sites More sharing options...
InunoTaishou Posted February 13, 2016 Share Posted February 13, 2016 (edited) Interesting, post the full info from the autoit tool for the application. Edited February 13, 2016 by InunoTaishou Link to comment Share on other sites More sharing options...
Danyg Posted February 14, 2016 Author Share Posted February 14, 2016 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 Link to comment Share on other sites More sharing options...
Danyg Posted February 18, 2016 Author Share Posted February 18, 2016 Bump Link to comment Share on other sites More sharing options...
jdelaney Posted February 19, 2016 Share Posted February 19, 2016 (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 February 19, 2016 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 More sharing options...
InunoTaishou Posted February 19, 2016 Share Posted February 19, 2016 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now