002
30.07.2003, 13:51 Uhr
~mutu
Gast
|
hallo!
habe in www.codeguru.com/listview/index.shtml etwas gefunden! klappt jedoch noch nicht...
Original-Code: "The header control in the ListView control sends notification to the parent window (e.i. the ListView) before it begins resizing a column. We can override the OnNotify() function in the CListCtrl derived class to handle this notification. The code below prevents resizing of all columns. Note that the resize cursor still shows up. "
BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { switch (((NMHDR*)lParam)->code) { case HDN_BEGINTRACKW: case HDN_BEGINTRACKA: *pResult = TRUE; // disable tracking return TRUE; // Processed message } return CListCtrl::OnNotify(wParam, lParam, pResult); }
mein Code:
Header: ... virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) ; ...
Source: ... BEGIN_MESSAGE_MAP(CMyClass, CDialog) ... ON_NOTIFY( LVN_COLUMNCLICK, IDC_LSTCTRL, OnNotify ) ... END_MESSAGE_MAP()
BOOL CMyClass::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { switch (((NMHDR*)lParam)->code) { case HDN_BEGINTRACKW: case HDN_BEGINTRACKA: *pResult = TRUE; // disable tracking return TRUE; // Processed message } return CMyClass::OnNotify(wParam, lParam, pResult); }
irgendwie stimmt die Message ON_NOTIFY() noch nicht, wenn eine spalte in ihrer größe verändert wird/werden soll ... eine idee? |