It's a trick to handle the application to have only a single instance. The Mutex (Mutual Exclusion) object is used to define the instance with a unique name. Here we called it SingleInstanceDemo. The Boolean out parameter returns whether the current calling thread has been granted the initial ownership of the mutex object.
For the first instance of the application, it will be granted as the initial ownership. When the second instance runs, the calling thread will not get the initial ownership because the mutex object with the same name, SingleInstanceDemo, already exists and is running.
So, the Boolean value of isNewInstance will be false and the message box will get displayed on the screen. The second instance of the application is still running at that moment and calls the Shutdown() method when you click on the OK button to close the message box.
Thus, the second instance will be removed from the process list. The first instance will continue running on the system.