Platform SDK: Active Directory, ADSI, and Directory Services

About the Object Picker Dialog Box

The object picker dialog box enables a user to select one or more objects from the Active Directory global catalog, a Microsoft Windows 2000 domain or computer, a Microsoft Windows NT 4.0 domain or computer, or a workgroup. The object types from which the user can select include user, contact, group, and computer objects. For more information about Active Directory, see the Active Directory Programmer's Guide.

To display an object picker dialog box, call the CoCreateInstance or CoCreateInstanceEx function to create an instance of the system's IDsObjectPicker implementation. Then call the IDsObjectPicker::Initialize method to initialize the dialog box and the IDsObjectPicker::InvokeDialog method to display it.

The following illustration shows a typical object picker dialog box.

When you initialize an object picker dialog box, you specify a set of scope types and filters.

The Look in drop-down list contains the scope locations that correspond to the specified scope types. When the user selects a scope from the list, the dialog box applies the filters for that scope type to display a list of objects.

By default the user can select a single object. To enable multiple selections, set the DSOP_FLAG_MULTISELECT flag in the flOptions member of the DSOP_INIT_INFO structure when you initialize the dialog box.