How To Subclass a VB Form Using 16-Bit VB CDK Custom Control (140883)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
This article was previously published under Q140883 SUMMARY
In Windows programming terms, subclassing is the process of creating a
message handling procedure and intercepting messages for a given
window, handling any messages you choose, and passing the rest to the
window's original message handler.
The subclass procedure is basically a message filter that performs
non-default processing for a few key messages, and passes other
messages to a default window procedure using CallWindowProc(). The
CallWindowProc() function passes a message to the Windows system,
which in turns sends the message to the target window procedure. The
target window procedure cannot be called directly by the subclass
procedure because the target procedure (in this case a window
procedure) is exported.
Below is a simple example of how to subclass a Visual Basic form by
writing a custom control using the Visual Basic Control Development
Kit (CDK). The Visual Basic CDK is shipped as part of Microsoft
Professional Toolkit for Microsoft Visual Basic version 1.0 for Windows
and as part of the Professional Edition of Microsoft Visual Basic versions
2.0, 3.0 and 4.0 for Windows.
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kb16bitonly kbhowto KB140883 |
---|
|