Tech Support > Microsoft Windows > Development Resources > Routing messages to my WndProc
Routing messages to my WndProc
Posted by Ron Hiler on September 4th, 2003


So I have my main window:
MainWindowHandle = CreateWindowEx(NULL, AppName, AppName, WS_OVERLAPPED
| WS_CAPTION | WS_SYSMENU, 10, 10, 900, 535, NULL, NULL, Instance, NULL);

On this window I have put a tab control:
TabControl = CreateWindowEx(0, WC_TABCONTROL, NULL, WS_CHILD |
WS_VISIBLE | WS_CLIPSIBLINGS, 5,55,850,350, MainWindowHandle,
(HMENU)hTabControl, Instance, NULL);

On the tab control I have placed a checkbox:
LagCheckBox = CreateWindow("button", "Simulate Lag", WS_CHILD |
WS_VISIBLE | BS_AUTOCHECKBOX, 650, 30, 150, 20, TabControl,
HMENU(hLagCheckBox), Instance, NULL);

Problem: Messages from the check box do not reach my WndProc (where my main
window messages go). If I change the check box to be a child of the main
window, they get there. However, that's not really what I want to do, it
should be a child of the tab control.

Question: How do I route messages from children of my tab control to my
WndProc procedure?

Thanks for tips. Ron


Posted by Norman Bullen on September 4th, 2003


Ron Hiler wrote:
The standard and common controls always send notification messages back
to their immediate parent.

Your check box really should be a child of the main window. Why do you
think it should be a child of the tab control?

Norm