

So to implement this functionality, all you need to do is, before you create a new instance of your application, get all the running processes and check the names of those processes with the currently running process. Note the words “gets/returns” in the preceding bullet points. They do not create new instances of the Process class.

NOTE: It is very important to note here that these methods simply get the already existing and running instances of the processes. Now if you call this method for “Chrome.exe”, you will get an array of Process components each having all the details of one chrome.exe process. So for example, if you have the Chrome browser running with multiple tabs open, then you can see in the Task Manager that there are as many number of “Chrome.exe” processes running as there are tabs in your browser.


We all must have observed some time or the other that when you try to open an application that is already running, you get a pop-up that says, “Another instance of this application is already running” or something like that.
