Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg _
As Long, ByVal wParam As Long, lParam As WINDOWPOS) As _
Long
Const WM_NCDESTROY = &H82
Const WM_SYSCOMMAND = &H112
Const SC_SIZE = &HF000&
' If we're being destroyed,
' restore the original WindowProc.
If msg = WM_NCDESTROY Then
SetWindowLong _
hwnd, GWL_WNDPROC, _
OldWindowProc
End If
' See if this is a WM_SYSCOMMAND message.
If msg = WM_SYSCOMMAND Then
' This is a WM_SYSCOMMAND message.
' If the command is SC_SIZE, ignore it.
If (wParam And &HFFF0) = SC_SIZE Then Exit Function
End If
' Continue normal processing. VERY IMPORTANT!
NewWindowProc = CallWindowProc( _
OldWindowProc, hwnd, msg, wParam, _
lParam)
End Function
|