Re: wndProc()
Ali wrote:
[...] Correct return value of window
procedure depends on the message being processed. If you
don't want to handle a message, then call `DefWindowProc'
function.
No Offense, but Alex i don't get it!
WinProc is something overriding the procedure , right? so returning
'0' should be fine so that another caller in the row would be doing
the interested stuff (DefWindowProc).
There is no another caller to call `DefWindowProc'. You need
to call it if you want default behavior. Basically,
`DispatchMessage' function could be outlined like this:
LRESULT DispatchMessage(const MSG *lpmsg)
{
...
WNDPROC pfn = (WNDPROC)GetWindowLongPtr(
lpmsg->hwnd, GWLP_WNDPROC);
return CallWindowProc(pfn, lpmsg->hwnd,
lpmsg->message, lpmsg->wParam, lpmsg->lParam);
}
That's all. You can find correct return value for window
procedure in documentation for each window message. Also,
here's some interesting reading:
"No, really, you need to pass all unhandled messages to
DefWindowProc"
http://blogs.msdn.com/oldnewthing/archive/2006/04/25/583093.aspx
Alex