TestDll.Asm
上传用户:yoyoxiao
上传日期:2021-10-16
资源大小:31k
文件大小:1k
- ;#########################################################################
- ; Assembler directives
- .486
- .model flat,stdcall
- option casemap:none
- ;#########################################################################
- ; Include file
- include TestDll.inc
- .code
- ;#########################################################################
- ; Common AddIn Procedures
- DllEntry proc hInst:HINSTANCE, reason:DWORD, reserved1:DWORD
- mov eax, hInst
- mov hInstance, eax
- mov eax, TRUE
- ret
- DllEntry Endp
- InstallHook proc hWin:DWORD
-
- mov eax,hWin
- mov hToolBar,eax
- invoke SetWindowsHookEx,WH_MSGFILTER,OFFSET MsgHook,hInstance,0
- mov hHook,eax
- ret
- InstallHook endp
- MsgHook proc uses edi code:DWORD,wParam:DWORD,lParam:DWORD
- LOCAL pt :POINT
- LOCAL mii :MENUITEMINFO
- LOCAL pID :DWORD
- LOCAL rct :RECT
- mov eax,code
- test eax,eax
- .IF SIGN?
- jmp exit
- .endif
- mov edi,lParam
- .IF [edi].MSG.message == WM_MOUSEMOVE
- invoke GetCursorPos,ADDR pt
- invoke ScreenToClient,hToolBar,ADDR pt
- mov eax,pt.y
- shl eax,16
- mov ecx,pt.x
- mov ax,cx
- invoke SendMessage,hToolBar,WM_MOUSEMOVE,[edi].MSG.wParam,eax
- .ELSEIF [edi].MSG.message == WM_KEYDOWN
- .IF wParam == VK_ESCAPE
- invoke SendMessage,hToolBar,WM_CANCELMODE,0,0
- invoke UnhookWindowsHookEx,hHook
-
- .ENDIF
- .endif
- exit:
- invoke CallNextHookEx,hHook,code,wParam,lParam
- ret
- MsgHook endp
- ;#########################################################################
- End DllEntry