如同题目

解决方案 »

  1.   


    HWND hWnd = ::GetWindow(m_hWnd, GW_CHILD);
             while (hWnd)
    {
                  int nID = ::GetDlgCtrlID(hWnd);//这个就是ID
         hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
    }
      

  2.   

    BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam) 

        LPRECT rcParent; 
        int i, idChild; 
     
        // Retrieve the child-window identifier. Use it to set the 
        // position of the child window. 
     
        idChild = GetWindowLong(hwndChild, GWL_ID); 
     
        if (idChild == ID_FIRSTCHILD) 
            i = 0; 
        else if (idChild == ID_SECONDCHILD) 
            i = 1; 
        else 
            i = 2; 
      
        return TRUE;
    } void FindID(HWND hParentwnd)
    {
    EnumChildWindows(hParentwnd, EnumChildProc, NULL);
    }
      

  3.   

    http://blog.csdn.net/laiyiling/archive/2004/11/21/189305.aspxCWnd *pChildwnd=pWnd->GetWindow(GW_CHILD);//枚举pWnd的所有子控件
    pChildwnd= pChildwnd->GetNextWindow();