Bug 545760 - '[OOPP] Fix a few bad DefWindowProc messages that slipped through'. WM_STYLECHANGED. r=jimm.

This commit is contained in:
Ben Turner
2010-02-18 12:11:31 -08:00
parent 1a75ee1031
commit 43cf42c904
2 changed files with 35 additions and 1 deletions

View File

@@ -283,6 +283,11 @@ ProcessOrDeferMessage(HWND hwnd,
break;
}
case WM_STYLECHANGED: {
deferred = new DeferredStyleChangeMessage(hwnd, wParam, lParam);
break;
}
// Messages that are safe to pass to DefWindowProc go here.
case WM_ENTERIDLE:
case WM_GETICON:
@@ -291,7 +296,6 @@ ProcessOrDeferMessage(HWND hwnd,
case WM_NCHITTEST:
case WM_SETICON:
case WM_STYLECHANGING:
case WM_STYLECHANGED:
case WM_SYNCPAINT: // Intentional fall-through.
case WM_WINDOWPOSCHANGING: {
return DefWindowProc(hwnd, uMsg, wParam, lParam);
@@ -1122,3 +1126,18 @@ DeferredCopyDataMessage::~DeferredCopyDataMessage()
{
free(copyData.lpData);
}
DeferredStyleChangeMessage::DeferredStyleChangeMessage(HWND aHWnd,
WPARAM aWParam,
LPARAM aLParam)
: hWnd(aHWnd)
{
index = static_cast<int>(aWParam);
style = reinterpret_cast<STYLESTRUCT*>(aLParam)->styleNew;
}
void
DeferredStyleChangeMessage::Run()
{
SetWindowLongPtr(hWnd, index, style);
}