Results 1 to 6 of 6

Thread: how to check an application is running?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Posts
    2

    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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    2.  
    3. Private Sub Command1_Click()
    4.     Dim WinWnd As Long
    5.     'change Calculator with the caption of the window you are looking for
    6.     WinWnd = FindWindow(vbNullString, "Calculator")
    7.     If WinWnd = 0 Then
    8.        'code if application is not running
    9.     Else
    10.        'code if application is running
    11.     End If
    12. End Sub

  3. #3
    jim mcnamara
    Guest
    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.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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!

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Posts
    2

    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

  6. #6
    Megatron
    Guest
    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
  •  



Click Here to Expand Forum to Full Width