?
Solved

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

Posted on 2004-04-01
3
Medium Priority
?
438 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
[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
3 Comments
 
LVL 86

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 1500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 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