如有可用api,拟利用该api枚举进程控制块,然后修改,使得该进程转入阻止态,或者运行态.
如无,则有无其他途径实现上述功能.

解决方案 »

  1.   

    WTSEnumerateProcesses
    但是我用的时候总是报错1151
    而1151是The specified program is not a Windows or MS-DOS program.
    真郁闷,关注中
      

  2.   

    转别人的帖http://community.csdn.net/Expert/topic/3992/3992856.xml?temp=6.673831E-02
    回复人: BigFanOfCpp(((Bytes)+_ALGIN-1) & ~(_ALGIN-1)) ( ) 信誉:100  2005-05-11 09:35:00  得分: 0  
     
     
       见我的blog:
    http://blog.csdn.net/bigfanofcpp或者用下面的方法:
    HANDLE hSnapshot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); PROCESSENTRY32 pe;
    ::ZeroMemory(&pe,sizeof(pe));
    pe.dwSize = sizeof(pe); BOOL bMore = ::Process32First(hSnapshot,&pe); while(bMore){ //循环到没有
    HANDLE hProcess = ::OpenProcess(
    PROCESS_QUERY_INFORMATION,
    FALSE,pe.th32ProcessID);
    if(hProcess != NULL){
    CString id;
    id.Format("Process ID: %d",pe.th32ProcessID);
    AfxMessageBox(id,MB_OK);
    }
    ::CloseHandle(hProcess); //移到下一个进程
    bMore = ::Process32Next(hSnapshot,&pe);
    }
      
     to more
    http://community.csdn.net/Expert/topic/3918/3918301.xml?temp=.6211206
      

  3.   

    解决了,加上#include <tlhelp32.h>头文件
    可以取出来
    szExeFile 
    Path and filename of the executable file for the process. 
    th32ProcessID 
    Identifier of the process. The contents of this member can be used by Win32 API elements.