Solved

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

Posted on 2004-04-01
3
435 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 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

Industry Leaders: 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…

718 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