Differences Between 16-Bit Windows and 32-Bit Windows: Overview

OverviewHow Do IFAQDetails

The increased address-space size in 32-bit Windows impacts 16-bit code in several ways:

  • Pointers are all 32 bits wide and are no longer near or far, and your code cannot make assumptions based on segmented memory.

  • Window handles, handles to other objects (such as pens, brushes, and menus), and graphics coordinates have increased to 32 bits. Thus, you cannot use types such as WORD interchangeably with HWND as you could in 16-bit Windows.

  • Message handlers must be rewritten because the different sizes can change the way information is packed in some message parameters.

  • The larger size of graphics coordinates affects a number of function calls.

The key areas of 16-bit code affected by these changes are:

  • Window procedure declarations

  • Near and far type declarations

  • Data types

  • Messages

  • Calls to API functions

  • WinMain function

For a thorough discussion of 32-bit adaptations in each of these areas, see Porting 16-Bit Code to 32-Bit Windows.