hace rato q no agarro el vb, pero esta tarde se me ocurrio un proyecto, y pues necesitaba hacer algo referente al mouse, segun yo quiero hacer un hook a este, pero me crashea justo en el copymemory, ya he intentado de varias maneras y siguen crasheando, aqui lo dejo para q checquen q falla
Const WH_MOUSE_LL As Long = 14
Type POINTAPI
X As Long
Y As Long
End Type
Type MOUSEHOOKSTRUCT
pt As POINTAPI
hwnd As Long
wHitTestCode As Long
dwExtraInfo As Long
End Type
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, mStruct As Any) As Long
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public hHook As Long
Function MouseProc(nCode As Long, wParam As Long, lParam As Long)
Dim mStruct As MOUSEHOOKSTRUCT
CopyMemory mStruct, ByVal lParam, Len(mStruct)
End Function
Function IniHook()
hHook = SetWindowsHookEx(WH_MOUSE_LL, AddressOf MouseProc, App.hInstance, 0)
End Function
Function EndHook()
UnhookWindowsHookEx hHook
End Function