Seminko Posted June 16, 2017 Share Posted June 16, 2017 Hey fellas, is there a was to check if window exists by only a partial Class? The Class is apparently dynamic for my window and looks something like: HwndWrapper[app.exe;;255bd6d6-etc-etc-etc] I would like to search only for app.exe in the class. Is that doable? Thanks Seminko Link to comment Share on other sites More sharing options...
willichan Posted June 16, 2017 Share Posted June 16, 2017 (edited) Have you tried doing something like this? WinExists("HwndWrapper[app.exe","") -- edit -- You might also want to set the Window Title Match option somewhere before calling WinExists() AutoItSetOption("WinTitleMatchMode", 2) ;Match any substring in the title Edited June 16, 2017 by willichan additional information My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
Seminko Posted June 16, 2017 Author Share Posted June 16, 2017 23 minutes ago, willichan said: Have you tried doing something like this? WinExists("HwndWrapper[app.exe","") -- edit -- You might also want to set the Window Title Match option somewhere before calling WinExists() AutoItSetOption("WinTitleMatchMode", 2) ;Match any substring in the title Does not work. I suspect AutoItSetOption only works on Titles not Classes. Link to comment Share on other sites More sharing options...
willichan Posted June 16, 2017 Share Posted June 16, 2017 Interesting. I am able to do partial class name matching on my PC using this method. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
Seminko Posted June 16, 2017 Author Share Posted June 16, 2017 2 minutes ago, willichan said: Interesting. I am able to do partial class name matching on my PC using this method. Shouldn't Class be specified like this? WinExists("[Class:ClassName]") Link to comment Share on other sites More sharing options...
willichan Posted June 16, 2017 Share Posted June 16, 2017 I used your own example to format the search example I gave you. You should substitute in the part of the class name you are looking for. In my test, I looked for my IBM Notes window. The AutoIt v3 Window Info utility gives me the following info. >>>> Window <<<< Title: Mail - Inbox - IBM Notes Class: SWT_Window0 I used the following line to test for it If WinExists("SWT_Win","") Then MsgBox(0,"test","yes") For me, I get a "yes" pop-up whenever I have Notes open, and nothing when it is closed. I can't guarantee that it will work for all apps. You will need to test it for your situation. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
jdelaney Posted June 16, 2017 Share Posted June 16, 2017 https://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2) Seminko 1 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...
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