Overview

This tutorial is intended for MFC developers who want to make their MFC desktop application high DPI aware. A high DPI aware application can take full advantage of the DPI setting of the computer display without visual side-effects such as blurring, if the application is not high DPI aware.

Today only about half of users actually set their display to the maximum native resolution because they find the text too small at the maximum resolution. However, simply reducing the resolution has some negative side effects, including:

  • ClearType® renders best at native resolution
  • Users cannot see high definition content at full fidelity
  • High-resolution photos cannot be rendered in maximum fidelity

To increase the size of the text, users are encouraged to use the computer display’s native resolution and increase the DPI setting. However, developers need to make their applications DPI aware in order to fully take advantage of this and not introduce unpleasant visual artifacts, as you will observe later in this tutorial. With the release of Windows 7, there will be a greater level of adoption of high DPI for the following reasons:

  • More OEMs are expected to start shipping laptops with high DPI settings preconfigured
  • Clean installations of Windows 7 have capable devices preconfigured to high DPI
  • The Control Panel UI for high DPI is easier to find

The tutorial will involve real-time compiling of code and copying code from this document. In the event that a copying error (or any other problem) prevents the application from compiling, you can find fully completed samples in the tutorial package, along with the final source code for each exercise. These samples can be used to unblock compiling errors.

Objectives

In this lab, you will learn how to

  • Ensure that the computer is in high DPI mode
  • Enable or Disable the DPI-awareness property in MFC applications using Visual Studio 2010
  • Compare UI elements at the 144 DPI setting and at the 96 DPI setting

System Requirements

You must have the following items to complete this lab:

  • Microsoft Visual Studio® 2010 Beta 2 (or higher)
  • Windows 7