Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16011

Subclassing application

$
0
0
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:

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
  '
  '

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

Viewing all articles
Browse latest Browse all 16011

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>