Typically, you must set the size and position of a header control to fit within the boundaries of a particular rectangle, such as the client area of a window. By using the HDM_LAYOUT message, you can retrieve the appropriate size and position values from the header control.
When sending the HDM_LAYOUT message, you specify the address of an HDLAYOUT structure that contains the coordinates of the rectangle that the header control is to occupy and that provides a pointer to a WINDOWPOS structure. The control fills WINDOWPOS with size and position values appropriate for positioning the control along the top of the specified rectangle. The height value is the sum of the heights of the control's horizontal borders and the average height of characters in the font currently selected into the control's device context.