代碼如下:
#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