Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7622117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:22:16+00:00 2026-05-31T04:22:16+00:00

I am working on WinForms. Now I want to implement one thing: when I

  • 0

I am working on WinForms. Now I want to implement one thing: when I will click on the desktop application’s shortcut, and then the application is in a minimized state, then it will open from system tray (not create a new instance).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:22:18+00:00Added an answer on May 31, 2026 at 4:22 am

    Okay so when you double-click the shortcut, that will actually open another instance of the application, which has no knowledge of the one already running minimised to the tray.

    Essentially you want to detect that another instance of your app is running on startup. If it is, tell the existing instance of your app to show it’s UI to the user, then quit.

    Your solution consists of two things:

    1. The ability for your app to understand that another instance of it is already running.
    2. The ability for your app to “talk” (inter-process communication) to other instances of it and tell them what to do.

    1. The ability for your app to understand that another instance of it is already running.
    This is simple in .NET. When you app opens, use the Mutex class. This is a system-wide lock, otherwise similar in nature to Monitor.

    Example:

    // At app startup:
    bool createdNew;
    var mutex = new Mutex(true, Application.ProductName, out createdNew);
    if (!createdNew)
    {
        // Use IPC to tell the other instance of the app to show it's UI
        // Return a value that signals for the app to quit
    }
    
    // At app shutdown (unless closing because we're not the first instance):
    mutex.ReleaseMutex();
    

    2. Inter-process communication
    There are a few methods for doing IPC in .NET. WCF is one, though quite heavy. Named pipes is probably the best choice for you, although it’s such a simple requirement that basic socket messaging should also work.

    Here’s a link to a question on appropriate IPC methods in .NET to help you out: What is the best choice for .NET inter-process communication?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a WinForms application which also has some WPF elements. Until now
I am working with CrystalDecisions.CrystalReports.Engine.ReportDocument in WinForms in Visual Studio 2008. Right now when
I am working on a winforms application using LINQ to SQL - and am
I'm working on a C# winforms application (VS.NET 2008, .NET 3.5 sp 1). I
I am using SlimDX with WinForms for a while now, but want to make
I'm re-working a Winforms application and would like to employ a variation of the
Working with a fairly large VB.Net back office winforms application. 1 million+ LOC. Big
I am working on a C# WinForms application in VC# 2008 Express, writing unit
I am working on a rather large WinForms application that has dozens of controls
I am working on porting a VB6 application to C# (Winforms 3.5) and while

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.