Creating a Header Control

A header control is a horizontal window usually positioned above columns of data. It is divided into partitions that correspond to the columns, and each partition contains the title for the column below it. A user can drag the dividers between the partitions to set the width of each column. A header can also perform an action, such as sorting the rows of data according to the values in a column a user selects.

A header control sends notification messages to its parent window when a user taps or double-taps an item, when a user drags an item divider, and when the item attributes change. The parent window receives the notifications in the form of WM_NOTIFY messages.

Windows CE supplies macros to send header control messages as well as to support the use of image lists, drag-and-drop features, and custom ordering of header control items.

    To create a header control

  1. Specify WC_HEADER in the lpClassName parameter of the CreateWindowEx function. This class is registered when the common control DLL is loaded. Use the InitCommonControls function to ensure that this DLL is loaded.
  2. Specify a control style in the dwStyle parameter of the CreateWindowEx function.

    For a complete listing of supported styles, see Window and Control Styles.

    To register the header control class using the InitCommonControlsEx function