none
Issue hiding the command/menu bar RRS feed

  • Question

  • Hello Gentlemen,

    Platform Builder application needs to go full screen thus the scroll bars, taskbar and menu bar are required to hide.

    With the code below, I can successfully hide the scrolling bars and the taskbar but I couldn't figure out how to hide the command/menu bar. I looked all over the internet and tried several suggestions but they don't seem to work for me.

    This is the code that creates the toolbar:

    {

    HWND hwndToolbar = CreateToolbarEx(m_hwnd1,
    WS_VISIBLE|
    WS_CHILD | TBSTYLE_TOOLTIPS | 
    WS_CLIPSIBLINGS | TBSTYLE_FLAT,
    ID_TOOLBAR, 12, m_pApp->m_instance,
    IDB_BITMAP1, but, numButtons, 0, 0, 0, 0, sizeof(TBBUTTON));

    //CAS - CE doesn't have a system menu, so instead create an "Options" menu and put all the menu items there.
    m_hMenuBar=CreateMenu();
    m_hSysMenu= CreatePopupMenu();
    AppendMenu(m_hMenuBar,MF_POPUP|MF_STRING,(UINT)m_hSysMenu,_T("&Options"));

    CommandBar_InsertMenubarEx(hwndToolbar,0,(LPTSTR)m_hMenuBar,0);

    if (hwndToolbar != NULL)
    SendMessage(hwndToolbar, TB_SETINDENT, 4, 0);

    CommandBar_AddAdornments(hwndToolbar, 0, 0);

    return hwndToolbar;

    }

    hwndToolbar is saved to a global m_hToolbar.

    And this is the code to go full screen but the Toolbar isn't hiding I don't know why:

    {

                if(CommandBar_IsVisible(m_hToolbar))
                {
                    GMPRINTF(Toolbar check VISIBLE); // indicates it is visible
                }
                else
                {
                    GMPRINTF(Toolbar check INVISBLE);
                }

       GMPRINTF(hide Toolbar);
       //ShowWindow(m_hToolbar, SW_HIDE);
       CommandBar_Show(m_hToolbar, false);

       if(CommandBar_IsVisible(m_hToolbar))
       {
           GMPRINTF(Toolbar is still VISIBLE);
       }
       else
       {
           GMPRINTF(Toolbar should be INVISBLE); // I'm seeing this printf, it is telling me it is invisble but it is NOT!!!
       }


    EnableMenuItem(GetSystemMenu(m_hwnd1, FALSE), ID_TOOLBAR, MF_BYCOMMAND|MF_GRAYED);
    ShowWindow(m_hwnd1, SW_MAXIMIZE);

    style = GetWindowLong(m_hwnd1, GWL_STYLE);
    style &= ~(WS_DLGFRAME | WS_THICKFRAME | WS_BORDER);
    SetWindowLong(m_hwnd1, GWL_STYLE, style);

    int cx = GetSystemMetrics(SM_CXSCREEN);
    int cy = GetSystemMetrics(SM_CYSCREEN);
    SetWindowPos(m_hwnd1, HWND_TOPMOST, 0, 0, cx, cy, SWP_FRAMECHANGED);

    }

    Please any ideas are greatly appreciated and have a great day!

    Gil




    • Edited by gilmotta Thursday, March 27, 2014 6:05 PM
    Thursday, March 27, 2014 3:32 PM

All replies

  • Following is the reg setting required to hide the taskbar and menubar 

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop]
    "Default"=dword:0
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide]
    "Default"=dword:1

    Can you try and see if this resolves your problem.

    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Tuesday, April 1, 2014 7:33 AM
  • http://geekswithblogs.net/BruceEitman/archive/2010/08/06/windows-ce-setting-an-application-to-display-full-screen-in.aspx

    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Tuesday, April 1, 2014 12:38 PM
    Moderator