Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling Double CLicks from CHeaderCtrl

Status
Not open for further replies.

solla

Programmer
Feb 21, 2003
19
FR
Hello,

I have an app where the user has the option to block resizing of the columns in a list control.
To do this, I have made the list control handle messages from the embedded header control:

ON_NOTIFY(HDN_BEGINTRACK, 0, OnColumnTrackBegin)
ON_NOTIFY(HDN_DIVIDERDBLCLICK, 0, OnColumnDoubleClick)

The handlers look like this:

void MyListCtrl::OnColumnTrackBegin(
NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = m_bFieldSizingAllowed ? 0 : 1;
}
void MyListCtrl::OnColumnDoubleClick(
NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = m_bFieldSizingAllowed ? 0 : 1;
}

This works fine for the OnColumnTrackBegin (i.e. the user cannot resize the columns if bFieldSizingAllowed = FALSE

However, this does not work for the double click. Whether bFieldSizingAllowed = TRUE or FALSE, processing does not continue and the double click does nothing.

Am I doing something wrong? I don't want to have to think about sub-classing the header control if at all possible!

Thanks for any help,

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top