0

Possible Duplicate:
single instance and notify in system tray

I am trying to implement a program in C#.NET. My program uses the notification icon. I have made my program a single instance program using the class singleinstance.cs from codeproject.

Now, what I am trying to do is, if I close the main window and then if I run the application again, it should open the main window of the already running program instance in the system tray.

I have googled a lot over this but didn't find something useful for me.

Community
  • 1
  • 1

1 Answers1

0

You need to maximize the window of an existing process, correct?

Here is an example of another question: Maximize another process' Window in .NET

To note, in the future, this is a borderline duplicate question, in my opinion. You could have used the search box in the top right of this page to find this answer on your own.

Community
  • 1
  • 1
jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
  • Actually I have already done that part in which I am restoring the window when a user clicks on the notification icon. But I am stuck when I am taking the command-line arguments to the program when a user right click a file and select my entry. What I am trying to do is, if my program is already running and a user right click on a file and select my entry from the menu. Then, I want to restore my program window and select a particular tab in that. – Aman Thakur Jan 24 '12 at 05:18
  • You will have to use WCF (or some other form of cross-proccess to do that). If you use WCF, use NetNamedPipeBinding. – jonathanpeppers Jan 24 '12 at 12:40
  • OK, thanks Jonathan...I appreciate your reply. I am trying that now. – Aman Thakur Jan 27 '12 at 05:53