4.4.4 DROPDOWNLIST
The
DROPDOWNLIST syntax provides a combo box with a drop-down list style.
It is similar to the COMBOBOX syntax, except that the actual registry
value is converted to simple language text. The user can choose only
one of the entries from the drop-down list. The DROPDOWNLIST syntax is
preferable to the COMBOBOX syntax when the registry value does not
indicate clearly what setting the policy will accomplish. To better
illustrate this, let’s take a look at the COMBOBOX example with a
DROPDOWNLIST solution:
POLICY !!ScreenSaverFilename
KEYNAME "Software\Policies\Microsoft\Windows\Control Panel\Desktop"
PART "What screen saver do you want?" DROPDOWNLIST
VALUENAME "SCRNSAVE.EXE"
ITEMLIST
NAME "Starfield"
VALUE C:\WINNT\System32\ssstars.scr
NAME "Bezier"
VALUE C:\WINNT\System32\ssbezier.scr
NAME "Flowerbox"
VALUE C:\WINNT\System32\ssflwbox.scr
END ITEMLIST
END PART
END POLICY
The resulting GPME text for this syntax and administrative template is shown in Figure 4.
Tip
If
any item in the drop-down list requires more than one word, you must
use the STRINGS syntax for the entries; otherwise, the .adm template
will generate an error during importing. The STRINGS syntax allows you
to use a single word for each entry, but the GPME converts the string
variable to the actual string for the list. |
Note
Additional
syntax that you can use in conjunction with DROPDOWNLIST includes
KEYNAME, VALUENAME, DEFAULT, REQUIRED, ITEMLIST, END, NOSORT, and
CLIENTEXT. |
4.4.5 EDITTEXT
The
EDITTEXT syntax allows the user to enter alphanumeric text into an edit
field or text box. Here again is the example of editing text in the
screen saver file name.
POLICY !!ScreenSaverFilename
KEYNAME "Software\Policies\Microsoft\Windows\Control Panel\Desktop"
PART !!ScreenSaverFilename EDITTEXT
VALUENAME "SCRNSAVE.EXE"
END PART
END POLICY
By
default, the EDITTEXT syntax provides an empty text box for editing the
policy. If you want to display an initial value in the text box, you
can use the DEFAULT syntax along with the EDITTEXT syntax. The options
you can use with EDITTEXT syntax include:
DEFAULT value Specifies the initial string to place in the edit field. If this option is not specified, the field is initially empty.
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.
MAXLEN value Specifies the maximum length of a string. The string in the edit field is limited to this length.
REQUIRED Specifies that the GPME does not allow a policy containing this PART to be enabled unless a value has been entered for it.
OEMCONVERT
Sets the ES_OEMCONVERT style in the edit field so that typed text is
mapped from ASCII to OEM and back. ES_OEMCONVERT converts text entered
in the edit control. The text is converted from the Windows character
set (ASCII) to the OEM character set and then back to the Windows set.
This ensures proper character conversion when the application calls the CharToOem <JavaScript:hhobj_1.Click()>
function to convert an ASCII string in the edit control to OEM
characters. This style is most useful for edit controls that contain
file names.
Note
Additional
syntax that you can use in conjunction with EDITTEXT includes KEYNAME,
VALUENAME, DEFAULT, REQUIRED, MAXLENGTH, OEMCONVERT, END,
EXPANDABLETEXT, and CLIENTEXT. |