News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Ownerdraw toolbar

Started by anorak, December 26, 2005, 06:22:26 PM

Previous topic - Next topic

anorak

im creating a PNG icon toolbar
i know how to draw png icons with bitmap
but don't have any suggstion how to make ownerdraw toolbar...
if someone has any example it'll be very usefull

maybe there are some other solution then ownerdraw?

akane

it's very simple draw-handling used in my IE search-toolbar: it draws a non-standard-size icon on resized toolbar button
   case WM_NOTIFY /*message from CToolbar::WndProc*/
   settype lParam, NMTBCUSTOMDRAW
   select *lParam.nmcd.dwDrawStage

      case CDDS_PREPAINT
         return CDRF_NOTIFYITEMDRAW

      case CDDS_ITEMPREPAINT
      case& CDDS_ITEMPOSTPAINT

         if (*lParam.nmcd.dwItemSpec = 50/*first button id*/)
            DrawIconEx(*lParam.nmcd.hdc, 2,5, *this.hIconLogo, 48,14, 0, NULL, DI_NORMAL)
         endif

         return CDRF_NOTIFYPOSTPAINT

   endselect
   return 0


you must check the WM_NOTIFY message - it must be from toolbar, and the notify code must be NM_CUSTOMDRAW. The toolbar must be created with TBSTYLE_CUSTOMERASE style

anorak

many0many-many-many thanks man!
it really works

xandaz

   How does one draw the background? I dont know what message is sent? CDDS_ITEMPREPAINT or CDDS_ITEMPREERASE? Can someone explain? Thanks
   I'm posting this sktchy thingy.
   Ty and laters