October 19, 2018
Hot Topics:

Size Up Your Applications with Subclassing

  • November 20, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

Now the hardcore stuff is out the way, we can test this out. Either add a new form or use the one provided, and copy the following code into it:

Option Explicit

Private Sub Form_Load()
' Start subclassing
FrmHwnd = Me.hwnd
FrmDC = Me.hDC
OldProc = GetWindowLong(FrmHwnd, GWL_WNDPROC)
SetWindowLong FrmHwnd, GWL_WNDPROC, AddressOf WndProc
End Sub

Private Sub Form_Unload(Cancel As Integer)
' End subclassing
SetWindowLong FrmHwnd, GWL_WNDPROC, OldProc
End Sub

Page 3 of 4

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date