PBS_MARQUEE Progressbar WinApi

I'm trying to get a progress bar of the type PBS_MARQUEE working. I can create the progress bar, but i just can't manage it to make it moving.

If found this, but i don't understand clearly what i have to do:

"Turns out since i had the progress bar as a resource instead of using the CreateWindowEx(..) i had to use SetWindowLongPtr(..) to set the PBS_MARQUEE style for this control..."

I create the progressbar that way:

   hwndPB = CreateWindowEx(0, PROGRESS_CLASS,
                            (LPSTR)NULL, WS_CHILD | WS_VISIBLE | PBS_MARQUEE ,
                            rcClient.left,
                            rcClient.bottom - cyVScroll,
                            rcClient.right, cyVScroll,
                            hwnd, (HMENU) 0, NULL, NULL);

Then i try to make it working:

    SetWindowLongPtr(hwndPB,GWL_STYLE,PBS_MARQUEE);
    SendMessage(hwndPB,(UINT) PBM_SETMARQUEE,(WPARAM) 1,(LPARAM)NULL );

Thx & regards

5
задан sambob 15 April 2011 в 19:32
поделиться