none
Make Program Full Screen / Hide Bottom Taskbar RRS feed

  • Question

  • Our program uses the following code to make it full screen on PPC 2003, however, for WM5.0 the m_pWndEmptyCB member of CDialog no longer exists. Is there a way to get the handle to the bottom taskbar so it can be hidden?

        SHFullScreen(GetSafeHwnd(), SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON|SHFS_HIDESTARTICON);
        ::CommandBar_Show(m_pWndEmptyCB->m_hWnd,false);
        if(m_pWndEmptyCB->m_hWnd)
        {
            ::CommandBar_Destroy(m_pWndEmptyCB->m_hWnd);
            m_pWndEmptyCB->m_hWnd = NULL;
        }
        MoveWindow(0,0,240,320);
    Wednesday, November 23, 2005 5:04 PM

Answers

  • Hi,

    Which version if MFC/VS are you using? In MFC 8.0, for PPC devices, user is supposed to control the creation and insertion of commandbar in CDialog, therefore the m_pWndEmptyCB member has been removed. 

    To make the dialog window fullscreen use ::SHInitiDialog with SHIDIF_FULLSCREENNOMENUBAR flag.To hide the commandbar use ::SHFindMenuBar to get a handle to the attached menubar and then hide it with ::ShowWindow function. This shall hide the command bar.  This works for both PPC 2003 and WM 5.0 PPC.

    In case you still want to differentiate between the two platforms at compile time use _WIN32_WCE flag to get the CE version and take a decision accordingly. For WM 5.0 PPC the value is 0x501 while for PPC 2003 it is 0x420. A check like ( _WIN32_WCE > 0x500) should serve the purpose.

    I hope this helps. Some Useful links are

    http://support.microsoft.com/default.aspx?scid=kb;%5Bln%5D;266244 , http://msdn2.microsoft.com/library/ew94tebd.aspx.

    Thanks

    Sunday, November 27, 2005 3:37 PM

All replies

  • Hi,

    Which version if MFC/VS are you using? In MFC 8.0, for PPC devices, user is supposed to control the creation and insertion of commandbar in CDialog, therefore the m_pWndEmptyCB member has been removed. 

    To make the dialog window fullscreen use ::SHInitiDialog with SHIDIF_FULLSCREENNOMENUBAR flag.To hide the commandbar use ::SHFindMenuBar to get a handle to the attached menubar and then hide it with ::ShowWindow function. This shall hide the command bar.  This works for both PPC 2003 and WM 5.0 PPC.

    In case you still want to differentiate between the two platforms at compile time use _WIN32_WCE flag to get the CE version and take a decision accordingly. For WM 5.0 PPC the value is 0x501 while for PPC 2003 it is 0x420. A check like ( _WIN32_WCE > 0x500) should serve the purpose.

    I hope this helps. Some Useful links are

    http://support.microsoft.com/default.aspx?scid=kb;%5Bln%5D;266244 , http://msdn2.microsoft.com/library/ew94tebd.aspx.

    Thanks

    Sunday, November 27, 2005 3:37 PM
  • How do I make it work for WinCE 6.0 platform which I am using?

     

     

    Below is the code I used in my application,but results in error.

    BOOL CAdvanSedDlg:SurprisenInitDialog()

       BOOL m_bFullScreen;
       m_bFullScreen = FALSE;
       CDialog:SurprisenInitDialog();

      

     // Call SHInitDialog with flags for full screen.
       SHINITDLGINFO shidi;

       shidi.dwMask = SHIDIM_FLAGS;
       shidi.dwFlags = SHIDIF_FULLSCREENNOMENUBAR;
       shidi.hDlg = m_hWnd;
       SHInitDialog(&shidi);

      

    // Set the icon for this dialog box. The framework does this automatically
       //  when the application's main window is not a dialog box.
       SetIcon(m_hIcon, TRUE);   // Set big icon.
       SetIcon(m_hIcon, FALSE);  // Set small icon.

     

       ::CommandBar_Show(m_pWndEmptyCB->m_hWnd, FALSE);  //results BUILD ERROR-see below for error details//
      

    // SHFullScreen fails if dialog box is not foreground.
       SetForegroundWindow(); 
       SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);

      

    // Resize the window over the taskbar area.
    #define MENU_HEIGHT 26
       RECT rect;
       GetWindowRect(&rect);
       rect.top -= MENU_HEIGHT;
       MoveWindow(&rect, TRUE);


    return TRUE;  }

     

    BUILD ERROR :

     

     \AdvanSedDlg.cpp(172) : error C2039: 'm_pMainWnd' : is not a member of 'HWND__'
            C:\Program Files\Windows CE Tools\wce420\STANDARDSDK_420\Include\emulator\windef.h(213) : see declaration of 'HWND__'
    Error executing cl.exe.

    AdvanSedDlg.obj - 1 error(s), 0 warning(s)

    Friday, April 4, 2008 6:58 AM

  • void showTaskBar( int bShow )
    {
        HWND hWndTaskBar = FindWindow( TEXT("HHTaskBar"), NULL );

        if (!hWndTaskBar)
        {
            return;
        }

        if (bShow)
        {
            if (!IsWindowVisible( hWndTaskBar ))
            {
                ShowWindow( hWndTaskBar, SW_SHOWNORMAL );
            }

            if (!IsWindowEnabled( hWndTaskBar ))
            {
                EnableWindow( hWndTaskBar, TRUE );
            }

            InvalidateRect( hWndTaskBar, NULL, TRUE );
            UpdateWindow( hWndTaskBar );
        } else if (IsWindowVisible( hWndTaskBar ))
        {
            ShowWindow( hWndTaskBar, SW_HIDE );
        }
    }

    Friday, April 4, 2008 8:22 AM