public ShellWindow()
{
CreateParams cp = new CreateParams();
cp.Style |= (int)NativeMethods.WindowStyles.WS_VISIBLE;
cp.Style |= unchecked ((int)NativeMethods.WindowStyles.WS_POPUP);
cp.ExStyle |= (int)NativeMethods.ExtendedWindowStyles.WS_EX_TOOLWINDOW |
(int)NativeMethods.ExtendedWindowStyles.WS_EX_NOACTIVATE;
cp.Height = SystemInformation.VirtualScreen.Height;
cp.Width = SystemInformation.VirtualScreen.Width;
cp.X = SystemInformation.VirtualScreen.Left;
cp.Y = SystemInformation.VirtualScreen.Top;
CreateHandle(cp);
MessageReceived += WndProc;
NativeMethods.SetWindowLong(Handle, NativeMethods.GWL_EXSTYLE,
NativeMethods.GetWindowLong(Handle, NativeMethods.GWL_EXSTYLE) &
~(int)NativeMethods.ExtendedWindowStyles.WS_EX_NOACTIVATE);
if (NativeMethods.SetShellWindow(Handle) == 1)
{
// we did it
IsShellWindow = true;
}
}