Link to home
Start Free TrialLog in
Avatar of yossikally
yossikally

asked on

What's the difference between "Owner Drawn" and subclassed control

I understand both techniques are used to change a control's behaviour, but I would like to know how they differ from one another in terms of Windows message processing and redirection.
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Subclassing means the control is of your 'custom type' where the functions in your class are available - not necessarily anything to do with drawing.

Owner drawn means just that - you draw it, all of it.  The only message/events being responded to are painting events.
Avatar of yossikally
yossikally

ASKER

Hi AndyAinscow.
So you say that a subclassed control gets all Windows messages, whereas an OwnerDrawn control only gets WM_PAINT?

Do you know of links to Win32 projects (not MFC) that show that?
>>Do you know of links to Win32 projects (not MFC) that show that?

No.  But the principle would be the same in an MFC project.
And as for my other question/statement?
can I safely say that an ownerdrawn control gets just wm_paint and a subclass gets all messages?
In other words: a subclass is identical to ownerdrawn if I pass all but wm_paint to superclass?
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial