Platform SDK: Group Policy |
Specifies various options, including drop-down list boxes, text boxes, and text in the lower pane of the Group Policy snap-in. A policy part is specified as follows:
PART name part-type
type-dependent data
[KEYNAME key name ]
VALUENAME value name
END PART
Type | Description |
---|---|
CHECKBOX | Displays a check box. The value is set in the registry with the REG_DWORD type. The value is nonzero if the check box is checked and zero if it is not checked. |
COMBOBOX | Displays a combo box. |
DROPDOWNLIST | Displays a combo box with a drop-down list style. The user may choose only one of the entries supplied. |
EDITTEXT | Displays a text box that accepts alphanumeric text. The text is set in the registry with either the REG_SZ or the REG_EXPAND_SZ type. |
LISTBOX | Displays a list box with Add and Remove buttons. This is the only part type that can be used to manage multiple values under one key. |
NUMERIC | Displays a text box with an optional spin control that accepts a numeric value. The value is set in the registry with the REG_DWORD type. |
TEXT | Displays a line of static text. There is no associated registry value with this part type. |
VALUEON on value
VALUEOFF off value
The following tables describe the policy part types.
The CHECKBOX part type accepts the following options.
Option | Description |
---|---|
ACTIONLISTOFF | Specifies an optional action list to be used if the check box is cleared. For more information, see ACTIONLIST. |
ACTIONLISTON | Specifies an optional action list to be used if the check box is selected. For more information, see ACTIONLIST. |
DEFCHECKED | Causes the check box to be initially selected. |
VALUEOFF | Overrides the default behavior of the check box if it is cleared. |
VALUEON | Overrides the default behavior of the check box if it is selected. |
The default behavior of a check box is to write the value 1 to the registry if it is selected and zero if it is cleared. The VALUEON and VALUEOFF options override this behavior. For example, the following option writes "Turned on" to the registry when the check box is selected:
VALUEON "Turned on"
The following statement writes the value 12 to the registry when the check box is cleared:
VALUEOFF NUMERIC 12
The COMBOBOX part type accepts the same options as EDITTEXT, with the addition of the following option.
Option | Description |
---|---|
SUGGESTIONS | A list of suggestions to be placed in the drop-down list. The list must end with END SUGGESTIONS. Suggestions are separated with spaces and can be enclosed within double quotation marks. A suggestion that includes white space must be delimited with quotation marks, as illustrated by "New York" in the following example: SUGGESTIONS Alaska Alabama Mississippi "New York" END SUGGESTIONS |
The DROPDOWNLIST part type accepts the following options.
Option | Description |
---|---|
ITEMLIST | A list of the items in the drop-down list. For more information, see ITEMLIST. |
REQUIRED | Specifies that the Group Policy snap-in will not allow a policy containing this part to be enabled unless a value has been provided for the part. |
The EDITTEXT part type accepts the following options.
Option | Description |
---|---|
DEFAULT value | Specifies the initial string to place in the text box. If this option is not specified, the text box is initially empty. |
MAXLEN value | Specifies the maximum length of a string. The string in the text box is limited to this length. |
REQUIRED | Specifies that the Group Policy snap-in will not allow a policy containing this part to be enabled, unless a value has been provided for this part. |
OEMCONVERT | Sets the ES_OEMCONVERT style in the text box so that typed text is mapped from ANSI to OEM and back to ANSI. |
EXPANDABLETEXT | Specifies that the text is set in the registry with the REG_EXPAND_SZ type. By default, the text is set in the registry with the REG_SZ type. |
The LISTBOX part type accepts the following options.
Option | Description |
---|---|
ADDITIVE | By default, the content of list boxes will override the values set in the registry. If this option is specified, existing values are not deleted, and the values set in the list box will be in addition to whatever values exist in the target registry. |
EXPLICITVALUE | This option makes the user specify not only the value data, but the value name as well. The list box will show two columns for each item, one for the name and one for the data. This option cannot be used with the VALUEPREFIX option. |
VALUEPREFIX prefix | The prefix specified is used in determining value names. If a prefix is specified, the prefix and an incremented integer will be used instead of the default value naming scheme described previously. For example, a prefix of SomeName will generate the value names SomeName1 , SomeName2 , and so on. The prefix can be empty (""), which will cause the value names to be "1", "2", and so on. |
The VALUENAME option cannot be used with the LISTBOX part type, because there is no single value name associated with this type. By default, only one column appears in the list box, and for each entry a value is created whose name and value are the same.
The NUMERIC part type accepts the following options.
Option | Description |
---|---|
DEFAULT value | Specifies the initial numeric value for the text box. If this option is not specified, the text box is initially empty. |
MAX value | Specifies the maximum value for the number. The default value is 9999. |
MIN value | Specifies the minimum value for the number. The default value is 0. |
REQUIRED | Specifies that the policy editor will not allow a policy containing this part to be enabled unless a value has been provided for this part. |
SPIN value | Specifies increments to use for the spin control. SPIN 0 removes the spin control. SPIN 1 is the default. |
TXTCONVERT | Writes values as REG_SZ strings ("1," "2," or "128") rather than as binary values. |
The TEXT part type accepts no type-specific data. This part type is used to display a descriptive message.