I would like to reproduce the "on focus" behavior when you minimize an application on a context menu strip (I need that in C#), let me explain why:
When you minimize a window, the focus will be restored to the previous application that was used last, it's what I want to reproduce, basically, when I press on a selection on the context menu strip, I would like that application that was previously focused get the focus back so I don't have to click on it again.
Is there any way to achieve that?
I tried to play This.WindowState = this.WindowState = FormWindowState.Minimized; to make the program think it's getting minimized but it did not recreate the behavior I am expecting.
Thanks a lot for your time and help.
P.S.: The context menu strip is when you right click on an icon in the system tray (bottom right of the screen), basically the right click on the notify icon.
Context menu strip is the name of the control in VS2013.
The menus in the context menu strip are called "toolstrip menu items".