Beispiel #1
0
        IntPtr WndEvents(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
        {
            switch (msg)
            {
            case USER32.WM_CREATE:
                return(IntPtr.Zero);

            case USER32.WM_ACTIVATEAPP:
                this.wActive = (wParam != IntPtr.Zero);
                return(IntPtr.Zero);

            case USER32.WM_CLOSE:
                USER32.DestroyWindow(this.wHandle);
                return(IntPtr.Zero);

            case USER32.WM_DESTROY:
                OPENGL32.wglMakeCurrent(this.dcHandle, IntPtr.Zero);
                OPENGL32.wglDeleteContext(this.wglContext);
                USER32.PostQuitMessage(0);
                return(IntPtr.Zero);

            default:
                return(USER32.DefWindowProc(hWnd, msg, wParam, lParam));
            }
        }
Beispiel #2
0
        IntPtr WndEvents(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
        {
            switch (msg)
            {
            case USER32.WM_ACTIVATEAPP:
                this.wActive = (wParam != IntPtr.Zero);
                return(IntPtr.Zero);

            case USER32.WM_CLOSE:
                USER32.DestroyWindow(this.wHandle);
                return(IntPtr.Zero);

            case USER32.WM_DESTROY:
                USER32.PostQuitMessage(0);
                return(IntPtr.Zero);

            default:
                return(USER32.DefWindowProc(hWnd, msg, wParam, lParam));
            }
        }