Solved

How do I control other apps with my app?

Posted on 1998-09-16
1
158 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month4 days, 4 hours left to enroll

630 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