[C++ Win32 API] Progress Bar - Set postion for Marquee Style

I have a progress bar that has a PBS_MARQUEE style, but when I set the position it doesn't change, it will just stop.

Here's how I'm changing the position:

1
2
3
4
void SetBarPosition (int iNewPosition)
{
	SendMessage (hLoadingBar, PBM_SETPOS, iNewPosition, 0);
}


I even tried:

 
SendMessage (hLoadingBar, PBM_SETMARQUEE, (WPARAM) false, (LPARAM) 0);


And it just stops the marque bar, but doesn't set the position to 0.

How would you go about changing the position of a marquee progress bar? Or just make the "scroller" invisible.

Thanks in advanced.
Last edited on
There are a few things:

-InitCommonControls();?

-Have you set the range of the progress bar e.g:
SendMessage(HWND hWnd, PBM_SETRANGE, 0, MAKEPARAM(int nMin, int nMax);?

-A lot of sites say to use the PBM_SETSTEP & PBM_STEPIT messages? Have you looked into using those instead?

It also might be easier to trouble shoot if you post up the code so we can have a look at it.

Here are some links you might find useful:

-This is the MSDN article on Progress Bars: http://msdn.microsoft.com/en-us/library/bb760816%28v=vs.85%29.aspx

I don't know if you've checked the MSDN on PBS_SETPOS, so I'll include that too: http://msdn.microsoft.com/en-us/library/bb760844%28v=vs.85%29.aspx

MSDN on PBM_SETSTEP: http://msdn.microsoft.com/en-us/library/bb760852%28v=VS.85%29.aspx

MSDN on PBM_STEPIT: http://msdn.microsoft.com/en-us/library/bb760853%28v=VS.85%29.aspx

I found this thread in the MSDN: http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/5e0a1958-2935-44db-81b8-b9863c599997

Also in the mean time you might find this tutorial, helpful: http://www.functionx.com/win32/controls/ProgressBars.htm

If you don't find what your looking for, you might have more luck if you ask in the MSDN Forums.

I hope this helps.
Last edited on
Thanks for all the information, most of it I've seen before, but the rest was helpful.

I got it to work with Get/SetWindowLong functions, by setting the styles to allow marquee, or to just be a standard progress bar. After I set it to a standard progress bar I set the position to 0.

Worked perfectly :)
Last edited on
Topic archived. No new replies allowed.