Home » Tutorials » C# » Is Application running already in WPF

Is Application running already in WPF

User defined functions in sql
Performance improvement of cursor SQL Server

Is Application running already in WPF

Hello folks, till now we have already discussed regarding different topics like WPF The calling thread cannot access this object because a different thread owns it, which is very important when you want to update your UI stuffs while thread is running or from thread, and you have also read Extension Method in C#Extension Method with parameter in C#Reflection Introduction c#,  Reflection with Property in C#The Microsoft Jet database engine cannot open the file. It is already opened exclusively by another user.

Today, we will look into very important concept, lets say we have developed windows application or WPF application and if we haven’t check for whether application is running or not already, our application could open multiple times. Have look into below image.

Is-Application-Running-already-Without-Check

Is-Application-Running-already-Without-Check

Lets try put check on it, “Is Application running already in WPF”.

Solution:

To put check we need to get current process name and then try to fetch all the processes running in the task manager and at last find whether more than one instance is running or not.  Below is code snippet for checking.

Now build application and try to run multiple times this application, you will get below output.

Is-Application-Running-already-WPF

Is-Application-Running-already

You could also download sample example of Is Application running already in WPF

About

Hello friends, My self Dhruv Sheth, I have more than 6 years of Industrial experience as a Software Developer. In my career I got chance to work with asp.net, c#,Web API, JavaScript, JQuery, WPF, WCF , Windows Application, PostScript, vb.net, GhostScript etc. So I have decided to share my knowledge with everyone and finally I have come up with TechnoThirsty.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload CAPTCHA.




DISCLAIMER:
The content is copyrighted to technothirsty.com and may not be reproduced on other websites without permission from the owner.You may contact us using the information below.