Click here to get back home

yey! Landscape WM5 Smartphone with emulator: tips and caveats

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
yey! Landscape WM5 Smartphone with emulator: tips and caveats The PocketTV Team 03-11-2006
Get Chitika Premium
Posted by The PocketTV Team on March 11, 2006, 4:25 am
Please log in for more thread options
all right!!!

i've been able to trick the WM5 Smartphone emulator to rotate the display in
Landscape, which is very useful for testing that apps will work fine on the
new Landscape Smartphones, but there are lots of caveats and bug workaround
to be aware of.

1) to rotate the Smartphone display to Landscape:

{
int ret;
DEVMODE devMode = ;
devMode.dmSize = sizeof devMode;
devMode.dmFields = DM_DISPLAYORIENTATION;
devMode.dmDisplayOrientation = DMDO_90;

ret = ChangeDisplaySettingsEx((const TCHAR *)NULL, &devMode, (HWND)NULL,
0, NULL);
if (ret != 0) {
// get error status with GetLastError();
}
}

2) Once this is done, you will see that the Smartphone shell looks strange
(Start soft-key off screen, nav-bar not resized etc). that's because the
Smartphone shell does not have the code to correctly react to screen
orientation change - even though the WM5 native library allows applications
to rotate the display if they want. so one bad point for MSFT, they should
have tested the Shell and make sure it reacted correctly to the
WM_SETTINGCHANGE messages indicating orientation change.

3) because of 2), a number of shell and UI routines misbehave, so you need
to implement workarounds in your code if you want to test in this situation.

Among what i found:

4) the D-pad keys are not properly rotated.

5) SystemParametersInfo(SPI_GETWORKAREA, ...) returns an incorrect work area
rectangle with top == 0, instead of top > 0 and being the size of the
top-bar (i.e. the bar the contains the window name and other icons, i.e the
equivalent of the NavBar on Pocket PC).

This is easy to work around, since on Smartphone you can get the handle to
the top-bar using:
hWnd = FindWindow(TEXT("Tray"), TEXT("Tray"));
and then you can get its rectangle and implement the work around. Notice
that the size depends on the screen resolution!

6) a number of other routines will cause windows to have incorrect size,
probably as a consequence of 5). for example, if you create a Fullscreen
window with CreateWindow, using CW_USEDEFAULT as parameters, or if you call
SHInitDialog using the SHIDIF_SIZEDLGFULLSCREEN flag.
in all those cases, the fullscreen window rectangle will fail to take into
account the top-bar, therefore the window will have to be resized correctly.

with the caveats above, you can test your apps on a Landscape-oriented
Smartphone using the emulator, until MSFT comes with a new Smartphone WM5
emulator image that correctly supports Landscape orientation - which is
unlikely to happen before the new Landscape-oriented Smartphones hit the
market!

7) soft-reset of the Smartphone emulator will always put it back to
Portrait, since there is no way to register the orientation in the registry
(the flag CDS_UPDATEREGISTRY is not defined, and not supported by the
ChangeDisplaySettingsEx API, i tried!).



Similar ThreadsPosted
Emulator Image for Landscape Smartphone? December 5, 2006, 1:47 pm
How to rotate smartphone emulator to landscape November 28, 2007, 5:01 pm
Landscape QVGA Smartphone emulator image March 2, 2006, 4:52 am
Re: Landscape QVGA Smartphone emulator image March 3, 2006, 7:44 am
How can you type-in digits with the Landscape WM5 Smartphone Emulator? June 26, 2006, 7:48 pm
are there new Smartphone emulator images with square and landscape screens? March 10, 2006, 10:02 pm
GetOpenFileName broken on the Motorola Q (works on the Landscape WM5 Smartphone Emulator) June 12, 2006, 9:49 pm
Problem with Landscape Emulator Install April 13, 2007, 2:00 pm
Emulator for Motorla Q Phone (landscape mode) May 14, 2007, 9:44 am
WM 5.0 Smartphone Landscape mode October 14, 2005, 2:33 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap