Solved

VB sendkey is not working if focus is lost

Posted on 2003-11-04
7
976 Views
Last Modified: 2008-01-09
hi,

                    My question is about VB "sendkeys". Its working properly if focus remains in the application. But if focus is lost (say a dialog box has been appeared on the screen ". how can I handle the problem.

thanks.
dotcdotc
0
Comment
Question by:dotcdotc
  • 3
  • 2
7 Comments
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
Use the Function AppActivate which you just pass the name of the app.
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
AppActivate works if there is no dialog box that belongs to target appliaction in screen cause when you use AppActivate, VB activates the foremost window.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 250 total points
Comment Utility
If you really needs to send key to a non-focus app, use SendMessage  or Keyboard_event APIs.
Cheers
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Ups!, where is the split thing?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now