RE: How can I make High resolution Window?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

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


Date: Thu, 7 Oct 2004 10:41:02 -0700


"Steve" wrote:

> Hi!
>
> I started to develop for Pocket Pc 2003. I have a test PDA(Hp IPAQ hx4700).
> This PDA has high reolution(640*480), but if I make a Windows Form
> Application (VS.NET2003 C#) and I get this resulotion: 320*240.
> I use these commands to get resolution:
> System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width.ToString()
> System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height.ToString()
>
> And if I make a Form width 640 ; 480 Size properties, I just see the
> 320*240px part of the form.
>
> How Can I develop width 640*480?

I use EVC++4 and 4705. I have the same problem and found the solution from
the document DPI_Awareness.doc.
Here is the part of resolution
------------------------
Legacy Support
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.
---------------------------

HTH,

Vu


Quantcast