Solved

How do I check if another app is running in VB5

Posted on 1998-06-03
5
143 Views
Last Modified: 2010-05-03
I need to find out if and how VB5 can check to see if another application is running.  For example, I want to fire off a Powerpoint Slide in the Powerpoint Viewer (PPVIEW32.EXE) and I need VB5 to check and see if it is still running.  How do I do this?
0
Comment
Question by:DamienLWW
  • 3
5 Comments
 
LVL 1

Expert Comment

by:sirigere
ID: 1462393
I think windows API function Enuwindows can be used to check out wheathet that particular application is runing or not.
0
 
LVL 9

Accepted Solution

by:
Dalin earned 70 total points
ID: 1462394
DamienLWW,
Using the FindWindow API function.
I will post the code if you need it
Regards
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462395
DamienLWW
If you have any questions, let me know
Regards

Add this to the General Declaration area:

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


Add this to where you want to check your power points app.

Dim myHandle as Long
myHandle = FindWindow(0&, "Microsoft PowerPoint")
If gTCWHandle = 0 Then
     
 ' App not Running

Else
' App is running

End If
0
 
LVL 1

Expert Comment

by:Sekans
ID: 1462396
Dalin, might I suggest using vbNullString to pass the null terminated string.  Also, I believe your code should be:
if myHandle = ...

not if gTCWHandle = ...

Respectfully,
Sekans
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1462397
Sekans,
Thank you for the comments.
I just copied the code from my project which look for a window called TCW.
Sorry for any confusion it may have caused.
Regards
Dalin
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

830 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