I want to get the text entered in a textbox using subclassing. I also want to get certain other information also using subclassing. Here is my code snippet for subclassing:
It appears that I cannot do both in the above WndProc because to get text data using WM_CHAR I have to subclass with hWnd = handle of the textbox and to do WM_COMMAND I have to subclass with hWnd = handle of my application.
Is there anyway to have one WndProc and do both
Code:
Public Function MyWndProc(ByVal hWnd As Long, ByVal uMsg As Long, ByRef wParam As Long, ByRef lParam As Long, ByRef defCall As Boolean) As Long
Select Case uMsg
Case WM_CHAR
'
' Here I get text from textbox as Chr(wParam)
'
Case WM_COMMAND
'
' I want to capture other events here
'
End Select
End Function
'
'
Is there anyway to have one WndProc and do both