我现在试图使用hook函数,根据网上找的,试着在自己的程序里面不创建dll而使用一个键盘钩子函数。但是,链接的时候穿西安了问题。
"class CCalculator_TestApp theApp" (?theApp@@3VCCalculator_TestApp@@A) already defined in Calculator_Test.obj
看意思是theApp已经在这个obj文件内被创建,但是我取消后。连编译都过不去了。 有什么办法解决没有?
钩子函数调用的时候是这样
hook = SetWindowsHookEx(WH_KEYBOARD_LL,LowLevelKeyboardProc,theApp.m_hInstance,0);
莫非只能写dll在使用钩子函数,没别的方法了?大虾们赐教一下啊。
"class CCalculator_TestApp theApp" (?theApp@@3VCCalculator_TestApp@@A) already defined in Calculator_Test.obj
看意思是theApp已经在这个obj文件内被创建,但是我取消后。连编译都过不去了。 有什么办法解决没有?
钩子函数调用的时候是这样
hook = SetWindowsHookEx(WH_KEYBOARD_LL,LowLevelKeyboardProc,theApp.m_hInstance,0);
莫非只能写dll在使用钩子函数,没别的方法了?大虾们赐教一下啊。
解决方案 »
- 如何快速计算CPU的频率 要的是动态频率,和cpuz看到的同步,大家都看下吧
- 跪求:默认按钮问题
- 关于CSplitterWnd类,控制一个分割窗口到一定的大小
- 往一个表中插入一条空白记录的SQL语句是什么?
- 一个初级问题,.def文件是用来做什么的
- 500分!!!求IDEA算法、RSA算法 源代码(C++写的)(分不够可另外开贴!!!)
- 如何实现当弹出一对话框后,使鼠标在这个对话框隐掉,不起作用?
- 我想做一个全自动安装RealPlayer的程序。可是RealPlayer有很多选择要设置,才能安装,怎么让它自动设置,让它在后台自动运行安装
- 重叠IO wsawaitformultipleevents不等前一个事件结束 第2个事件进不了
- 请教一个全局hook的问题
- 为什么在注册窗口类和创建窗口时,需要传递句柄参数????
- 屏幕抓4位的16色彩图
HHOOK SetWindowsHookEx( int idHook,
HOOKPROC lpfn,
HINSTANCE hMod,
DWORD dwThreadId
);
hMod
[in] Handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.dwThreadId
[in] Specifies the identifier of the thread with which the hook procedure is to be associated. If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread.
hook = SetWindowsHookEx(WH_KEYBOARD_LL,LowLevelKeyboardProc,NULL,0);
//这样试试
比如:
123 123 但是比较结果是不相等
123 123123 结果却相等,这是为什么?郁闷啊!