#include "stdafx.h"
#include <Windows.h>
HHOOK g_hMouse=NULL;
LRESULT CALLBACK MouseProc(int nCode,
WPARAM wParam,
LPARAM lParam
)
{
MessageBox(NULL, L"安装钩子成功!", L"DLL:", MB_OK);
return 1;
}
void setHook()
{
g_hMouse=SetWindowsHookEx(WH_MOUSE, MouseProc, GetModuleHandle((LPCWSTR)"apiHookDll"), 0);
if (!g_hMouse)
{
MessageBox(NULL, L"安装钩子失败!", L"DLL:", MB_OK);
}
}
加了DEF文件 这个钩子总是安装失败 怎么回事?