Share via


SHFullScreen

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function can be used to take over certain areas of the screen. It is used to modify the taskbar, Input Panel button, or Start menu icon.

Syntax

BOOL SHFullScreen(
  HWND hwndRequester,
  DWORD dwState
);

Parameters

  • hwndRequester
    [in] Handle to the top-level window requesting the full-screen state. If you are using one of the SHFS_HIDE* flags, this window must be the foreground window or the function will fail.
  • dwState
    [in] Specifies the state of the window. The following table shows the possible values for this parameter.

    State Description

    SHFS_SHOWTASKBAR

    Return the taskbar to its topmost state.

    SHFS_HIDETASKBAR

    Put the taskbar at the bottom of the z-order. Note that a game or an application that requires the entire screen may use this flag. Be sure that your application is sized to full screen before using this flag. Otherwise, it will appear as though the function did nothing.

    SHFS_SHOWSIPBUTTON

    Returns the Input Panel button to its visible state.

    > [!NOTE] > Supported only on a Windows Mobile Professional and Windows Mobile Classic.

    SHFS_HIDESIPBUTTON

    Hides the Input panel button.

    > [!NOTE] > Supported only on a Windows Mobile Professional and Windows Mobile Classic.

    SHFS_SHOWSTARTICON

    Return the Start button icon to the taskbar.

    > [!NOTE] > Supported only on a Windows Mobile Professional and Windows Mobile Classic.

    SHFS_HIDESTARTICON

    Hide the Start button icon on the taskbar. When the Start icon is hidden, the shell is in a special state in which clicking the taskbar will not display the Start menu. The taskbar is essentially disabled when in this state. While in this mode, WM_LBUTTONDOWN and WM_LBUTTONUP messages will be forwarded to hwndRequester. This allows an application to drop out of this mode by calling this function with the SHFS_SHOWSTARTICON state when the user clicks the taskbar.

    > [!NOTE] > Supported only on a Windows Mobile Professional and Windows Mobile Classic.

Return Value

This function returns TRUE if it is successful and FALSE if it fails.

Code Example

The following code example demonstrates how to use SHFullScreen.

Note

To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.

#include <aygshell.h>
LRESULT CALLBACK SHFullScreenWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static fFullScreen = FALSE;
    switch (message)
    {
        case WM_KEYDOWN:
        {
            // Toggle between full screen and normal mode when the user presses the space bar.
            if (VK_SPACE == wParam)
            {
                DWORD dwState;
                RECT rc;
                if (fFullScreen)
                {
                    // To switch to normal mode, first show all of the shell parts.
                    dwState = (SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
                    SHFullScreen(hwnd, dwState);
                    // Next resize the main window to the size of the work area.
                    SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, FALSE);
                    MoveWindow(hwnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE);
                    fFullScreen = !fFullScreen;
                }
                else
                {
                    // To switch to full screen mode, first hide all of the shell parts.
                    dwState = (SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
                    SHFullScreen(hwnd, dwState);
                    // Next resize the main window to the size of the screen.
                    SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
                    MoveWindow(hwnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE);
                    fFullScreen = !fFullScreen;
                }
            }
        }
        break;
    }
    return DefWindowProc(hwnd, message, wParam, lParam);
}

Requirements

Header shellsdk.h
Library aygshell.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2000 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also

Reference

WM_LBUTTONDOWN
WM_LBUTTONUP