你不给Threadid赋值,它一直是0,然后你就把它传入函数里了??????
Threadid =AppDomain.GetCurrentThreadId()这是获取当前线程的句柄
如果你要获取的不是当前线程,那至少你要告诉编译器你到底要获取的是哪个线程的句柄啊,而不是传入个0拉倒
否则鬼知道你到底想对谁使用钩子
Threadid =AppDomain.GetCurrentThreadId()这是获取当前线程的句柄
如果你要获取的不是当前线程,那至少你要告诉编译器你到底要获取的是哪个线程的句柄啊,而不是传入个0拉倒
否则鬼知道你到底想对谁使用钩子
不是赋值?
看MSDN的描述,似乎楼主这方法无解。
hMod [in]
Type: HINSTANCEA 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. 用VC做一个DLL吧。使用全局勾子或是注入