Solved

Does a VB script effect focus if it does not have SendKey commands

Posted on 2011-02-17
3
523 Views
Last Modified: 2012-05-11
I am running an AutoIT script that sometimes sends simulated keyboard strokes to a running WIN7 program.  It does just fine until I also run some VB scripts in the background, then some of the keystrokes seem to be ignored.  The VB scripts do not have any keystroke commands (doing FTP, moving files from folder to folder,  ZIPing).  Do VB scripts with no key commands intefere with or take control of focus while running?
0
Comment
Question by:Mike Caldwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 34921089
No, they shouldn't, if it's running via wscript.exe, whereas cscript.exe will show a DOS prompt, and will take the focus.  It's not so much SendKeys that changes any focus, it's more things like
objShell.AppActivate "windowtitle"

that would change the focus.

However, if your AutoIT isn't trying to change the focus to whatever it's sending keystrokes to, then performing any other task while that is running will change the focus and the AutoIT keystrokes will go to that object.

Therefore, double-clicking the VBS might change the focus onto the VBS file itself, but not the script during execution.

Regards,

Rob.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 34921736
Thanks Rob.  The VB stuff is not CS, and they run continuously.  So with that I am puzzled why the WIN7 application being controlled by AutoIT seems to run fine while soso, but when the VB scripts are run at the same time some keystrokes to the app seem to get lost.  I start the VB stuff first, then AutoIT.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34921960
Is your AutoIT script activating the windows it is supposed to send keystrokes to?  It should be, just to safeguard.

Is your VBScript doing anything file system wise, or system setting wise, that might cause a refresh in Windows 7?  Since Windows 7 automatically continuously refreshes folder views, it could be as simple as adding a new file somewhere that might cause it to refresh, but I'm not sure.

Rob.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question