Child window handle not known
I defined a child window in my Window procedure as follows:
For i=5 I obviously have a child window ID of 8. In the procedure I can communicate with this child window through this ID. However, if I try to communicate with this child window in a Dialog procedure it doesn't work. If I try to get the child window handle with:
for(i = 3; i < 13; i++) hwndEdit[i] = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("edit"), TEXT(""), WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOHSCROLL, 2*cxChar, (6+(2+7/4)*i)*cyChar, 10*cxChar, 7*cyChar/4, hwnd, (HMENU) i+3, ((LPCREATESTRUCT) lParam) -> hInstance, NULL);
the MessageBox will not show up. hwnd is provided as a parameter to the Dialog Procedure. What am I doing wrong?
hChild = GetDlgItem(hwnd, 8);
if(hChild) MessageBox(NULL, TEXT("A handle is returned"), TEXT("Warning!"), MB_OK | MB_ICONINFORMATION);