Solved

How do I control other apps with my app?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

728 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