Этот фрагмент может помочь!
HWND hChildWnd;
long childCount = 0L;
hChildWnd = GetWindow(hWnd, GW_CHILD);
if(IsWindow(hChildWnd)) {
childCount ++;
while(hChildWnd){
hChildWnd = GetWindow(hChildWnd, GW_HWNDNEXT);
if(IsWindow(hChildWnd))
childCount ++;
}
}