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.
4/14/2010

Applications that are built with an SDK version earlier than 4.20 are not orientation aware. The SDK version number is located in the executable header file. When users run older applications on Windows Mobile 6.5, their experience might be somewhat different in landscape mode.

Note:
For information on file format specifications, see Microsoft Portable Executable and Common Object File Format Specification on the Windows Hardware and Driver Central Web site.

For example, the lower part of a full-screen dialog box might run off the bottom of the screen. When this happens, Windows Embedded CE automatically adds a vertical scroll bar, allowing users to scroll the clipped part of the screen into view. The vertical scroll bar appears only if there are visible controls that would ordinarily appear at the bottom of a portrait screen.

If your application cannot run in landscape mode, you need to supply code that detects a change in screen orientation and displays an appropriate error message. The following code sample shows one possible way to do this.

Copy Code
DEVMODE devMode;
memset(&devMode, 0, sizeof(devMode));
devMode.dmSize = sizeof(devMode);
devMode.dmFields = DM_DISPLAYORIENTATION;

// Calling with CDS_TEST sets the current
// orientation equal to DEVMODE::dmDisplayOrientation.
ChangeDisplaySettingsEx(NULL, &devMode, NULL, CDS_TEST, NULL);

if (devMode.dmDisplayOrientation != DMDO_0)
	Display Error;

See Also