|
-
Sep 21st, 2000, 02:49 PM
#1
Thread Starter
Junior Member
Can anybody please give me the code for the following;
I want to know if MS Word is running.
I want to know if MS Excel is running.
Thanks,
Graham.
-
Sep 21st, 2000, 04:07 PM
#2
Frenzied Member
Dim nHandle As Long
' If Excel is running this API call returns its handle.
nHandle = FindWindow("XLMAIN", 0) 'use "WINWORD" for Word
If nHandle = 0 Then ' 0 means Excel not running.
'do something here
End If
-
Sep 21st, 2000, 05:35 PM
#3
Thread Starter
Junior Member
Thanks for the code but can I confirm..
Is 'FindWindow' a VB command or is it a C+ command as I am getting a Sub or Function not defined.
Thanks
Graham.
-
Sep 21st, 2000, 05:40 PM
#4
Frenzied Member
FindWindow is part of the Windows API:
Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As Long) As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|