Jump to content

Can I activate the last unfocused window?


Recommended Posts

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 by electronixtar
Link to comment
Share on other sites

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 text

2.Find the last focused textbox <----I failed at this step!

3.Use oAutoIt.Send method to paste the text to the textbox

4.wscript.quit

It's just like in VB to

Shell "PasteSerailNumber", vbMinimizedNoFocus

But how can I run the script MinimizedNoFocus itself?

Edited by electronixtar
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...