CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Location
    Italy
    Posts
    25

    Exclamation Custom Draw --- Listview

    Hi, if i create a window with CreateWindowEx i can in someway use the famous CustomDraw for
    the Listview(don't work with DWL_MSGRESULT because is for dialog....), or i must have only a dialog-box?

    tnx for help

  2. #2
    Join Date
    Jan 2008
    Location
    Earth
    Posts
    60

    Re: Custom Draw --- Listview

    nope, been researching this all day, I know this thread is old and dead, and I'm 7 years too late, lol, but I'll post this here for others to read in the future, since I have found no explanation on the net regarding this issue.

    customdraw sends WM_NOTIFY messages to the PARENT window of the control, and it assumes it's a dialog, so if you use CreateWindowEx, you need to specify the hwnd for a dialog to handle the WM_NOTIFY messages, and check if it's for your control, then post then back to the listview control for processing, it really is a big pain in the rear end, but it's the only way to do it. you also need to send a DWL_MSGRESULT to the dialog to register the return messages of the listview control after processing the custom draw events and figuring a return customdraw value.
    Why did Microsoft assume we would never use custom draw in a control that has no parent dialog, that drives me crazy. What you can do is create a dialog, then create the listview inside of the dialog, and just size it to the entire area of the dialog, it's a shame we have to do it this way.
    Last edited by 12oclocker; December 5th, 2010 at 01:57 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured