electronixtar Posted June 5, 2006 Share Posted June 5, 2006 (edited) oAutoIt.WinActivate is greate method but I came across a problem when I am programming a PasteSerrialNumber.vbs. Entering Serial Numbers is pain, but sncopy.exe or sninput.exe costs memory. I tried to write a snpaste.vbs and created a snpaste.lnk in my StartMenu with the ShortcutKey Ctrl+Alt+V, so when I am reinstalling MS Office and entering the ProductKey, or while changing the IP address, I can simply copy a string and paste it into the row of textboxes with one press: Ctrl+Alt+V. The problem came when I started the program, It unfocused the last window and activated wscript.exe! Then when I use oAutoIt.send it send the key to nowhere. I tended to find out a solution with AutoIt, but faild. Can anybody give me an solution? Edited June 5, 2006 by electronixtar Link to comment Share on other sites More sharing options...
MHz Posted June 5, 2006 Share Posted June 5, 2006 (edited) Are you using the AutoIt3X.dll with VBScript? Edit: Might be a good idea to expose your script or the problem part atleast. Edited June 5, 2006 by MHz Link to comment Share on other sites More sharing options...
electronixtar Posted June 5, 2006 Author Share Posted June 5, 2006 (edited) Are you using the AutoIt3X.dll with VBScript?Yes! and thanks for the quick reply. So what's your solution?I am trying my best to explain:PasteSerialNumber.vbs process:1.Get the clipboard text2.Find the last focused textbox <----I failed at this step!3.Use oAutoIt.Send method to paste the text to the textbox4.wscript.quitIt's just like in VB to Shell "PasteSerailNumber", vbMinimizedNoFocusBut how can I run the script MinimizedNoFocus itself? Edited June 5, 2006 by electronixtar Link to comment Share on other sites More sharing options...
MHz Posted June 5, 2006 Share Posted June 5, 2006 AutoItX does have Control* functions which do not require an active window. Have a look at methods ControlSend or ControlSetText. 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