Private Type nmhdr
hwndFrom As Long
idfrom As Long
code As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type REQSIZE
nmhdr As nmhdr
RECT As RECT
End Type
' Look for the WM_NOTIFY message with an
' EN_REQUESTRESIZE message.
Public Function NewWindowProc(ByVal hWnd As Long, ByVal msg _
As Long, ByVal wParam As Long, ByVal lParam As Long) As _
Long
On Error Resume Next
' See if this is WM_NOTIFY
If msg = WM_NOTIFY Then
' Copy lParam into the nmhdr structure,
CopyMemory m_nmhdr, ByVal lParam, Len(m_nmhdr)
' See if this is an EN_REQUESTRESIZE.
If m_nmhdr.code = EN_REQUESTRESIZE Then
' Copy lParam into the REQSIZE structure,
CopyMemory m_ReqSize, ByVal lParam, _
Len(m_ReqSize)
' Make the RichtextBox tall enough.
SetWindowPos g_RchWnd, VBNullPtr, _
0, 0, _
g_RichWidth, m_ReqSize.RECT.Bottom - _
m_ReqSize.RECT.Top, _
SWP_SHOWWINDOW Or SWP_NOMOVE
End If
End If ' If msg = WM_NOTIFY Then ...
' Call the original WindowProc.
NewWindowProc = CallWindowProc(m_OldWindowProc, hWnd, _
msg, wParam, lParam)
End Function
|