|
|
|
Click here to copy the following block | Option Explicit
Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA" ( _ ByVal lpPrevWndFunc As Long, _ ByVal hWnd As Long, _ ByVal Msg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" ( _ ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Private Const GWL_WNDPROC = -4 Private Const WM_MOUSEMOVE = &H200
Private hControl As Long Private lPrevWndProc As Long |
Click here to copy the following block |
Private Function WindowProc(ByVal lWnd As Long, ByVal lMsg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long Select Case lMsg Case WM_MOUSEMOVE Form1.Label1.Caption = "MouseMove(" & lMsg & ") Buttons=" & wParam & _ " Y=" & (lParam Mod 65536) & " X=" & (lParam \ 65535) End Select WindowProc = CallWindowProc(lPrevWndProc, lWnd, lMsg, wParam, lParam) End Function
Public Sub Hook(ByVal hControl_ As Long) hControl = hControl_ lPrevWndProc = SetWindowLong(hControl, GWL_WNDPROC, AddressOf WindowProc) End Sub
Public Sub Unhook() Call SetWindowLong(hControl, GWL_WNDPROC, lPrevWndProc) End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|