TheMinister Posted October 17, 2011 Share Posted October 17, 2011 Hey, I'm attempting to automatically 'Register' a program called Yenka(http://www.yenka.com/), version 3.4.0. Script:- Run("C:\Program Files (x86)\Yenka\Software\Yenka.exe") WinWait("Subjects","choose",10) ControlSend("Subjects", "", "", "{TAB 8}") ControlSend("Subjects", "", "", "{SPACE}") WinWait("Licences","Licences",10) ;<- Script Fails Here ControlClick("Licences","Licences","[CLASS:QWidget; INSTANCE:13]") WinWait("Online Activation","",10) I have found that this program uses Qt, and QWidgets and at the 'Licences' window there isn't a 'usable' title or handle. Can anyone shed some light on this? Thanks. Link to comment Share on other sites More sharing options...
Ramzes Posted October 17, 2011 Share Posted October 17, 2011 Search before posting. I've found Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font] Link to comment Share on other sites More sharing options...
TheMinister Posted October 17, 2011 Author Share Posted October 17, 2011 I have searched the forum, tried Ranorex and still can't get it to work. The window which is giving the grief does not appear to have a handle and can't be referenced via title or text. Hence the post for help. Link to comment Share on other sites More sharing options...
JohnOne Posted October 17, 2011 Share Posted October 17, 2011 I advise you to show your efforts with the linked UDF. If its not a standard windows gui then your code above wont work. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheMinister Posted October 17, 2011 Author Share Posted October 17, 2011 I'm not using any UDFs, it's plain and simple autoit code. Link to comment Share on other sites More sharing options...
shornw Posted October 17, 2011 Share Posted October 17, 2011 (edited) First off I'd try: Run("C:\Program Files (x86)\Yenka\Software\Yenka.exe") WinWait("Subjects","choose",10) ControlSend("Subjects", "", "", "{TAB 8}") ControlSend("Subjects", "", "", "{SPACE}") WinWait("Licences","Licences",10) ;<- Script Fails Here WinActivate("Licences","Licences") ControlClick("Licences","Licences","[CLASS:QWidget; INSTANCE:13]") WinWait("Online Activation","",10) Just because the window exists doesn't mean it has focus - WinActivate() will sort this. Sometimes tho, I have seen a few odd things with WinWait() in the past whereby it just seems to fail. I have had some success with Do/Until, so if the above doesn't work, maybe try this. Run("C:\Program Files (x86)\Yenka\Software\Yenka.exe") WinWait("Subjects","choose",10) ControlSend("Subjects", "", "", "{TAB 8}") ControlSend("Subjects", "", "", "{SPACE}") Do WinWait("Licences","Licences",10) ;<- Script Fails Here WinActivate("Licences","Licences") Until WinExists("Licences","Licences") ControlClick("Licences","Licences","[CLASS:QWidget; INSTANCE:13]") WinWait("Online Activation","",10) Also, try removing the 10sec timeout from the offending line Edited October 17, 2011 by shornw [font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font] Link to comment Share on other sites More sharing options...
TheMinister Posted October 17, 2011 Author Share Posted October 17, 2011 Hey thanks. The window in question has focus already, the problem is there are no controls to interface with. I need to click the 'Activate' button/link, but I can't find the ID. It's one of those things you'd need to see. Link to comment Share on other sites More sharing options...
Command3r Posted October 17, 2011 Share Posted October 17, 2011 Try MouseClick ( "button" [, x, y [, clicks [, speed ]]] ) copied from help file [font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting. [font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color] [font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font] Link to comment Share on other sites More sharing options...
987learner Posted October 17, 2011 Share Posted October 17, 2011 Try activating it manually and monitor where it stores the lic file or search around the harddisk. Could be in registry, userprofile folder and maybe in .ini format or other file type. Link to comment Share on other sites More sharing options...
TheMinister Posted October 17, 2011 Author Share Posted October 17, 2011 I've tried mouse click, but unfortunately some computers have different screen resolutions and fail. Ive tried to manually activate the software by importing their registry key, but it fails. There must be a check in the software. Link to comment Share on other sites More sharing options...
chachew Posted October 18, 2011 Share Posted October 18, 2011 I've tried mouse click, but unfortunately some computers have different screen resolutions and fail. You can get the position of any window and then use mouseclick to adjust for any difference in screen resolutions. Look at WinGetPos in help file Link to comment Share on other sites More sharing options...
TheMinister Posted October 19, 2011 Author Share Posted October 19, 2011 Thanks. I've tried running it with the MouseClick function. Unfortunately, this doens't work when the application is @SW_HIDE Any other ideas? Link to comment Share on other sites More sharing options...
Bert Posted October 19, 2011 Share Posted October 19, 2011 does the application support command line? The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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