' Look for the ComboBox drop down.
Public Function NewWindowProc(ByVal hWnd As Long, ByVal msg _
As Long, ByVal wParam As Long, ByVal lParam As Long) As _
Long
Const WM_NCDESTROY = &H82
' If we're being destroyed,
' restore the original WindowProc.
If msg = WM_NCDESTROY Then
SetWindowLong _
hWnd, GWL_WNDPROC, _
OldWindowProc
End If
If msg = WM_COMMAND And _
ComboHwnd = (lParam And &HFFFF) And _
(wParam \ &H10000) = CBN_DROPDOWN _
Then
' The ComboBox is being dropped down.
Beep
End If
NewWindowProc = CallWindowProc( _
OldWindowProc, hWnd, msg, wParam, _
lParam)
End Function
|