Is it possible to see if a program is already loaded

binarydream
10-01-2003, 08:49 PM
Hi all

Got this problem with people that want's to open Excel twice or more

Is there a way to see if Excel is already loaded, if so force the user to save and shut down that instance.

VB6 sp5
Office 2000
Windows 2000

Have a nice one

Jon
jonny.hakansson@comhem.se

dragon4spy
10-01-2003, 08:55 PM
I suggest that you should use Api to get the processes list, and then you can check whether the Excel process is running or not.

Website: www.allapi.net

binarydream
10-02-2003, 08:13 AM
Thanks I'll check it out

Jon

Mathimagics
10-02-2003, 08:55 AM
Here's a simple way:


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


If FindWindow("XLMAIN", 0&) <> 0 Then
' ExCel is running
End If

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum