My memory of Petzold style programming is a bit hazy but while trying to locate a bug (in a 3rd party's code) I came across this:-
Code:
LRESULT CALLBACK
WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
// Some other stuff
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL:
PostMessage(hwnd, message, wParam, lParam);
return 0;
default:
// calls DefWindowProc() as usual
}
}
The parameters used for PostMessage() are the same parameters received by WndProc() (unchanged). Wouldn't that result in an endless loop whenever WM_MOUSEWHEEL or WM_MOUSEHWHEEL gets received The effect is just to re-send the message isn't it? (as I said, my memory's a bit hazy on this stuff !!)