CListCtrl question
-
I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. I am using this CCustomCtrl in a dialog box and I have created it dynamically as following: DWORD dwStyle; dwStyle = LVS_REPORT | WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_BORDER | LVS_SINGLESEL ; m_ControllerList.Create(dwStyle, CRect(nLeft, nTop, nRight, nBottom), this, IDC_CONTROLLER_LIST); m_ControllerList.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); Now, I don't have trouble catching any of the messages pertaining to the list within the CDialog class but it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file and I just don't seem to be able to trap them in my dialog class. any ideas?
-
I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. I am using this CCustomCtrl in a dialog box and I have created it dynamically as following: DWORD dwStyle; dwStyle = LVS_REPORT | WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_BORDER | LVS_SINGLESEL ; m_ControllerList.Create(dwStyle, CRect(nLeft, nTop, nRight, nBottom), this, IDC_CONTROLLER_LIST); m_ControllerList.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); Now, I don't have trouble catching any of the messages pertaining to the list within the CDialog class but it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file and I just don't seem to be able to trap them in my dialog class. any ideas?
List control header's ID is zero. If you add handlers with ClassWizard, the message map entry will have control ID of your list, not zero. You'll have to change the ID value in message map or override OnNotify. RK_2000 wrote: I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. You can use custom draw without creating new CListCtrl-based class. Message reflection makes it possible - handler will be created in dialog class and invoked whenever list needs painting. Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
-
I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. I am using this CCustomCtrl in a dialog box and I have created it dynamically as following: DWORD dwStyle; dwStyle = LVS_REPORT | WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_BORDER | LVS_SINGLESEL ; m_ControllerList.Create(dwStyle, CRect(nLeft, nTop, nRight, nBottom), this, IDC_CONTROLLER_LIST); m_ControllerList.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); Now, I don't have trouble catching any of the messages pertaining to the list within the CDialog class but it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file and I just don't seem to be able to trap them in my dialog class. any ideas?
RK_2000 wrote: it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file That's how
WM_NOTIFY
works. A notification sent by a control (in this case, the header) goes to the control's parent (the list). --Mike-- Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm