In Windows Mobile Application, how to create only one instance of application?

Posted on 2007-10-14
Last Modified: 2013-12-27

I have an application I wrote in C# to be run on a windows mobile device.
The application works fine but here's a problem.

When ever I double click my application.exe, it starts a new application even if there is an existing one running. I want it so that if application.exe is already running, and user clicks to start a new application.exe, this brings up the existing application.exe without starting a new one.

Take Pocket Internet Explorer for example. When you already have IE running, and click to run IE again, this does not start a new IE application. It simply brings up the existing IE.

How can I do something like this for my application?

Thank you.

Question by:blast010
    1 Comment
    LVL 14

    Accepted Solution

    you can use this to check

    using System.Diagnostics;

    write this code in your form load
                Process[] CurrentProcesses;
                CurrentProcesses = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
    //instead of return you can end you application...
    //this code will check whether there is another process running with the same name
                if(CurrentProcesses.GetUpperBound(0) > 0) return;


    Featured Post

    Hire Top Freelancers to Complete C# Projects

    Source the talented Expert Exchange community
    for top quality work on your C# projects.

    Hire the best. Collaborate easily. Get quality work.

    Join & Write a Comment

    Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator ( This article presumes a wor…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now