Solved

VB sendkey is not working if focus is lost

Posted on 2003-11-04
7
982 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
ID: 9678728
Use the Function AppActivate which you just pass the name of the app.
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 9678744
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9679013
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
ID: 9679023
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
ID: 10471561
Ups!, where is the split thing?
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

726 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