Index: dll/win32/uxtheme/nonclient.c =================================================================== --- dll/win32/uxtheme/nonclient.c (revision 71259) +++ dll/win32/uxtheme/nonclient.c (working copy) @@ -814,6 +814,9 @@ SetCapture(hWnd); + /* Set a default value for ht */ + ht = 0; + for (;;) { if (GetMessageW(&Msg, 0, WM_MOUSEFIRST, WM_MOUSELAST) <= 0) @@ -837,7 +840,8 @@ } } - ThemeDrawCaptionButtons(&context, ht, 0); + /* Default to wParam if we break without setting ht */ + ThemeDrawCaptionButtons(&context, ht ? ht : wParam, 0); ThemeCleanupDrawContext(&context); ReleaseCapture();