Are you asking this to create a single instance WPF application? If so, I encourage you to take a look at this project I created on CodePlex. It provides an Application
derived class that incapsulates the logic to create a single-instance/multiple-instance aware WPF application, dealing with inter-instances communication too (i.e. the main application can receive the arguments passed to a subsequent instance).
The source code is available, so you can even check that a global mutex and some WaitHandle are used to ensure synchronization.
To answer directly to your question, the proper place to acquire the global mutex is inside an override of the Application.Startup
method, since it is called at the beginning (more or less) of the Application.Run
method, which can be considered equivalent to the program Main
(of course it is not the same thing, but for the purpose of having a single instance application is enough).