Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Statusbars

  • 13-07-2004 8:37am
    #1
    Registered Users, Registered Users 2 Posts: 1,368 ✭✭✭


    Ok,

    I've added a statusbar to my Win32 app as follows:

    hStatusBar = CreateStatusWindow( WS_BORDER|WS_CHILD | WS_VISIBLE, NULL,hwnd,(UINT)IDC_STATUS_BAR );

    SendMessage(hStatusBar,SB_SETPARTS,5,(LPARAM)iStatusWidths);
    //print out the results strings

    sprintf(sb_freq,"Frequency: %d",(int)ref_freq);

    sprintf(sb_ref_amp,"Channel 1 Amp: %d",(int)ref_amp);

    sprintf(sb_las_amp,"Channel 1 Amp: %d",(int)las_amp);

    //create the statusbar SendMessage(hStatusBar,SB_SETTEXT,0,(LPARAM)" For Help press F1");
    SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)sb_freq);
    SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)sb_ref_amp);
    SendMessage(hStatusBar,SB_SETTEXT,3,(LPARAM)sb_las_amp);

    ========================================
    That code works fine, however I'm having problems updating the statusbar else where:

    For example, just as a test I tried updating the statusbar everytime the window was resized:

    case WM_SIZE:

    //change panel 0's message
    SendMessage(hStatusBar,SB_SETTEXT,0,(LPARAM)" For Help press F2");
    InvalidateRgn(hwnd, NULL, TRUE);
    break;

    bot nothing happens. I thought invalidateRgn would call WM_Paint and the new text would be written to the status bar. I 've also tried using SendMessage to call WM_PAint, but this also doesnt work....


    Any ideas??

    Thanks,
    Martin


Comments

Advertisement