Announcement

Collapse
No announcement yet.

Determine if an app is already running

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    Re: Determine if an app is already running

    Use AMSs built in action.

    Look under Window in the Actio Tree View

    Comment


    • #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


      • #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