Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Message processing in Win32

I am totally new to Win32 programming, but i have some experience with Xwin. I tried out some code and wondered how messages are processed in Win32.
I created a base window for the application and a child window in it. Now i tried to process WM_KEYDOWN Messages in (and only in) the child window. I noticed that even if the pointer is over the child the source for all keydown events is the main application window.
In Xwin the Event- (Message-)source is the window the mouse pointer is over and then the event is propagated up the window hirarchy until it is blocked (and processed).
The only way i found to get the keydown message to the child-window is to use the following code in the callback for my mainwindow:

GetCursorPos(&point);
if((child=ChildWindowFromPoint(hWnd, point))!=hWnd)
SendMessage(child, uMsg, wParam, lParam);

I wonder if there is no automatic propagation process for messages like in XWin.

Best regards
Georg Steffers
Sign In or Register to comment.