Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. NM_CUSTOMBAR returns void, how to use it correctly

NM_CUSTOMBAR returns void, how to use it correctly

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bilas
    wrote on last edited by
    #1

    I use custombar for CTreeView, but I need to return values like in following code void CMyTree::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult) { LPNMCUSTOMDRAW pNMCD = reinterpret_cast(pNMHDR); // TODO: Add your control notification handler code here LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW)pNMCD; if(lptvcd==NULL) { return -1; } switch(lptvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: return CDRF_NOTIFYITEMDRAW; case CDDS_ITEMPREPAINT: CString* cv = new CString("orange"); lptvcd->clrText = (DWORD)cv; return CDRF_NOTIFYSUBITEMREDRAW; } How to use this function correctly? Thanks in advance, alex:confused:

    M 1 Reply Last reply
    0
    • B bilas

      I use custombar for CTreeView, but I need to return values like in following code void CMyTree::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult) { LPNMCUSTOMDRAW pNMCD = reinterpret_cast(pNMHDR); // TODO: Add your control notification handler code here LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW)pNMCD; if(lptvcd==NULL) { return -1; } switch(lptvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: return CDRF_NOTIFYITEMDRAW; case CDDS_ITEMPREPAINT: CString* cv = new CString("orange"); lptvcd->clrText = (DWORD)cv; return CDRF_NOTIFYSUBITEMREDRAW; } How to use this function correctly? Thanks in advance, alex:confused:

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      bilas wrote: CString* cv = new CString("orange"); lptvcd->clrText = (DWORD)cv; That code is using the wrong data types. You need to assign a COLORREF, not a string. Look up COLORREF and the RGB macro in MSDN. --Mike-- LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups