当前位置导航:炫浪网>>网络学院>>编程开发>>C++教程>>C++基础入门教程

C++编写动态调用dll杀进程的程序

    一起来看下面的代码:

 #include <stdio.h>
#include <windows.h>

typedef int (*lpE_Pro_KillProcessByName)(IN const char* pchar_param_ProName);

int main(int argc, char *argv[])
{
HINSTANCE hDll; //DLL句柄
lpE_Pro_KillProcessByName KillProcessByName;
hDll = LoadLibrary("WinAPIExS.dll");
if (hDll != NULL)
{
KillProcessByName=(lpE_Pro_KillProcessByName)GetProcAddress(hDll, "E_Pro_KillProcessByName");
if (KillProcessByName != NULL)
{
char procname[]="Thunder5.exe";
KillProcessByName(procname);
}
FreeLibrary(hDll);
}
return 0;
}

    程序用到了WinAPIExS.dll
相关内容
赞助商链接