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
Solved

VB sendkey is not working if focus is lost

Posted on 2003-11-04
7
980 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

808 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