Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I check if another app is running in VB5

Posted on 1998-06-03
5
Medium Priority
?
147 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 140 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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

783 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