Solved

How do I control other apps with my app?

Posted on 1998-09-16
1
152 Views
Last Modified: 2010-04-30
I am writing an app for a disabled friend. The app displays a form with four buttons. These buttons are meant to act like pressing the arrow keys on the keyboard. The idea being that my friend can use the mouse to click the buttons instead of having to press the arrows on the keybaord.

The problem I have is how do I allow my app to control another app. My app would have to stay active while other apps are running.

I'm using VB5 and I do not know if this is even possible.

Any help would be great. thanks.

 
0
Comment
Question by:coles01
1 Comment
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
ID: 1435195
coles01,
This will keep your app stay active:
1. In the general declaration area of your form (form1), add:
              Private Declare Function GetForegroundWindow Lib "user32" () As Long

2. drop a timer to your form, set the interval to 50 (you can adjust this).

3. in the timer1_timer event, add:

     If GetForegroundWindow()<>me.hwnd then  me.show

 This will grap the focus back every 50 milliseconds

Let me know if you have questions
Regards
Dalin
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now