0

I have a windows application that will work from a tray icon.

On its menu click, a windows form will appear. I also added a registry entry which will add a menu item in windows menu while selecting a file. When we click on that menu item, it will load the same windows form with the input file we clicked. Things are smooth till this point. But it is generating another exe in the task manager.

What I want to achieve here is to open the same exe which is running already, with the input parameter (here, say file path).

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
csLijo
  • 481
  • 2
  • 8
  • 26

3 Answers3

1

In previous projects, I've packed a string into an atom and passed it to other applications via the WM_COPYDATA message.

It may be worth looking into. I believe that was the original purpose of the message.

Brad Bruce
  • 7,638
  • 3
  • 39
  • 60
1

On application startup you should:

  • search for existing process of your application;
  • if it exists;
    • pass parameters using WCF;
  • if it doesn't exists just start application.
Vitaliy
  • 702
  • 6
  • 19
1

Simply with A little search you can find your answer

See this links :

http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/53a2c453-3502-44bd-9f43-b07250957ed5

How to Pass a string to an exe and retrieving from the exe using Process in C#

Running EXE with parameters

For More Information google this : send parameters to another exe file in c#

Community
  • 1
  • 1
Arash
  • 3,013
  • 10
  • 52
  • 74