Thanks, I will look into that instead.
"Chris Tacke, eMVP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You're looking for an instance of yourself? If that's the case you have
> code control, set a mutex at startup and look for that, which is the
correct
> way, instead of a window search hack.
>
> -Chris
>
> "MDB" <nospam> wrote in message
> news:e6S%(E-Mail Removed)...
> > If anyone looked at this thanks however, I think I figured it out using
> this
> > bit of code.
> >
> >
> > [DllImport("coredll.dll", EntryPoint="FindWindow")]
> >
> > private static extern int FindWindow(string strClass, string strWindow);
> >
> > public static bool IsInstanceRunning()
> >
> > {
> >
> > string appname =
> > System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
> >
> > int temp = FindWindow(null, appname);
> >
> > if(temp != 0)
> >
> > {
> >
> >
> > return true;
> >
> > }
> >
> > else
> >
> > {
> >
> >
> > return false;
> >
> > }
> >
> > }
> >
> >
> >
> >
> >
> > "MDB" <nospam> wrote in message
> > news:%23FOm%(E-Mail Removed)...
> > > Is there a way to find out if an app is already running in memory
before
> > > starting up a new app and if so remove it pragmatically before
starting
> up
> > > the app again? I am running into problems where the app appears not
to
> be
> > > running however, it is in the background.
> > >
> > > TIA
> > >
> > > MDB
> > >
> > >
> >
> >
>
>
|