I want a notifyIcon for my windows form application with click functions like taskbar button :
- When the form is on top of other applications; activated, clicking on the notifyIcon must minimize application's window.
- When the form is under other applications; deactivated, but not minimized, clicking on notifyIcon must activate application's window.
- When application is minimized, clicking on the notifyIcon must maximize application's windows.
I've already tried Deactivate event of the form and Click event of notifyIcon, but it seems that in C# Deactivate event of form is compiled before Click event of the notifyIcon.
Here I found a way to detect if application is activated by clicking in the taskbar, but I couldn't find the same way for deactivation.