Results 1 to 3 of 3

Thread: Detect running process and terminate

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    12

    Question

    I have a VB application that gets invoked from another
    Java application. I need to check in my VB code to see if
    this VB application is already running. If it is, I need to
    terminate it before continuing...

    Can someone give any tips to continue ?
    I know I can detect the previous instance using the
    App.previnstance method, but how do I kill the previous
    instance ?

    Thanks

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    ' See if there is already and instance.
    If App.PrevInstance Then
    ' Activate the previous instance
    AppActivate App.Title

    ' Send a key (here SHIFT-key) to set the
    ' form from the previous instance to the
    ' top of the screen.
    SendKeys "+", True

    ' Terminate the new instance
    Unload Me
    End If
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    12

    Question detect running process and terminate

    Hello HeSaidJoe,

    I tried your code, but it didn't help.

    In my VB application, I get some arguments passed from
    the Java application. Based on these arguments, I do
    some data retrieval and post the results in a MDI window.

    When the java program re-invokes the VB program, I want
    to terminate the previous instance and continue processing
    with the new set of arguments. This way, the MDI window
    now shows data for the latest arguments.

    If I use the code to terminate the current application,
    the MDI window still shows the old data...

    Thanks

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