Solved

How do I control other apps with my app?

Posted on 1998-09-16
1
154 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

776 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