Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function can be used to take over certain areas of the screen. It is used to modify the taskbar, Input Panelbutton, or Startmenu 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 Startbutton icon to the taskbar.

Note:
Supported only on a Windows Mobile Professional and Windows Mobile Classic.

SHFS_HIDESTARTICON

Hide the Startbutton icon on the taskbar. When the Starticon is hidden, the shell is in a special state in which clicking the taskbar will not display the Startmenu. The taskbar is essentially disabled when in this state. While in this mode, WM_LBUTTONDOWNand WM_LBUTTONUPmessages 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.
Copy Code
#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