Solved

Task Switch to another window that is running in a Seporate process

Posted on 2004-04-01
3
432 Views
Last Modified: 2013-12-25
I am writting a VB Subroutine that will check to see if a specific program is running in the backround and "Task Switch" to that program if it is or Launch said program if it is not.  My problem is I can't get VB to "Task Switch".  I have tried using SetForegroundWindow() but I can't determine the windows Handle, even with the FindWindow().  I have contacted Tech\Development support for the program I'm trying to manipulate but they don't know the answer.  
0
Comment
Question by:Alford-Miller
3 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 10738448
How are you determining if that process is currently running or not?

Idle_Mind
0
 
LVL 6

Accepted Solution

by:
Neeraj Soni earned 500 total points
ID: 10739860
Create a function

Private Sub ActivateMyApp(AppName As String)
On Error Resume Next
    AppActivate "Title of the application"
End Sub


This function activates the application with the title that is given as parameter.
The applications title bar displays the title.
The parameter should exactly match the title.

e.g. AppActivate "Untitled - Notepad"

0
 

Expert Comment

by:duanemoore
ID: 11093377
Private Sub ActivateMyApp(AppName As String)
On Error Resume Next
    AppActivate AppName
End Sub

... will work a lot better.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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 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…

773 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