0

Im trying to set single instance in c#, when user close the application this hides and if user click on the shortcut the first instance will show up.

I've tried to execute SetForegroundWindow, etc..

How I can show the first instance if is running in background?

Image of code when user close form

Program.cs instance control

Harman
  • 1
  • 2
  • So how would you actually close the instance ? What problem are you trying to solve by doing this ? – auburg Jul 09 '19 at 09:42
  • 2
    Possible duplicate of [What is the correct way to create a single-instance WPF application?](https://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-wpf-application) – Owen Pauling Jul 09 '19 at 09:42
  • The instance when user close the form i use the Hide() funtion to hide, and create a notifyicon – Harman Jul 09 '19 at 09:44
  • I think you should split your question into smaller parts. The following question is related, but is only part of your problem: [Programmatically hide an application on windows](https://stackoverflow.com/q/39897167/33499) – wimh Jul 09 '19 at 09:53

0 Answers0