From YYpBD's MediaWiki
The SDK for Windows Mobile-based devices provides the SHFullScreen function to give your application full control over the screen. The Win32 sample HTMLHost demonstrates how to use SHFullScreen in your application.
Note If you require even more control over the display than the SHFullScreen function provides, the Game API allows full programmatic access to the display buffer.
The following code demonstrates how to call SHFullScreen from within the MFC InitInstance function.
Example:
Copy CodeBOOL rb;
BOOL chgScreen;
int rc;
RECT rect;
HWND hWnd;
rb = SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
if (rb == FALSE) // SystemParametersInfo failed.
{
rc = MessageBox(NULL, _T("Could not get work area."),
_T("Error"), MB_OK);
if (rc == 0) // Not enough memory to create MessageBox.
return E_OUTOFMEMORY;
return E_FAIL; // Replace with specific error handling.
}
hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if (hWnd == NULL)// CreateWindow failed.
{
rc = MessageBox(NULL, _T("Could not create main window."),
_T("Error"), MB_OK);
if (rc == 0) // Not enough memory to create MessageBox.
return E_OUTOFMEMORY;
return E_FAIL; // Replace with specific error handling.
}
GetWindowRect(hWnd, &rect);
chgScreen = SHFullScreen(hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON |
SHFS_HIDESTARTICON);
if (chgScreen == FALSE);
{
// SHFullScreen failed.
rc = MessageBox(NULL, _T("Could not modify the window."),
_T("Error"), MB_OK);
if (rc == 0) // Not enough memory to create MessageBox.
return E_OUTOFMEMORY;
return E_FAIL; // Replace with specific error handling.
}
MoveWindow( hWnd,
rect.left,
rect.top - MENU_HEIGHT,
rect.right,
rect.bottom + MENU_HEIGHT,
TRUE);