Menu

Bug with verticall scrollbar

2014-08-18
2014-08-20
  • MetalGearCreamy

    MetalGearCreamy - 2014-08-18

    Hi, David. I found your framework and samples really cool, good job! I have just started to learn winapi, so i failed to fix this myself, but this should be easy:
    When I resize window so scrollbars become visible, for example like here:
    https://www.dropbox.com/s/q1pcbackx1l9qnq/Capture1.PNG
    and then maximize the window, vertical scrollbar is still visible:
    https://www.dropbox.com/s/40u6nljzvve99f4/Capture2.PNG
    It happens both in "FastGDI" and "Picture".

     
  • David

    David - 2014-08-20

    Hi,

    Thanks for bringing this to my attention. Sometimes the view window isn't redrawn correctly when the app is maximized. Add the following code to CMainFrame to redraw the view window correctly.

    LRESULT CMainFrame::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
        switch (uMsg)
        {
            case WM_SIZE:
            {
            // Remove scrollbars and redraw the view if the frame is maximized
                if (wParam == SIZE_MAXIMIZED)
                {
                    GetView()->ShowScrollBar(SB_BOTH, FALSE);
                    GetView()->Invalidate();
                }
    
                break;
            }
        }
    
        // pass unhandled messages on for default processing
        return WndProcDefault(uMsg, wParam, lParam);
    }
    

    Best regards,
    David

     

Log in to post a comment.