|
-
Apr 11th, 2001, 11:47 PM
#1
Thread Starter
Lively Member
How can I check to see if Outlook is running? If it isn't, can I just call a shell command to open it?
Thx
Doug
-
Apr 11th, 2001, 11:59 PM
#2
Addicted Member
Here ya go:
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim rc As Long, blnRunning As Boolean
rc = FindWindow("rctrl_renwnd32", vbNullString)
blnRunning = IIf(rc, True, False)
If blnRunning Then MsgBox "Running"
End Sub
-
Apr 12th, 2001, 12:04 AM
#3
Thread Starter
Lively Member
Thanks, does the "rctrl_renwnd32" specify Outlook?
Just curious how it will know to look for Outlook.
Thanks,
Doug
-
Apr 12th, 2001, 12:05 AM
#4
PowerPoster
All that does is specify Outlooks class name. If the return value is zero, then the window could not be found, thus not running. Good piece of code he came up with!
-
Apr 12th, 2001, 12:08 AM
#5
Thread Starter
Lively Member
How do you know what value to look for? Is it a key in the registry?
Thanks
-
Apr 12th, 2001, 12:13 AM
#6
PowerPoster
Spy++ utility. I know it comes with the Enterprise Edition, not positive about Professional, but I would guess so..
-
Apr 12th, 2001, 12:20 AM
#7
Thread Starter
Lively Member
Awesome. Yes it does come with Pro and there are at least some entries in the VS 6.0 help file on it as well.
Thanks!!!
-
Apr 12th, 2001, 12:21 AM
#8
PowerPoster
No problem...
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
|