RE: Help please with PPC 2003 SE and switch to 192 DPI

From: Vu (Vu_at_discussions.microsoft.com)
Date: 11/04/04


Date: Thu, 4 Nov 2004 04:44:04 -0800


"Simon" wrote:

> I have rechecked my code and I do not find the reason why I still get 92 DPI
> on my device. Can someone please try and compile the code that is attached
> to this post. I have also included the compiled code.
>
Check the document "DPI_Awareness.doc". The following is from that doc
------------------------------------------------------------
High-resolution Windows Mobile-based Pocket PCs also provide an emulation
layer for backwards compatibility with old applications. With this emulation
layer, the display appears to legacy applications as a traditional 240 x 320
display; however, the operating system scales all the graphics to fit the
actual display size. Fonts are linearly scaled in height, using the method
described earlier in this document, in the section titled "Creating DPI-Aware
Fonts."
The following factors control whether the device should use the emulation
layer for an application:
• Subsystem version information in the executable header.
• HI_RES_AWARE custom data in the executable's resources.
The subsystem version information is set during the linking phase of
compilation. By default, applications compiled with the Windows Mobile 2003
and 2002 SDKs set this value to 4.20 or lower; in future releases of the
Pocket PC SDK, this value will be set to 4.21 and higher. In general,
applications with a subsystem version of 4.20 or lower are considered legacy
applications and will go through the emulation layer.
The HI_RES_AWARE resource item can be used to override this behavior for
legacy applications. The operating system looks for this special resource
item when the legacy application loads. The following procedure adds it to
your program, using Microsoft eMbedded Visual C++.
Note Alternatively, you can add the following line to your resource file
directly:
      HI_RES_AWARE CEUX {1} // To turn off the emulation layer
To add the HI_RES_AWARE resource item to your program
1. From the Insert menu, select Resource.
2. Click the Custom button.
3. Enter CEUX for the resource type.
4. Set the resource data to 01 00.
5. Click the Properties tab.
6. Rename the item to "HI_RES_AWARE", including quotes. (If the quotes are
omitted, HI_RES_AWARE will be incorrectly defined as a numeric value in
resource.h, and you will need to go back and delete the line from resource.h.)
7. Deselect the external file checkbox.
-----------------------------------------------------------------------------

Vu