int count = 0;
HWND hwndChild=::GetWindow(m_hWnd,GW_CHILD); //列出所有控件
while(hwndChild)
{
count++;
int woc=::GetDlgCtrlID(hwndChild);//取得ID
GetDlgItem(woc)->EnableWindow(FALSE);
hwndChild=::GetWindow(hwndChild, GW_HWNDNEXT);
}
CString str;
str.Format(_T("Count:%d"), count);
MessageBox(str);