Custom Draw and Owner draw
Posted by kiraninbng on July 6, 2006
Custom draw is a service provided by some of the common controls.Custom draw allows you to make minor changes to the way the items are displayed in the screen.
Currently, the following controls support custom draw functionality:
Header controls
List-view controls
Rebar controls
Toolbar controls
ToolTip controls
Trackbar controls
Tree-view controls
All common controls that support custom draw send NM_CUSTOMDRAW notification messages at specific points during drawing operations. These notifications
describe drawing operations that apply to the entire control as well as drawing operations specific to items within the control. Like many notification messages,
NM_CUSTOMDRAW notifications are sent as WM_NOTIFY messages.
Custom draw feature is somewhere in between the controls default drawing behaviour and the programs owner draw functionality
Owner draw feature allows the customizing the existing controls or lets drawing the control from the scratch.
Currently, the following controls support OwnerDraw functionality:
Buttons
ComboBoxes
ListBoxes
ListView controls
Menus
Static controls
Tab controls
Whenever the item must be drawn Windows sends the WM_DRAWITEM message to the window procedure of the item’s owner window. This message contains a pointer to
a DRAWITEMSTRUCT structure.The application can customize the controls by handling this message.
Rasqual said
Hello Kiran,
Would it be possible (documentedly or hackingly) to have a shell extension handle a custom draw event for explorer controls, such as the treeview or the listview?
raghav krish said
Hi,
I am planning to change the back color of a toolbar using custom draw feature. Do u know how to do it.
Btw, I am using VB ..
Dom Pee said
hmm.. 10x