Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 374313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:23:36+00:00 2026-05-12T14:23:36+00:00

I am having a bit of a problem when handling a HDN_ENDTRACKW message for

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:23:37+00:00Added an answer on May 12, 2026 at 2:23 pm

    Use the information that HDN_ENDTRACK itself provides to you, ie:

    void ProgListCtrl::OnEndTrack(NMHDR* pNMHDR, LRESULT* pResult)
    {
        NMHEADER *pHdr = (NMHEADER*) pNMHDR;
        if ((pHdr->iItem == m_nProgressColumn) &&
            (pHdr->pitem) &&
            (pHdr->pitem->mask & HDI_WIDTH))
        {
            int width = pHdr->pitem->cxy;
            ResizeProgressbar();
        }
    }
    

    Alternatively, look at the HDN_ITEMCHANGING and HDN_ITEMCHANGED notifications instead of HDN_ENDTRACK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a bit weird problem with WinForm which seems to refuse to close
I'm handling large 64 bit unsigned integers from a JSON source which are being
I'm having a bit of a problem with Web Deploy I just can't seem
I'm having a bit of a problem normalizing a UPC string code so that
I'm having a bit of a problem getting my custom JavaScript file to play
I'm having a bit of a problem. We have our own CMS which is
I'm having a bit of a problem keeping values from appearing in scope for
I'm having a bit of a problem with a very weird side effect that's
Having a bit of a problem, Due to the source-control set-up we use, each
Having a bit of a problem creating an instance of an object. Bear in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.