marquee progress ctrl on statusbar |
Post Reply |
Author | |
securigy
Groupie Joined: 23 November 2007 Status: Offline Points: 41 |
Post Options
Thanks(0)
Posted: 29 June 2009 at 4:10am |
I am trying to put progress control on the status bar and am using the code from example Statusbar:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct){ return 0; }
void CMainFrame::SetupStatusBarProgress(){ // Create the edit control and add it to the status bar if (!m_ProgressCtrl.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(0,0,0,0), &m_wndStatusBar, 0)) { "Failed to create edit control.\n"); return; } // add the indicator to the status bar.CXTPStatusBarPane* pPane = m_wndStatusBar.AddIndicator(ID_INDICATOR_PROG); // Initialize the pane info and add the control. int nIndex = m_wndStatusBar.CommandToIndex(ID_INDICATOR_PROG);ASSERT (nIndex != -1); pPane->SetCaption(pPane->GetText()); pPane->SetText(_T( ""));m_wndStatusBar.SetPaneWidth(nIndex, 150); m_wndStatusBar.SetPaneStyle(nIndex, m_wndStatusBar.GetPaneStyle(nIndex) | SBPS_NOBORDERS); m_wndStatusBar.AddControl(&m_ProgressCtrl, ID_INDICATOR_PROG, FALSE); // initialize progress control.m_ProgressCtrl.SetRange (0, 100); m_ProgressCtrl.SetPos (0); m_ProgressCtrl.SetStep (1); pPane->SetCustomizationVisible(FALSE); } then, before the long operation starts I call the following function that in normal circumstances produces marquee-style progress bar...void CMainFrame::StartMarqueeProgress(){ // Set the progress control style to PBS_MARQUEE // HWND hWnd = m_ProgressCtrl.GetSafeHwnd(); LONG_PTR dwLong = GetWindowLongPtr(hWnd, GWL_STYLE); LONG_PTR dwNewLong = dwLong | PBS_MARQUEE; dwLong = SetWindowLongPtr(hWnd, GWL_STYLE, (LONG)dwNewLong); // set progress control to blue //DWORD dwColor; CBluetoothControllerApp* pApp = (CBluetoothControllerApp*)AfxGetApp(); if (pApp->IsVista())else
LRESULT lResult = m_ProgressCtrl.SendMessage(PBM_SETBARCOLOR, // message ID// must be 0 dwColor); // normal colorDWORD dwTime; if ( pApp->IsVista() )else
lResult = m_ProgressCtrl.SendMessage( // message ID (WPARAM)TRUE, // set to marqee(LPARAM) dwTime); // time in milisec between updates} I get no results... not only the marquee is not displayed, but nothing is displayed on the status bar... Anything I am doing wrong here?
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |