Determine if an app is already running

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • KenWiens
    Forum Member
    • Jul 2003
    • 2

    Determine if an app is already running

    I'm using AMS to create an autorun for a CD. I want to detect that the installed program is already running and just exit. This should be basic functionality, but I'm having dificulty. I tried modifying the Hide/Show Cursor example to call FindWindow, but it tells me it can't find c:\windows\System32\User32.dll::FindWindow.

    Any thoughts?
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3967

    #2
    Re: Determine if an app is already running

    Use AMSs built in action.

    Look under Window in the Actio Tree View

    Comment

    • KenWiens
      Forum Member
      • Jul 2003
      • 2

      #3
      Re: Determine if an app is already running

      That only works if the caption of the window is static. As with many apps, ours adds the current document name after the app name. And the built-in Window.Find doesn't support className, the other parameter of the Win API FindWindow, which does work for me (tested in VB 6).

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9741

        #4
        Re: Determine if an app is already running

        Sooper easy Ken, just use a registry key. Set your app to write a value on startup and then destroy it on shutdown and then all you ever have to do from other apps to check if that app is running is to look for that value. [img]/ubbthreads/images/icons/smile.gif[/img]

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment

        Working...
        X