回复人:zhengyu_chen(chen) (2001-7-12 10:23:32) 得20分
g_hHook = SetWindowsHookEx(WH_MOUSE, MouseProc, _Module.m_hInst, GetCurrentThreadId());//安装HOOK
LRESULT CALLBACK MouseProc( int nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode < 0)
return CallNextHookEx(g_hHook, nCode, wParam, lParam);
MOUSEHOOKSTRUCT* lpMsg = (MOUSEHOOKSTRUCT*)lParam;
if (wParam == WM_MOUSEMOVE)
{
if(lpMsg->hwnd == g_hHookedWnd)//g_hHookedWnd为你要捕获的窗口
{
// the code you add
g_hHook = SetWindowsHookEx(WH_MOUSE, MouseProc, _Module.m_hInst, GetCurrentThreadId());//安装HOOK
LRESULT CALLBACK MouseProc( int nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode < 0)
return CallNextHookEx(g_hHook, nCode, wParam, lParam);
MOUSEHOOKSTRUCT* lpMsg = (MOUSEHOOKSTRUCT*)lParam;
if (wParam == WM_MOUSEMOVE)
{
if(lpMsg->hwnd == g_hHookedWnd)//g_hHookedWnd为你要捕获的窗口
{
// the code you add
解决方案 »
- MFC中如何将BYTE颜色数组显示出来?
- MFC创建圆角矩形的按钮?
- 通过SendMessage向按钮控件发送BM_IMAGE的问题
- 谁能给个vc得到html网页的dom树的代码?
- [win32]哪个API可以设置控件的背景颜色?或者怎样在空间生成的时候填写北京颜色?
- 记录存在,查询却告知“没有记录”,请教这是什么原因呢
- GDI+中如何释放Bitmap对象??请高人指点!!!急(可以加分)
- 为什么vc6.0++会突然关闭?
- VC60关于ODBC编程
- 要用vc做报表,mschar图形控件显示的图形也想加上去,怎么办?
- 大家都来谈谈自己用vc做的第一个项目吧
- 谁有VC 做的聊天室源码,给我瞧瞧! 一定给分!
Handle to the window that will receive the mouse message corresponding to the mouse event.