The SPLITCTLDATA structure

The splitpane control data allows further customization of features like splitter thickness, position, style and the (optional) minimum sizes of the side panes.
This is useful when more values are to be set at once, expecially on splitpane creation, otherwise each value can be set individually via a proper PM message or a function-like macro.

Structure definition

#pragma pack(2) typedef struct { USHORT cb; // size of struct (20 or less if some members are unused) USHORT flag; // defines used structure members SHORT splitterPos; // initial splitter position (distance from the left // or bottom border according to the current orientation) USHORT thickness; // bar thickness SHORT minLeft; // minimum width of the left pane SHORT minRight; // minimum width of the right pane SHORT minTop; // minimum height of the top pane SHORT minBottom; // minimum height of the bottom pane USHORT style; // control style (SPLITS_* flags) } SPLITCTLDATA, * PSPLITCTLDATA;
#pragma pack()

Structure members in details

USHORT cb
this is the structure size. It can be set to less than sizeof(SPLITCTLDATA) if some members are not used.
USHORT flag
indicates which control attributes must be updated and if the sizes are in pixels or dialog units:
SPLITCD_POS use the spllitterPos member
SPLITCD_THICKNESS use the thickness member
SPLITCD_STYLE use the style member
SPLITCD_MINLEFT use the minLeft member
SPLITCD_MINRIGHT use the minRight member
SPLITCD_MINTOP use the minTop member
SPLITCD_MINBOTTOM use the minBottom member
SPLITCD_DIALOGUNITS splitterPos, thickness, minLeft, minRight, minTop and minBottom values are in dialog units rather than in pixels.
SHORT splitterPos
defines the splitter axis position. It can be either an absolute value (in pixels or dialog units if the SPLITCD_DIALOGUNITS flag is specified) or a relative one.
Relative values are expressed by negative numbers ranging from -1 to -99 and are translated to percentage of the whole splitpane width (vertical splitter) or height (horizontal splitter) as distance from the left/top border. So if a splitpane is 500 pixels wide a value of -25 sets the splitter at 125 pixels from the left border, while if a splitpane is 300 pixels haigh a value of -33 sets the splitter at 99 pixels from the top border.
Splitter position values are validated before being apllied, so the splitter cannot be moved outside of the splitpane area and cannot reduce any of its side windows below the minimum values (if any of them is set).
Special values are used to collapse (hide) or restore panes:
SPLITHIDE_1 collapse the left/top pane (if it is not yet hidden)
SPLITHIDE_2 collapse the right/bottom pane (if it is not yet hidden)
SPLITHIDE_RESTORE if there is any hidden pane restore it moving the splitter to the previous position
USHORT thickness
defines the splitter thickness in pixels or dialog units. Valid splitter thickness ranges from 3 to 255 pixels. Values beyond that range are automatically set to the nearest limit.
SHORT minLeft
defines the minimum width (by default it is 0) of the left pane. The splitter cannot be moved to the left beyond this limit. The left pane can anyway be hidden if the splitpane style allows that.
When the total splitpane width is less than the sum of the left and right minimum width then the minimum values are ignored.
SHORT minRight
defines the minimum width (by default it is 0) of the left pane. The splitter cannot be moved to the right beyond this limit. The right pane can anyway be hidden if the splitpane style allows that.
When the total splitpane width is less than the sum of the left and right minimum width then the minimum values are ignored.
SHORT minTop
defines the minimum height (by default it is 0) of the top pane. The splitter cannot be moved to the top beyond this limit. The top pane can anyway be hidden if the splitpane style allows that.
When the total splitpane height is less than the sum of the top and bottom minimum height then the minimum values are ignored.
SHORT minBottom
defines the minimum height (by default it is 0) of the bottom pane. The splitter cannot be moved to the bottom beyond this limit. The bottom pane can anyway be hidden if the splitpane style allows that.
When the total splitpane height is less than the sum of the top and bottom minimum height then the minimum values are ignored.
USHORT style
any combination of the previously mentioned styles.