CairoDesktop.Interop.NativeMethods.SetShellWindow C# (CSharp) Метод

SetShellWindow() приватный Метод

private SetShellWindow ( IntPtr hWnd ) : Int32
hWnd System.IntPtr
Результат System.Int32
        public static extern Int32 SetShellWindow(IntPtr hWnd);

Usage Example

Пример #1
0
        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;
            }
        }