EnumProcess.cpp
资源名称:IceSword.rar [点击查看]
上传用户:fjdqny
上传日期:2008-02-11
资源大小:921k
文件大小:1k
源码类别:
其他
开发平台:
Visual C++
- #include <windows.h>
- #include <stdio.h>
- #include "Cooperator.h"
- int main()
- {
- if (!IsConnectServer())
- ConnectAndCall();
- if (!IsConnectServer())
- {
- printf("Error to connect servern");
- return -1;
- }
- DWORD pid[1000], ret;
- IsdGetVersion(&ret);
- printf("Icesword version : %xn", ret);
- if (IsdEnumProcesses(pid, 1000*sizeof(DWORD), &ret))
- {
- for (DWORD i=0; i<ret/sizeof(DWORD); i++)
- printf("%dn", pid[i]);
- printf("Total:%dn", i);
- }
- HMODULE mod[1000];
- if (IsdEnumProcessModules(pid[3], mod, 1000*sizeof(HMODULE), &ret))
- {
- for (DWORD j=0; j<ret/sizeof(HMODULE); j++)
- printf("%xn", mod[j]);
- printf("Total:%dn", j);
- }
- char name[2000];
- if (IsdQueryProcessFileName(pid[3], name, 4000))
- printf("%sn", name);
- return 0;
- }