Creating a Header Control (Windows CE 5.0)

Send Feedback

A header control is a horizontal window that usually is 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 that are between the partitions to set the width of each column. A header control also can perform an action, such as sorting the rows of data according to the values that are in a column that a user selects.

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

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

To create a header control

  1. Specify the WC_HEADER class in the lpClassName parameter of the CreateWindowEx function. This class is registered when the DLL for 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 by using the InitCommonControlsEx function

  • Specify the ICC_ LISTVIEW_CLASSES flag as the dwICC member of the INITCOMMONCONTROLSEX structure that you pass in the lpInitCtrls parameter. The following screen shot shows a Windows CE header control.

    ms926179.headcon(en-us,MSDN.10).gif

See Also

Working with Common Controls | Creating Controls | Shell Application Development

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.