You have to remove the ProgressBar's PBS_MARQUEE
window style, such as with CWnd::ModifyStyle()
, before you can then change the position to whatever value you want. Enable the PBS_MARQUEE
style only when you are in marque mode, and disable it when not.
void CCProgressCtrl_s1Dlg::OnSetmarqueeOn()
{
m_progressCtrl.ModifyStyle(0, PBS_MARQUEE);
m_progressCtrl.SetMarquee(TRUE, nMarqueeInterval);
}
void CCProgressCtrl_s1Dlg::OnSetmarqueeOff()
{
m_progressCtrl.SetMarquee(FALSE, nMarqueeInterval);
m_progressCtrl.ModifyStyle(PBS_MARQUEE, 0);
m_progressCtrl.SetPos(0);
}