I have a fullscreen window with the Topmost property set to true. Whenever an application changes its WindowState property, my window is automatically minimized even though it has the active focus. For example, the code below exemplifies the problem. 3 seconds after the window is deactivated, it changes from Minimized to Normal, minimizing the other fullscreen application.
// Topmost = false
private void Form1_Deactivate(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
this.WindowState = FormWindowState.Normal;
}
Is there a way to preserve the fullscreen window's WindowState property in such a case? I want the user to choose to minimize the fullscreen app, so I want to stop other programs from stealing the focus.