Hi! I am a completely new WIN32ASM-fan and I have a question. I often read the word "subclassing". What is it?
Posted on 2001-03-14 13:52:00 by tcore
Subclassing is redefining the window procedure of a control. This way you can create your own procedure that handles specific messages to the control the way you want, and other messages can be redirected with CallWindowProc. It is used to change already existing controls to add extra functionality or modify parts of the control. Iczelion has written a tutorial on the subject, I believe it's tut #20. Thomas
Posted on 2001-03-14 15:31:00 by Thomas
tcore, Thomas has given it to you pretty straight. To get the idea, every window has a corresponding message handling procedure to deal with the system messages that get sent to it. With a window created with CreateWindowEx(), you define a WndProc type procedure when you create it but with pre-defined types of windows such as buttons, listboxes etc ... this is not done so if you need to process any of the messages for those controls, you have to access the message handling procedure in a manner that is called subclassing. If you have got MASM32v6 and the service packs for it, there is a code wizard to automate the creation of subclass procedures. What you basically do is to create a control and when you have a valid window handle, you then create the subclass so that you can process the messages sent to it if you need to. Regards, hutch@pbq.com.au
Posted on 2001-03-14 17:21:00 by hutch--