Its my app runnig??

  • Thread starter Thread starter Alex G.
  • Start date Start date
A

Alex G.

some one knows how to check if my app. (Example ap1.exe)
is running (because i don't want than it run twice at the
same time in the same machine)

somebody knows like verifying if my application at the
moment this executing itself, since I do not want that
the application runs twice in the same computer at the
same time
 
some one knows how to check if my app. (Example ap1.exe)
is running (because i don't want than it run twice at the
same time in the same machine)

somebody knows like verifying if my application at the
moment this executing itself, since I do not want that
the application runs twice in the same computer at the
same time

Hi Alex,

The best way, in my opinion, to do this is to create a mutex object in your
application on startup (see System.Threading.Mutex). You should use the
Mutex(bool, String*, bool*) constructor, and set the first parameter to
false. If the third parameter is true on return, then you know that you
have the first running app instance, if it is false, then you have the
greater than first, and can quit, or whatever else you want to do.

-rory 8)
 
Back
Top