Click here to Skip to main content
15,913,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: execution time of function increases Pin
Rob 222-May-09 23:01
Rob 222-May-09 23:01 
AnswerRe: execution time of function increases Pin
Hamid_RT22-May-09 23:27
Hamid_RT22-May-09 23:27 
GeneralRe: execution time of function increases Pin
cute_friend707722-May-09 23:35
cute_friend707722-May-09 23:35 
GeneralRe: execution time of function increases Pin
Hamid_RT23-May-09 1:28
Hamid_RT23-May-09 1:28 
GeneralRe: execution time of function increases Pin
ThatsAlok24-May-09 18:38
ThatsAlok24-May-09 18:38 
GeneralRe: execution time of function increases Pin
Hamid_RT25-May-09 0:53
Hamid_RT25-May-09 0:53 
GeneralRe: execution time of function increases Pin
ThatsAlok25-May-09 3:33
ThatsAlok25-May-09 3:33 
QuestionGet active user's desktop resolution from system account. Pin
«_Superman_»22-May-09 16:39
professional«_Superman_»22-May-09 16:39 
AnswerRe: Get active user's desktop resolution from system account. Pin
Garth J Lancaster22-May-09 20:09
professionalGarth J Lancaster22-May-09 20:09 
QuestionMenu and Icon's Pin
BobInNJ22-May-09 11:18
BobInNJ22-May-09 11:18 
AnswerRe: Menu and Icon's Pin
Stuart Dootson22-May-09 11:41
professionalStuart Dootson22-May-09 11:41 
QuestionNeed Help Debugging Program Pin
Ryuk199022-May-09 11:10
Ryuk199022-May-09 11:10 
AnswerRe: Need Help Debugging Program Pin
BobInNJ22-May-09 11:26
BobInNJ22-May-09 11:26 
AnswerRe: Need Help Debugging Program Pin
Stuart Dootson22-May-09 11:33
professionalStuart Dootson22-May-09 11:33 
QuestionViewing Design Pin
Ryuk199022-May-09 10:20
Ryuk199022-May-09 10:20 
AnswerRe: Viewing Design Pin
Stuart Dootson22-May-09 10:34
professionalStuart Dootson22-May-09 10:34 
GeneralRe: Viewing Design Pin
Ryuk199022-May-09 11:13
Ryuk199022-May-09 11:13 
QuestionAlgoritm in C Pin
cstic22-May-09 9:47
cstic22-May-09 9:47 
AnswerRe: Algoritm in C Pin
Garth J Lancaster22-May-09 18:17
professionalGarth J Lancaster22-May-09 18:17 
QuestionGlobal Keyboard hook works for a few seconds... Pin
mcfonseca22-May-09 7:58
mcfonseca22-May-09 7:58 
Questionprogress bar created in the status bar turns up uncovered the pane Pin
HelloDan200922-May-09 7:27
HelloDan200922-May-09 7:27 
Hello Friends!!!

I create a progress bar in the status bar. But that's a still something wrong. The progress bar which should occupied the pane rectangle fail to cover all the rectangle but leave some part uncovered, I can see the progress on the surface and the end part of the IDS_PROGRESS string text uncovered. I don't know how to correct it. If your can offer some help, I will really appreciate it. thanks!

I post the code as follows:

<br />
// Create the status bar<br />
BOOL CMainFrame::CreateStatusBar()<br />
{<br />
    static UINT nIndicators[] = {<br />
        ID_SEPARATOR,<br />
        IDS_PROGRESS,       //the pane for display the progress<br />
        IDS_TIMER,          // show current time <br />
        IDS_INDICATOR_POS,  // display the mouse position<br />
        ID_INDICATOR_LINE,// show the line number the cursor<br />
                           //position in <br />
        ID_INDICATOR_CAPS,<br />
        ID_INDICATOR_NUM<br />
    };<br />
<br />
    if (!m_wndStatusBar.Create (this))<br />
        return FALSE;<br />
<br />
    m_wndStatusBar.SetIndicators (nIndicators, 7);<br />
    return TRUE;<br />
}<br />
<br />
<br />
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)<br />
        return -1;<br />
    <br />
    //<br />
    // Tell the frame window to permit docking.<br />
    //<br />
    EnableDocking (CBRS_ALIGN_ANY);<br />
<br />
    //<br />
    // Create the toolbar, style bar, and status bar.<br />
    //<br />
    if (!CreateToolBar () ||<br />
        !CreateStyleBar ()||!CreateStatusBar())<br />
        return -1;<br />
    //<br />
    // Load the saved bar state (if any).<br />
    //<br />
    LoadBarState (_T ("MainBarState"));  <br />
    <br />
<br />
 //get one pane space to create progress bar <br />
    CRect rect;<br />
    m_wndStatusBar.GetItemRect(1,&rect);<br />
    m_Progress.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH,rect,&m_wndStatusBar,IDS_PROGRESS);<br />
    <br />
<br />
    SetTimer(ID_TIME,500,NULL);  // For update the progress bar<br />
    return 0;<br />
}<br />
<br />
<br />
void CMainFrame::OnPaint() <br />
{<br />
    CPaintDC dc(this); // device context for painting<br />
    <br />
    // TODO: Add your message handler code here<br />
    if(m_Progress.GetSafeHwnd() != NULL)<br />
    {<br />
       CRect rect;<br />
       m_wndStatusBar.GetItemRect(1,&rect);<br />
       m_Progress.MoveWindow(rect);      <br />
    }<br />
    // Do not call CFrameWnd::OnPaint() for painting messages<br />
}<br />
<br />
<br />
void CMainFrame::OnTimer(UINT nIDEvent) <br />
{<br />
    // TODO: Add your message handler code here and/or call default<br />
     CTime time=CTime::GetCurrentTime();<br />
    int nHour=time.GetHour()%12;<br />
     int nMinu=time.GetMinute();<br />
    int nSecond=time.GetSecond();<br />
 <br />
     CString str;<br />
     str.Format(_T("%0.2d:%0.2d:%0.2d"),nHour,nMinu,nSecond);<br />
     if(m_wndStatusBar.GetSafeHwnd() != NULL)<br />
     {<br />
       CClientDC dc(this);    <br />
       CSize sz=dc.GetTextExtent("22:22:22");<br />
       m_wndStatusBar.SetPaneInfo(2,IDS_TIMER,SBPS_NORMAL,sz.cx);<br />
       m_wndStatusBar.SetPaneText(2,str); <br />
     }<br />
    <br />
    if(m_Progress.GetSafeHwnd() == NULL)<br />
    {<br />
      CRect rect;<br />
      m_wndStatusBar.GetItemRect(1,&rect);<br />
      m_Progress.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH,rect,&m_wndStatusBar,IDS_PROGRESS);<br />
      m_Progress.SetRange(0,100);<br />
      m_Progress.SetPos(0);<br />
    }<br />
    m_Progress.StepIt();<br />
<br />
    CFrameWnd::OnTimer(nIDEvent);<br />
}<br />
<br />

QuestionDoes Postmessage/SendMessage require a Message Map entries Pin
ForNow22-May-09 6:38
ForNow22-May-09 6:38 
AnswerRe: Does Postmessage/SendMessage require a Message Map entries Pin
led mike22-May-09 8:37
led mike22-May-09 8:37 
GeneralRe: Does Postmessage/SendMessage require a Message Map entries Pin
ForNow22-May-09 10:50
ForNow22-May-09 10:50 
GeneralRe: Does Postmessage/SendMessage require a Message Map entries Pin
«_Superman_»22-May-09 16:21
professional«_Superman_»22-May-09 16:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.