How I get the Header HDC of listview in custom draw?
-
I want to customize the header of a listview, so in NM_CUSTOMDARW i have
Test = (LPNMLVCCUSTOMDARW)Lp <nmcd.hdc)
which for the listview without the header, i tried using
Test = (LPNMCUSTOMDARW)Lp <
and thenTest->hdr.hwndFrom
so
if(Test->hdr.hwndFrom == listview_getheader(LIST))
but it does not work, the listview_getheader(LIST) gives the right hwnd, but how about Test->hdr.hwndFrom, it seems i missed something...
-
I want to customize the header of a listview, so in NM_CUSTOMDARW i have
Test = (LPNMLVCCUSTOMDARW)Lp <nmcd.hdc)
which for the listview without the header, i tried using
Test = (LPNMCUSTOMDARW)Lp <
and thenTest->hdr.hwndFrom
so
if(Test->hdr.hwndFrom == listview_getheader(LIST))
but it does not work, the listview_getheader(LIST) gives the right hwnd, but how about Test->hdr.hwndFrom, it seems i missed something...
-
I want to customize the header of a listview, so in NM_CUSTOMDARW i have
Test = (LPNMLVCCUSTOMDARW)Lp <nmcd.hdc)
which for the listview without the header, i tried using
Test = (LPNMCUSTOMDARW)Lp <
and thenTest->hdr.hwndFrom
so
if(Test->hdr.hwndFrom == listview_getheader(LIST))
but it does not work, the listview_getheader(LIST) gives the right hwnd, but how about Test->hdr.hwndFrom, it seems i missed something...
The header control is a child window of a list. If you want to customize the header, you must use owner drawing for the header itself. When using MFC, derive a
CHeaderCtrl
class and implement the virtualDrawItem()
handler. To connect this header control class to your list, use subclassing. To enable owner drawing of header items, set theHDF_OWNERDRAW
flag for the header items. See Deriving a Custom CHeaderCtrl in the Using the Header Control[^] article. This example contains complete implementation code including theDrawItem()
function: http://www.codeguru.com/cpp/controls/listview/sorting/article.php/c977/Indicating-sort-order-in-header-control.htm[^]. -
The header control is a child window of a list. If you want to customize the header, you must use owner drawing for the header itself. When using MFC, derive a
CHeaderCtrl
class and implement the virtualDrawItem()
handler. To connect this header control class to your list, use subclassing. To enable owner drawing of header items, set theHDF_OWNERDRAW
flag for the header items. See Deriving a Custom CHeaderCtrl in the Using the Header Control[^] article. This example contains complete implementation code including theDrawItem()
function: http://www.codeguru.com/cpp/controls/listview/sorting/article.php/c977/Indicating-sort-order-in-header-control.htm[^]. -
JoneLe86 wrote:
Test = (LPNMCUSTOMDARW)Lp <<lparam
What is
Test
and what is its value, and that oflp
, after this statement?Use the best guess