Esempio n. 1
0
        public Win32Window(WindowingService service, WndProc wndProc)
            : base(service)
        {
            var winClass = new WndClass
            {
                style         = Constants.CS_OWNDC,
                lpfnWndProc   = wndProc,
                hInstance     = Native.GetModuleHandle(null),
                lpszClassName = $"OpenWindow_DUMMY[{Native.GetCurrentThreadId()}]({_windowId++})"
            };

            _className = winClass.lpszClassName;

            if (Native.RegisterClass(ref winClass) == 0)
            {
                throw GetLastException("Registering window class failed.");
            }

            Hwnd = Native.CreateWindowEx(
                0,
                winClass.lpszClassName,
                "OpenWindow dummy window",
                0,
                0, 0, 0, 0,
                IntPtr.Zero,
                IntPtr.Zero,
                winClass.hInstance,
                IntPtr.Zero);

            _windowData = new Win32WindowData(Hwnd);

            InitOpenGl(service.GlSettings);
        }
Esempio n. 2
0
 public static extern ushort RegisterClass([In] ref WndClass lpWndClass);