|
-
Dec 4th, 2001, 02:25 PM
#1
Thread Starter
New Member
how to check an application is running?
Hi, Gurus, I need to find a way to check whether a specific application is running on a specific computer. Actually I'm working on a client/server project's client side. Before loading its first form, the client application needs to make sure the sever application is running.
Gurus, please help me out. Thanks in advance.
Wei
-
Dec 4th, 2001, 03:02 PM
#2
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim WinWnd As Long
'change Calculator with the caption of the window you are looking for
WinWnd = FindWindow(vbNullString, "Calculator")
If WinWnd = 0 Then
'code if application is not running
Else
'code if application is running
End If
End Sub
-
Dec 4th, 2001, 03:10 PM
#3
Hack - I think he wants to check a remote computer for the server process. If so,
Goto www.sysinternals.com Download their free PsTools suite.
Or part of it if you want. You can automate the PsTools window to check and see if the server has the process up & running.
If you're on NT, I think Terminal Server Manager can also do that.
-
Dec 4th, 2001, 03:13 PM
#4
Oh. Ok. I guess sometimes I get too narrow focused.
BTW: Jim...I checked out that web site that you listed both in this thread and in the logoff thread. Its pretty cool!
-
Dec 4th, 2001, 04:16 PM
#5
Thread Starter
New Member
Oh, I'm working on windows 98
Thanks, Hack and Jim, for your quick response. I really appreciate it. The question is the ps tools suite is for windows NT/2000. But I'm working on windows 98. Sorry, it's my fault, I should have mentioned it clearly at the beginning.
Is there any Net API in SDK I can use to talk to the remote computer?
Thanks,
Wei
-
Dec 4th, 2001, 07:49 PM
#6
If you are using winsock, maybe you could send a special message, and if you get a response, then the server side application is running, otherwise it isn't. e.g:
In client:
Winsock1.SendData ("Are you open?")
In Server:
Winsock1.GetData datarecieved
If datarecieved "Are you open?" Then Winsock1.senddata "Yes I am"
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
|