Porting an application from the Pocket PC to the Smartphone   

Appendix D: Designing Applications for Windows CE Platforms

Screen rotation on the WM 2003 SE platform

PocketBuilder supports deployment to Windows Mobile 2003 Second Edition devices and emulators. WM 2003 SE replaces the Pocket PC 2003 platform. It allows for screen rotation between portrait and landscape modes. WM 2003 SE also supports square screens and changes to screen resolution.

If you have more than one WM 2003 SE emulator, the PocketBuilder 2.0 deployment controller allows you to select the emulator that you want.

Effects of screen rotation

PocketBuilder processes messages from the WM 2003 SE platform when the screen orientation or resolution has changed and automatically makes adjustments to all Main! type application windows to conform to the current Windows CE environment. The title bar on a main window also resizes automatically. Any open menus or notification bubbles are closed, and if the SIP is raised immediately before screen rotation, it is automatically lowered.

Response windows and message boxes are not changed when the screen orientation or resolution changes. When an application is running and the display orientation is changed, any response windows and message boxes are recentered on the display. There is special logic to make sure the response window’s title bar is still visible, since that is often the only way to close the window.

The Windows CE operating system sends a setting change message, PBM_Setting_Change, with a wParam value of 12290 when the user presses a button on a WM 2003 SE device to rotate the screen. The PocketBuilder pbm_settingchange event handler for this message resizes main windows to the new screen dimensions with required adjustments for any title and menu bars. You can add code to the Resize event (or a pbm_settingchange user event) for a main window if you need to adjust the sizes or positions of controls on the window.

NoteObtaining the current screen size You must instantiate a new Environment object to obtain the current screen height and width. Environment objects that are instantiated prior to screen rotation or resolution changes will have incorrect or stale information.

Deployment using CAB files

If you build CAB files for deployment, the VersionMin value (in the CEDevice section of the application INF file) is set to 3.0. This defines the application for compatibility with Pocket PC 2002 devices or emulators.

PocketBuilder adds the BuildMax value of 0xE0000000 to the CEDevice section of the application INF file. This value prevents application users from seeing a warning message when installing the CAB file on older Pocket PCs, but allows developers to take advantage of WM 2003 SE features.

For more information

For a discussion of WM 2003 SE features, see the Microsoft Web site





Copyright © 2004. Sybase Inc. All rights reserved.  

View this book as PDF