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

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.  
Alford-MillerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Neeraj SoniConnect With a Mentor Sr. ArchitectCommented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
How are you determining if that process is currently running or not?

Idle_Mind
0
 
duanemooreCommented:
Private Sub ActivateMyApp(AppName As String)
On Error Resume Next
    AppActivate AppName
End Sub

... will work a lot better.
0
All Courses

From novice to tech pro — start learning today.