Example #1
0
        protected override HandleRef BuildWindowCore(HandleRef hwndParent)
        {
            var wndClass = new WndClassEx();

            wndClass.cbSize        = (uint)Marshal.SizeOf(wndClass);
            wndClass.hInstance     = Interop.GetModuleHandle(null);
            wndClass.lpfnWndProc   = Interop.DefaultWindowProc;
            wndClass.lpszClassName = WindowClass;
            wndClass.hCursor       = Interop.LoadCursor(IntPtr.Zero, (int)Win32Interoperation.Cursor.Arrow);
            wndClass.style         = 0x0008;

            Interop.RegisterClassEx(ref wndClass);

            Hwnd = Interop.CreateWindowEx(
                0, WindowClass, "", (int)(WindowStyle.Child | WindowStyle.Visible),
                0, 0, (int)ActualWidth, (int)ActualHeight, hwndParent.Handle, IntPtr.Zero, IntPtr.Zero, 0);

            Initialize();
            HwndInitialized = true;
            return(new HandleRef(this, Hwnd));
        }
Example #2
0
 public static extern short RegisterClassEx([In] ref WndClassEx lpwcx);