Share via


Rotation Behavior in Older Applications

4/19/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.

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

Concepts

How Applications Detect and Respond to Screen Rotation
WM_SIZE Code Example
WM_SETTINGCHANGE Code Example

Other Resources

Screen Orientation Modes