Kiran's Blog

Ramblings from a dehydrated mind…

  • Archives

    • 14,897

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.

Advertisements

5 Responses to “Custom Draw and Owner draw”

  1. 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?

  2. 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 ..

  3. Dom Pee said

    hmm.. 10x 🙂

  4. mohsin said

    hii
    i want to know whether list box support nm_customdraw message.

  5. electric pruner…

    […]Custom Draw and Owner draw « Kiran's Blog[…]…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: