Results 1 to 6 of 6

Thread: [RESOLVED] check if an app is running

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Resolved [RESOLVED] check if an app is running

    is it possible to check if an exe is running. As i would like my program not run with out the other one.

    the code i am thinkin off:
    Code:
    If project1.exe is running then 
    else
    unload me
    End If
    what code replaces 'project1.exe is running'

    thanks in advance chris1990
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Re: check if an app is running

    yes for example project2.exe
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: check if an app is running

    Okay then the easiest thing to do is to put an "I'm running" flag in the registry someplace when the 2nd program starts and turn it off when it ends. One way to update the registry is via GetSetting and SaveSetting. See my signature for an example.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Re: check if an app is running

    thanks this will do i was wodering if there is a code for it as there's a code for terminating them.
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  6. #6
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: [RESOLVED] check if an app is running

    In program two just do something like this.

    vb Code:
    1. Private Sub Form_Load()
    2.  
    3. SaveSetting App.EXEName, "Stuff", "Running", True
    4.  
    5. End Sub
    6.  
    7.  
    8. Private Sub Form_Unload(Cancel As Integer)
    9.  
    10. SaveSetting App.EXEName, "Stuff", "Running", False
    11.  
    12. End Sub

    and in program 1

    vb Code:
    1. Dim bIsExe2Running As Boolean
    2.  
    3. bIsExe2Running = GetSetting("<app 2 exe name>", "Suff", "Running", False)

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