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 6705309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:23:21+00:00 2026-05-26T07:23:21+00:00

After playing around with a new Windows Form project, I discovered that when you

  • 0

After playing around with a new Windows Form project, I discovered that when you associate a file type with an executable in Windows, you can find the file path of the file that launched the application using args[0] from static void Main(string[] args)

Is it possible to launch an event on your application when you double click a file if your application is already open? (As obviously Main(string[] args) won’t be triggered).

Example of an application with behavior I am attempting to replicate:

  1. User Opens GIMP(in Windows)
  2. User opens explorer and right clicks a .png file
  3. User selects open with GIMP
  4. Instead of creating a new application instance of GIMP, GIMP opens the picture in a new window within the instance of GIMP that was already opened.

In this case is GIMP employing multiple applications to accept files “opened” with file association? Or is it possible to do it with a single application “instance”.

I’m having trouble with this as most of my searches tend to lead me towards file association as a Windows user (i.e. “How to associate .xls files with excel” articles).

  • 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-26T07:23:21+00:00Added an answer on May 26, 2026 at 7:23 am

    Raymond is right of course, but if you’re looking for help with the implmentation of option (1) you should probably look at What is the correct way to create a single instance application? and .NET 4 single application instance and Switch to other instance of same application

    You’ll notice that detecting the application is pretty easy (use a mutex). Bringing the other application and sending it a filename can be more challenging.

    There are three basic solutions presented in the answers to the previously linked questions

    1. Use PostMessage to send a message to 1st instance. This uses HWND_BROADCAST which can have untended consequences.

    2. Use Microsoft.VisualBasic.ApplicationServices.ApplicationBase Of course a reference to VisualBasic gives some C# devs the willies.

    3. Use FindWindow which relies on a Windows Name.

    Its also worth noting that if you want the existing application to be in the front you’ll need to take special care because setting the foreground can only be given away not taken. See Foreground activation permission is like love: You can’t steal it, it has to be given to you and AllowSetForegroundWindow and SetForegroundWindow

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

Sidebar

Related Questions

After installing Monobjc and playing around with the Monobjc Application Project under C# in
I'm new with AppFabric Server caching but after playing around with it everything has
I am playing around with a new project, a split view iPad app using
I am quite new to erlang and yaws. I after playing around with the
I am still kind of new to programming and after playing around with a
I started playing around with web2py the other day for a new project. I
After playing around with haskell a bit I stumbled over this function: Prelude Data.Maclaurin>
Update: After playing around with this for a few hours, went with a multi-query
Alright, so after a few hours of me playing around to no avail, I
Hey guys how can I make an app keep playing an mp3 after pressed

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.