C#: Restore Window executing same exe

67 views Asked by At

I execute my Program, which later displays a Form. Once I minimize it, it gets shrinked into the systemtray. Doubleclicking my systemtray-icon does:

Show();
Activate();
WindowState = FormWindowState.Normal;

Which shows the Form again. Works.

Question: How can this be done while executing the same exe again, instead of doubleclicking the trayicon?

Problem: ShowWindow(handle, SW_MAX) displays the window, but some elements in the form are missing. NOTE: This does not happen, when i doubleclick the tray-icon.

1

There are 1 answers

1
Dilan Wickramarathna On

this will be helpful , you can find the current process is running or not when you re executing the process, if running you can maximize the current process Link