' Process Windows messages.
Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg _
As Long, ByVal wParam As Long, ByVal lParam As Long) As _
Long
Const WM_SETCURSOR = &H20
' See if this is a WM_SETCURSOR message.
If msg = WM_SETCURSOR Then
' See if the message is for a button.
If wParam = Form1.Command1.hwnd Or _
wParam = Form1.Command2.hwnd _
Then
' It is a button. See if the active
' control is not a button. Don't save
' the name of a button (in case the
' user clicks a button twice).
If Not (TypeOf Screen.ActiveControl Is _
CommandButton) Then
gFocusControl = Screen.ActiveControl.Name
End If
End If
End If
' Process the message normally.
NewWindowProc = CallWindowProc( _
OldWindowProc, hwnd, msg, wParam, _
lParam)
End Function
|