- /* User has finished resizing the window, force a redraw */
- INVOKE_WCB( *window, Display, ( ) );
-
- /*lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); */
- break;
-
- /* Other messages that I have seen and which are not handled already */
- case WM_SETTEXT: /* 0x000c */
- lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
- /* Pass it on to "DefWindowProc" to set the window text */
- break;
-
- case WM_GETTEXT: /* 0x000d */
- /* Ideally we would copy the title of the window into "lParam" */
- /* strncpy ( (char *)lParam, "Window Title", wParam );
- lRet = ( wParam > 12 ) ? 12 : wParam; */
- /* the number of characters copied */
- lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
- break;
-
- case WM_GETTEXTLENGTH: /* 0x000e */
- /* Ideally we would get the length of the title of the window */
- lRet = 12;
- /* the number of characters in "Window Title\0" (see above) */
- break;
-
- case WM_ERASEBKGND: /* 0x0014 */
- lRet = DefWindowProc( hWnd, uMsg, wParam, lParam );
+ if (!lParam || !fgWindowByHandle((HWND)lParam))
+ /* Capture released or capture taken by non-FreeGLUT window */
+ setCaptureActive = 0;
+ /* Docs advise a redraw */
+ InvalidateRect( hWnd, NULL, GL_FALSE );
+ UpdateWindow(hWnd);
+ lRet = 0; /* Per docs, should return zero */