zoukankan      html  css  js  c++  java
  • 列举进程

    xp:

    #include <windows.h>
    #include <tlhelp32.h>

    int SearchProess(const char* name)
    {
    int ret=0;
    HANDLE handle=NULL;
    PROCESSENTRY32 pe32={0};
    do
    {
    handle=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
    if(handle==(HANDLE)-1)break;
    pe32.dwSize=sizeof(PROCESSENTRY32);
    if(!Process32First(handle,&pe32))break;
    do
    {
    if(strcmp(pe32.szExeFile,name)==0)
    {
    ret=1;
    break;
    }
    }
    while(Process32Next(handle,&pe32));
    } while (0);
    if(handle)
    {
    CloseHandle(handle);
    handle=NULL;
    }
    return ret;
    }

    WINCE:

    #include <tlhelp32.h>
    #pragma comment(lib, "Toolhelp.lib ")


    int SearchProess(const TCHAR* name)
    {
    int ret=0;
    HANDLE handle=NULL;
    PROCESSENTRY32 pe32={0};
    do
    {
    handle=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
    if(handle==(HANDLE)-1)break;
    pe32.dwSize=sizeof(PROCESSENTRY32);
    if(!Process32First(handle,&pe32))break;
    do
    {
    if(_tcscmp(pe32.szExeFile,name)==0)
    {
    ret=1;
    break;
    }
    }
    while(Process32Next(handle,&pe32));
    } while (0);
    if(handle)
    {
    CloseToolhelp32Snapshot(handle);
    handle=NULL;
    }
    return ret;
    }

  • 相关阅读:
    oracle 监听 添加ip
    重装系统windows
    oracle user pwd
    mybatis
    sum行列合计
    IIS8.5 运行WCF
    exp自动备份在bat中不执行
    oem 重建
    yum install oracle-validated
    MSHflexgrid控件删除选中行
  • 原文地址:https://www.cnblogs.com/ccmfc/p/2624635.html
Copyright © 2011-2022 走看看