smawsk
2008-02-19 19:40:33 UTC
Hi,
This is my first post to this group. I have started reading "Windows
Internals" recently. My first question is that is this the right group
to ask questions on Internal working of the Windows OS?
If not then please redirect me to the appropriate group.
Now here's my question:
Why do we need to call DispatchMessage() to dispatch a message to the
window procedure? What if I directly call GetWindowLong() passing it
the window handle and get the address of the window procedure
associated with that window?
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
...............
WNDPROC fWndProc = (WNDPROC)GetWindowLong(Msg.hwnd, GWL_WNDPROC);
fWndProc(Msg.hwnd, Msg.message, Msg.wParam, Msg.lParam);
...................
}
Thanks in advance.
Warm Regards.
This is my first post to this group. I have started reading "Windows
Internals" recently. My first question is that is this the right group
to ask questions on Internal working of the Windows OS?
If not then please redirect me to the appropriate group.
Now here's my question:
Why do we need to call DispatchMessage() to dispatch a message to the
window procedure? What if I directly call GetWindowLong() passing it
the window handle and get the address of the window procedure
associated with that window?
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
...............
WNDPROC fWndProc = (WNDPROC)GetWindowLong(Msg.hwnd, GWL_WNDPROC);
fWndProc(Msg.hwnd, Msg.message, Msg.wParam, Msg.lParam);
...................
}
Thanks in advance.
Warm Regards.