user32: Handle NULL rectangles in WM_NCCALCSIZE.

This commit is contained in:
Damjan Jovanovic 2008-11-15 18:15:04 +02:00 committed by Alexandre Julliard
parent 0aca97a247
commit 1603a51d4e
2 changed files with 8 additions and 0 deletions

View File

@ -417,6 +417,9 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
LONG style = GetWindowLongW( hwnd, GWL_STYLE );
LONG exStyle = GetWindowLongW( hwnd, GWL_EXSTYLE );
if (winRect == NULL)
return 0;
if (cls_style & CS_VREDRAW) result |= WVR_VREDRAW;
if (cls_style & CS_HREDRAW) result |= WVR_HREDRAW;

View File

@ -781,6 +781,7 @@ static void test_nonclient_area(HWND hwnd)
RECT rc_window, rc_client, rc;
BOOL menu;
BOOL is_win9x = GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == 0;
LRESULT ret;
style = GetWindowLongA(hwnd, GWL_STYLE);
exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
@ -809,6 +810,10 @@ static void test_nonclient_area(HWND hwnd)
trace("calc client: (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom);
ok(EqualRect(&rc, &rc_client), "client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d\n", style, exstyle, menu);
/* NULL rectangle shouldn't crash */
ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0);
ok(ret == 0, "NULL rectangle returned %ld instead of 0\n", ret);
/* Win9x doesn't like WM_NCCALCSIZE with synthetic data and crashes */;
if (is_win9x)
return;