rowaasr13 Posted August 19, 2006 Posted August 19, 2006 (edited) Greetings. I'm trying to use AutoItX from Perl, but I've run in some problems. First, for some reason I can't figure how to use handles. I think I'm doing everything according to manual, but yet this piece of code doesn't work:use Win32::OLE; unless($autoit=Win32::OLE->new("AutoItX3.Control")){ die "Could not start AutoItX3 Control through OLE.\n"; } unless($whandle=$autoit->WinGetHandle('something')) { die "Couldn't find window"; } print "WHANDLE: $whandle\n"; $autoit->WinTitleMatchMode(4); print "EXISTS: ", $autoit->WinExists("handle=$whandle"), "\n"; Line with print WHANDLE correctly prints found handle for window, but line with print EXISTS prints 0 as result of WinExists, for same handle. Do I miss something there? Actually OLE returns me error 0x80020003: "Member not found" every time I try to use WinTitleMatchMode, so I understand I simply can't get into mode 4 and that why handle= construction doesn't work, but I don't understand why I get this error. Also is there a way to limit window search routines to childs of some previously found window? I couldn't find anything like this in documentation. Edited August 19, 2006 by rowaasr13
airzimzerker Posted October 27, 2006 Posted October 27, 2006 There does not seem to be much help on this topic. I have the same topic and definitely need to use window handles. I believe the help file tells the proble. It says the windos handle is its' own datatype that is not a string. The problem I see is that the activex interface inputs and outputs a string. I think we need to know how to type cast the string to a hwnd type. I am not sure if the interface is also polymorphic. If not I do not see how it can be done.
airzimzerker Posted November 8, 2006 Posted November 8, 2006 Seams like I was wrong. You can use the window handle if you usehandle=XXXXXX.
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