How to check if software is already running

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amrik Singh

    How to check if software is already running

    HI folks can anyone help a newbie here.

    I would like to know how I can check if my software is already running.
    So that if the user click s on the shortcut to start the progam again
    it maximises the already running program.

    tia

    Amrik


  • J French

    #2
    Re: How to check if software is already running

    App.PrevInstanc e will tell you

    Actually communicating with the previous App is a bit more complicated
    - this involves finding its hWnd
    - or that of an obliging sub-window - eg: a Textbox

    ( I discarded AppActivate and SendKeys years ago )

    Look into the FindWindow API ...

    On Thu, 10 Jul 2003 10:34:04 +0000 (UTC), Amrik Singh
    <amrik.singh@bt internet.com> wrote:
    [color=blue]
    >HI folks can anyone help a newbie here.
    >
    >I would like to know how I can check if my software is already running.
    >So that if the user click s on the shortcut to start the progam again
    >it maximises the already running program.
    >
    >tia
    >
    >Amrik
    >
    >[/color]

    Comment

    • Paul

      #3
      Re: How to check if software is already running

      Amrik Singh <amrik.singh@bt internet.com> wrote in message news:<VA.000001 a9.007372de@bti nternet.com>...[color=blue]
      > HI folks can anyone help a newbie here.
      >
      > I would like to know how I can check if my software is already running.
      > So that if the user click s on the shortcut to start the progam again
      > it maximises the already running program.
      >[/color]

      You could try something like this...

      Private Sub Form_Initialize ()
      Rem check if a previous instance is running
      If App.PrevInstanc e Then
      temp = MsgBox("Another version of this program is already
      running", vbOKOnly, "Unable to start")
      End 'close this instance
      End If
      End Sub

      Comment

      Working...