hello friends,
do you have any idea how to check EXE file if its already Run... if its run then its should be show Error....
Thanks in Advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Dec 8, 2011, 11:47 AM
If the only thing you want to do is to determine if a previous instance exists, then there is a simple and reliable way to do that; you can use a Mutex. A Mutex is the most common solution for that.
There is sample code for a Mutex in Check running processes on a mobile device programmatically. I assume the reason it did not work for Nora is that (probably) Windows Mobile does not support use of Mutex like that; it should work for you.
VulpesPosted Dec 8, 2011, 4:39 AM
The best thing to do is to place Rafeeq's code at the top of your Main() method. If an instance of the application is already running, then you can display a message to the user and exit the second instance gracefully by returning immediately (with the 'return' statement) from the Main() method.
Naeem KhanPosted Dec 8, 2011, 4:00 AM
which event should be used for it...
Rafeeq MohamedPosted Dec 8, 2011, 1:25 AM