Implementing Full-Screen Mode


Application Security Testing: An Integral Part of DevOps

Full Screen mode is widely used in programs such as Word, VisualC, Corel Draw etc. If you take a closer look on the these implementations you will notice that they solve this problem differently.

Below you will find an example for this problem. I have used it in my editor program ( MyLight ) for a long time. This application has been tested under Windows 9x and Windows NT.

So use it if you like. The only thing I recommend is that name me in your product.


Download demo project - 22 Kb



  • Complete Full Screen

    Posted by Legacy on 10/10/2003 12:00am

    Originally posted by: Tim Millar

    The borders that appear when making a full-screen MFC
    application are also set by the view currently inside
    the frame window.

    To make them disappear, override the PreCreateWindow
    method in the view class and add the following line
    of code before exiting the method:

    cs.dwExStyle &= ~WS_EX_CLIENTEDGE;

    (Why doesn't Microsoft document these things?)

  • small bug

    Posted by Legacy on 06/11/2001 12:00am

    Originally posted by: Jeff

    delete m_pFullScreenBar;
    m_pFullScreenBar=NULL; // I think this is important

  • Neat Solution!!

    Posted by Legacy on 04/16/2001 12:00am

    Originally posted by: kajal

    Thankyou. It was of help. With the Hiding of Menu, it was just what I was looking for.

  • How to hide the menu in full screen mode ?

    Posted by Legacy on 10/17/2000 12:00am

    Originally posted by: wdf2

    How to hide the menu in full screen mode ? Not destroy it,
    just hide it in it's original position,and if you press
    "ALT+F" ,then the "File" Menu appears,just like the VC platform do.

  • Border Still shows

    Posted by Legacy on 02/12/2000 12:00am

    Originally posted by: Michael Malinak

    When in "Full-Screen" mode there is still a white border along the bottom and right hand side of the screen. For true full-screen this should be removed also. I have been trying unsuccessfully to remove it though.
    Any Hints?

  • FullScreen for 1 SDI view

    Posted by Legacy on 10/07/1999 12:00am

    Originally posted by: Marcel

    I want full screen for only one view of multiple-view splitter based SDI app. Anyone out there done that?

    Please show me.

  • How about hiding the scrool bar in Full Screen mode?

    Posted by Legacy on 09/09/1999 12:00am

    Originally posted by: curious

    How about hiding the scrool bar in Full Screen mode?

  • Small bug on multimon system

    Posted by Legacy on 08/16/1999 12:00am

    Originally posted by: Paul Bludov

    SetWindowPos(NULL, -4, -4, screenX+4, screenY+4) will show border on all other monitors. It sounds like you should maximize mainframe window. When a window maximized, it has no border.

  • Switch from Full Screen to Normal on ESC key

    Posted by Legacy on 07/28/1999 12:00am

    Originally posted by: skywalker

    In Full screen mode if you want to handle ESC key to switch to Normal mode add follwing code to you CMainFrame.

    Override PreTranslateMessage. You could do this using Class Wizard.

    Add Following code to PreTranslateMessage function

    BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
    if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE
    && m_bFullScreenMode)
    return CMDIFrameWnd::PreTranslateMessage(pMsg);

  • Small changes to handle floating toolbars

    Posted by Legacy on 07/21/1999 12:00am

    Originally posted by: P�l K. T�nder

    The suggested code does not handle floating toolbars well, and also there is some flickering connected with the dynamically created toolbar. Here are the methods FullScreenModeOn and FullScreenModeOff with the suggested
    changes. My additions are commented starting with PKT.

    void CMainFrame::FullScreenModeOn()
    // available only if there is an active doc
    CMDIChildWnd* pChild=MDIGetActive();
    if(!pChild) return;
    // PKT: ShowControlBar used instead of ShowWindow
    // because this also handles floating toolbars
    ShowControlBar(&m_wndToolBar, FALSE, FALSE );
    // PKT: ShowControlBar used instead of ShowWindow
    // because this also handles floating toolbars
    ShowControlBar(&m_wndStatusBar, FALSE, FALSE );
    // now save the old positions of the main and child windows
    // remove the caption of the mainWnd:
    LONG style=::GetWindowLong(m_hWnd,GWL_STYLE);
    int screenx=GetSystemMetrics(SM_CXSCREEN);
    int screeny=GetSystemMetrics(SM_CYSCREEN);
    // resize:
    m_bChildMax=(style & WS_MAXIMIZE)?true:false;
    // note here: m_bMainMax is not needed since m_hWnd only
    // changed its caption...

    // and maximize the child window
    // it will remove its caption, too.
    // PKT: Moved it down to avoid some flickering

    // Create the new toolbar
    // this will contain the full-screen off button
    m_pwndFullScreenBar=new CToolBar;
    m_pwndFullScreenBar->SetBarStyle(m_pwndFullScreenBar->GetBarStyle() |
    // to look better:
    m_pwndFullScreenBar->ModifyStyle(0, TBSTYLE_FLAT);
    // place the full-screen off button somewhere:
    CPoint pt(screenx-100,50);



    void CMainFrame::FullScreenModeOff()
    // You can use SaveBarState() in OnClose(),
    // so remove the newly added toolbar entirely
    // in order SaveBarState() not
    // to save its state. That is why I used dynamic
    // allocation
    delete m_pwndFullScreenBar;
    LONG style=::GetWindowLong(m_hWnd,GWL_STYLE);
    // PKT: ShowControlBar used instead of ShowWindow
    // because this also handles floating toolbars
    ShowControlBar(&m_wndToolBar, TRUE, FALSE );
    // PKT: ShowControlBar used instead of ShowWindow
    // because this also handles floating toolbars
    ShowControlBar(&m_wndStatusBar, TRUE, FALSE );
    CMDIChildWnd* pChild=MDIGetActive();
    // pchild can be NULL if the USER closed all the
    // childs during Full Screen Mode:
    else MDIRestore(pChild);

  • Loading, Please Wait ...

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.