|
|
|
移动鼠标时显示鼠标所以在位置的坐标的问题
case WM_MOUSEMOVE: { //::InvalidateRect(hwnd,NULL,1);//???? HDC hdc=::GetDC(hwnd); POINT pPoint; ::GetCursorPos(&pPoint); ::ScreenToClient(hwnd,&pPoint); wsprintf(szTemp,"%ld,%ld",pPoint.x,pPoint.y); ::TextOut(hdc,pPoint.x,pPoint.y,szTemp,strlen(szTemp)); ::ReleaseDC(hwnd,hdc); return 0; } 改用静态框作为坐标显示输出试试 如果要用TextOut作为输出可能要在WM_PAINT里因为要重画窗口 呵呵! 我用静态框试过同类的程序都正常。 |
|
移动鼠标时显示鼠标所以在位置的坐标的问题
case WM_MOUSEMOVE: { //::InvalidateRect(hwnd,NULL,1);//???? HDC hdc=::GetDC(hwnd); POINT pPoint; ::GetCursorPos(&pPoint); ::ScreenToClient(hwnd,&pPoint); wsprintf(szTemp,"%ld,%ld",pPoint.x,pPoint.y); ::TextOut(hdc,pPoint.x,pPoint.y,szTemp,strlen(szTemp)); ::ReleaseDC(hwnd,hdc); return 0; } 加上一句: ::ClientToScreen(hwnd,&pPoint); 你这种得到鼠标的坐标信息只能是鼠标在客户区移动得到的坐标。 如果要得到整个屏幕的坐标还得用HOOK 呵呵! 这几天我刚好把这个得到整个屏幕鼠标坐标的程序作好。 感受到了HOOK的强大威力。 心里好高兴啊 |
|
|
|
[求助]在MASM里如何得到鼠标坐标并显示出来,如要用HOOK又要怎么写
怎么没人回啊! 我的HOOK函数是这样的 hookproc proc _dwcode,_wparam,_lparam LOCAL ppt:POINT ;local @sz[256]:byte invoke CallNextHookEx,hHook,_dwcode,_wparam,_lparam mov eax,_wparam .if eax==WM_MOUSEMOVE invoke GetCursorPos,addr ppt invoke MessageBox,hWnd,addr ppt.x,addr a,MB_OK .endif xor eax,eax ret hookproc endp ;######################################################################### installhook proc _hWnd push _hWnd pop hWnd invoke SetWindowsHookEx,WH_MOUSE,addr hookproc,hInstance,NULL mov hHook,eax ret installhook endp ;######################################################################### unstallhook proc invoke UnhookWindowsHookEx,hHook ret unstallhook endp 但我在delphi里调用这个DLL时鼠标坐标显示总是乱码,请问到底错在哪里? 不甚感激! |
|
(a+b)^c的展开式是什么?
a^c + b^c |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值