用Tool Helper库函数,具体用法你查MSDN,别说你不会!

解决方案 »

  1.   

    CListCtrl m_cList;
    //--------------
             m_cList.DeleteAllItems();
    HANDLE hProcess = NULL;
    PROCESSENTRY32 pe32 = {0};
    hProcess = (HANDLE)CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
    pe32.dwSize = sizeof(PROCESSENTRY32);
    Process32First(hProcess, &pe32);
    int i = 0;
    while (Process32Next(hProcess, &pe32))
    {
    m_cList.InsertItem(i++,pe32.szExeFile);
    }
    CloseHandle(hProcess);
    CString str;
    str.Format("当前的线程数为:%d个", i);
    CWnd *pWnd = GetDlgItem(IDC_STATIC_TIP);
    pWnd->SetWindowText(str);
    送分吧。兄弟
      

  2.   

    CWnd *pWnd=GetForgroundWindow();
    CString str;
    while(pWnd)
    {
       pWnd->GetWindowText(str);
       m_ListBox.AddString(str);  //m_ListBox是你定义的一个列表筐控件变量
       pWnd=pWnd->GetNextWindow();
    }
    这样就把所有的窗口列举出来了,不管窗口可见不可见
      

  3.   

    参考MSDN sample  "DLGCBR32" 
    EnumWindows()