''---------------------以下代码必须放在模块中---------------------
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function CallWindowProc Lib "user32" 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 Const GWL_WNDPROC = (-4)
Private Const WM_NCLBUTTONDBLCLK = &HA3
Private m_lpPrevWndProc As Long
Public g_hWnd As Long
Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If uMsg <> WM_NCLBUTTONDBLCLK Then
WindowProc = CallWindowProc(m_lpPrevWndProc, hwnd, uMsg, wParam, lParam)
End If
End Function
Public Function Hook() As Boolean
Hook = True
If g_hWnd = 0 Then
Hook = False
Exit Function
End If
m_lpPrevWndProc = SetWindowLong(g_hWnd, GWL_WNDPROC, AddressOf WindowProc)
End Function
Public Function UnHook() As Boolean
Call SetWindowLong(g_hWnd, GWL_WNDPROC, m_lpPrevWndProc)
End Function