I overrided a form(System.Windows.Forms.Form and I will call it Form0)'s CreateParams property like this
protected override CreateParams CreateParams
{
get
{
CreateParams _CreateParams = base.CreateParams;
_CreateParams.ExStyle |= (WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW);
_CreateParams.Parent = IntPtr.Zero;
return _CreateParams;
}
}
This window should not be able to be activated(WS_EX_NOACTIVATE) and have no icon shown in the taskbar(WS_EX_TOOLWINDOW).
It works WELL when I use
Application.Run(new Form0());
But it doesn't work as what I expected when I use
Form0.Show()
I want to know why and how to make it take effect while using Show()
.