声明进度条对象
CProgressCtrl m_wndProgress;
创建按钮对象
//* 进度条
CRect rectClient;
rectClient.left = 10;
rectClient.top = 10;
rectClient.right = 200;
rectClient.bottom = 18;
if (!m_wndProgress.Create(WS_CHILD | WS_VISIBLE | PBS_SMOOTH, rectClient, this, 6))
{
TRACE0("Failed to create progress control.");
return -1;
}
m_wndProgress.SetRange(0, 100);
m_wndProgress.SetPos(37);
m_wndProgress.SetStep(0);
m_wndProgress.StepIt();
m_wndProgress.ShowWindow(SW_SHOWNORMAL);
m_wndProgress.MoveWindow(rect.left, rect.top, rect.right, rect.bottom);//* 注意:此处同样可以使用SetWindowPos()来调整位置及大小