Example #1
0
        /// <summary>
        /// Registeres the window class using the API-call RegisterClass()
        /// </summary>
        /// <returns></returns>
        private bool RegisterWindowClass()
        {
            tooltipWindowProcedure = new Interop.WNDPROC(this.ToolTipWindowProcedure);
            bool flag = false;

            Interop.WNDCLASS interop_WNDCLASS = new Interop.WNDCLASS();
            interop_WNDCLASS.style         = 0;
            interop_WNDCLASS.lpfnWndProc   = tooltipWindowProcedure;
            interop_WNDCLASS.hInstance     = Interop.GetModuleHandle(null);
            interop_WNDCLASS.hbrBackground = (IntPtr)6;
            interop_WNDCLASS.lpszClassName = HelpToolTipWindow.WindowClassName;
            interop_WNDCLASS.cbClsExtra    = 0;
            interop_WNDCLASS.cbWndExtra    = 0;
            interop_WNDCLASS.hIcon         = IntPtr.Zero;
            interop_WNDCLASS.hCursor       = Cursors.Arrow.Handle;
            interop_WNDCLASS.lpszMenuName  = null;
            if (_showShadow && IsDropShadowSupported())
            {
                interop_WNDCLASS.style |= Interop.CS_DROPSHADOW;
            }
            if (Interop.RegisterClass(interop_WNDCLASS) != IntPtr.Zero)
            {
                flag = true;
            }
            return(flag);
        }
Example #2
0
 private bool RegisterWindowClass()
 {
     splashWindowProcedure = new Interop.WNDPROC(this.SplashWindowProcedure);
     bool flag = false;
     Interop.WNDCLASS wc = new Interop.WNDCLASS();
     wc.style = 0;
     wc.lpfnWndProc = splashWindowProcedure;
     wc.hInstance = Interop.GetModuleHandle(null);
     wc.hbrBackground = (IntPtr) 6;
     wc.lpszClassName = "SplashWindow";
     wc.cbClsExtra = 0;
     wc.cbWndExtra = 0;
     wc.hIcon = IntPtr.Zero;
     wc.hCursor = IntPtr.Zero;
     wc.lpszMenuName = null;
     if (this._showShadow && this.IsDropShadowSupported())
     {
         wc.style |= 0x20000;
     }
     if (Interop.RegisterClass(wc) != IntPtr.Zero)
     {
         flag = true;
     }
     return flag;
 }