Hello Stack Overflow. I am having a bit of a problem when handling a HDN_ENDTRACKW message for a custom class which derives from CListCtrl .
Essentially, it seem that when this message is sent, the actual value which stores the width of the column is not updated until after my handling code has been executed.
The code inside the handle simply instructs a progress bar to resize, to fill the width of the resized column. The code:
void ProgListCtrl::OnEndTrack(NMHDR* pNMHDR, LRESULT* pResult)
{
int width = ListView_GetColumnWidth(GetSafeHwnd(), m_nProgressColumn);
ResizeProgressbar();
}
The ListView_GetColumnWidth is there just to help with debugging at the moment.
The default value for the particular column I am changing is 150, when i resize the column in the UI, this method is called but the width stays at the same 150, the progress bar does not resize. Only when a column is resized again does the width value now reflect the value of the column after the first resize, the ResizeProgressBar method then correctly changes the progbar size to fill the column it is in. This is continuous, the width value always seems to be one step behind the actual value.
I would apreciate any help. Cheers.