// SetWindowsHookEx.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include using namespace std; #include "tlhelp32.h" HHOOK Handle = NULL; LRESULT CALLBACK HookProc ( int nCode, WPARAM wParam, LPARAM lParam ); BOOL InstallSetWindowsHookEx(ULONG ProcessId,BOOL Hook) { if(Hook) { HMODULE hModule = LoadLibrary(L"DllTestx64.dll"); if(hModule==NULL) { cout<<"Loadlibrary Fail"<>a; InstallSetWindowsHookEx(a,TRUE); cin>>b; if(b==20) { InstallSetWindowsHookEx(a,FALSE); } return 0; } LRESULT CALLBACK HookProc ( int nCode, WPARAM wParam, LPARAM lParam ) { MessageBox(NULL,L"Suu",L"Suu",1); return 0; }