comparison src/video/wincommon/SDL_sysevents.c @ 565:7d7e19b59866

David MacCormack fixed a bug in window sizing with Windows menus
author Sam Lantinga <slouken@libsdl.org>
date Mon, 20 Jan 2003 00:17:01 +0000
parents 2a778055dbba
children 77bca0665b69
comparison
equal deleted inserted replaced
564:0da795da276c 565:7d7e19b59866
394 */ 394 */
395 case WM_GETMINMAXINFO: { 395 case WM_GETMINMAXINFO: {
396 MINMAXINFO *info; 396 MINMAXINFO *info;
397 RECT size; 397 RECT size;
398 int x, y; 398 int x, y;
399 int style;
399 int width; 400 int width;
400 int height; 401 int height;
401 402
402 /* We don't want to clobber an internal resize */ 403 /* We don't want to clobber an internal resize */
403 if ( SDL_resizing ) 404 if ( SDL_resizing )
422 size.right = SDL_PublicSurface->w; 423 size.right = SDL_PublicSurface->w;
423 } else { 424 } else {
424 size.bottom = 0; 425 size.bottom = 0;
425 size.right = 0; 426 size.right = 0;
426 } 427 }
427 AdjustWindowRect(&size, GetWindowLong(hwnd, GWL_STYLE), 428
428 FALSE); 429 /* DJM - according to the docs for GetMenu(), the
430 return value is undefined if hwnd is a child window.
431 Aparently it's too difficult for MS to check
432 inside their function, so I have to do it here.
433 */
434 style = GetWindowLong(hwnd, GWL_STYLE);
435 AdjustWindowRect(
436 &size,
437 style,
438 style & WS_CHILDWINDOW ? FALSE
439 : GetMenu(hwnd) != NULL);
440
429 width = size.right - size.left; 441 width = size.right - size.left;
430 height = size.bottom - size.top; 442 height = size.bottom - size.top;
431 443
432 /* Fix our size to the current size */ 444 /* Fix our size to the current size */
433 info = (MINMAXINFO *)lParam; 445 info = (MINMAXINFO *)lParam;