java调用dll: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

Tags:  dll调用 vc调用dll vb调用dll java调用dll

延伸阅读

最新评论

发表评论