Solved

How to determine if another application is running

Posted on 1998-07-09
5
137 Views
Last Modified: 2010-05-03
We need to launch Crystal Reports from the VB application we are creating.  We are launching it using the Shell command and it works fine.  However, we would like to restrict the user to only open one instance of Crystal Reports (at least from opening one instance from within our app).  How do I check to see if a copy of Crystal Reports is already open so I can decide if I have to use AppActivate or Shell?
0
Comment
Question by:csmyser
[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
  • 2
  • 2
5 Comments
 

Author Comment

by:csmyser
ID: 1465354
Adjusted points to 100
0
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
ID: 1465355
Use FindWindow API
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1465356
csmyser:

This is how to use the API. You need to know the caption of CReport.

Regards
Dalin

Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long            


Dim winHwnd As Long

winHwnd = FindWindow(vbNullString, "Crystal Report") ' what ever the title is

If winHwnd <> 0 Then
    ' Another one is running  
Else
    ' Not runing
End If
           

0
 

Author Comment

by:csmyser
ID: 1465357
Thanks very much!
0
 
LVL 3

Expert Comment

by:leeskelton83
ID: 10508639
What if I want to see if any Excel app is open?
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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

756 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