Directory Services

OPENQUERYWINDOW

The OPENQUERYWINDOW structure is used with the ICommonQuery::OpenQueryWindow method to initialize the directory service query dialog box.

typedef struct {
DWORD cbStruct;
DWORD dwFlags;
CLSID clsidHandler;
LPVOID pHandlerParameters;
CLSID clsidDefaultForm;
IPersistQuery* pPersistQuery;
union {
void* pFormParameters;
IPropertyBag* ppbFormParameters;
}; } OPENQUERYWINDOW,
*LPOPENQUERYWINDOW;

Members

cbStruct
Contains the size, in bytes, of the structure. This member is used for versioning and parameter validation and must be filled in before calling ICommonQuery::OpenQueryWindow.
dwFlags
Contains a set of flags that define the behavior of the directory service query dialog box. This can be zero or a combination of one or more of the following values.
Value Meaning
OQWF_DEFAULTFORM Causes the query dialog box to select the form specified by the clsidDefaultForm member on initialization.
OQWF_HIDEMENUS Causes the dialog box to hide the menu bar.
OQWF_HIDESEARCHUI Causes the query dialog box to be created without the standard search user interface. This includes the Find Now, Stop and Clear All pushbuttons.
OQWF_ISSUEONOPEN Causes the query to be executed when the query dialog box is first displayed.
OQWF_LOADQUERY Causes the query dialog box to retrieve the query from the IPersistQuery interface in the pPersistQuery member.
OQWF_OKCANCEL Causes the query dialog box to display the OK and Cancel pushbuttons, if applicable. The buttons actually displayed in the dialog box will depend on the form used and other specified flags.
OQWF_PARAMISPROPERTYBAG Indicates that the ppbFormParameters member contains an IPropertyBag interface.
OQWF_REMOVEFORMS Causes the query dialog box to be created without the form chooser label and drop-down list represented by the Find: label.
OQWF_REMOVESCOPES Causes the query dialog box to be created without the scope label and drop-down list represented by the In: label.
OQWF_SAVEQUERYONOK Causes the query dialog box, when closed, to save the query to the IPersistQuery interface in the pPersistQuery member.
OQWF_SHOWOPTIONAL Causes the query dialog box to display optional forms in the form drop-down list. Optional forms are forms that specify the CQFF_ISOPTIONAL flag in the dwFlags member of the CQFORM structure.
OQWF_SINGLESELECT Causes the query dialog box to make the query results list single-selection.
clsidHandler
Contains a CLSID value that specifies the query handler to be used by the query dialog box. The value of this member also determines the type of structure pointed to by the pHandlerParameters member.
Value Meaning
CLSID_DsQuery This is the standard directory service query and currently the only query supported.
pHandlerParameters
Pointer to a structure that contains data for the query handler. The type of structure pointed to by this member is defined by the clsidHandler member. The following table lists the possible types of structures based on the value of the clsidHandler member.
Value Meaning
CLSID_DsQuery Contains a pointer to a DSQUERYINITPARAMS structure.
clsidDefaultForm
Specifies the default form to be displayed in the query dialog box. This member is ignored if dwFlags does not contain OQWF_DEFAULTFORM. This member can contain the CLSID of a custom query form or one of the system-supplied forms.
Value Meaning
CLSID_DsFindAdvanced Identifies the Custom Search query form.
CLSID_DsFindComputer Identifies the Computers query form.
CLSID_DsFindContainer Identifies the Organizational Units query form.
CLSID_DsFindDomainController Identifies the Domain Controllers query form.
CLSID_DsFindFrsMembers Identifies the FRS Members query form.
CLSID_DsFindObjects This query form is not currently supported.
CLSID_DsFindPeople Identifies the Users, Contacts, and Groups query form.
CLSID_DsFindPrinter Identifies the Printers query form.
CLSID_DsFindVolume Identifies the Shared Folders query form.
pPersistQuery
Pointer to an IPersistQuery interface used to store and retrieve query data. This data pertains to the query itself, not the results of the query. If dwFlags contains OQWF_LOADQUERY, the query data is obtained from this interface. If dwFlags contains OQWF_SAVEQUERY, the query data is saved to this interface.
pFormParameters
Pointer to a structure or interface that provides parameter initialization data for the form. The contents of this pointer is defined by the form class specified by the clsidDefaultForm member. This member is not currently used by any of the system-supplied forms.
ppbFormParameters
Pointer to an IPropertyBag interface that provides parameter initialization data for the form. The contents of this property bag is defined by the form class specified by the clsidDefaultForm member. The following system-supplied forms support this member.
CLSID_DsFindPrinter
This form obtains the following properties from the property bag.
Property Name Description
printName Contains the initial printer name.
printLocation Contains the initial printer location.
printModel Contains the initial model name and/or number of the printer.

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Cmnquery.h.

See Also

ICommonQuery::OpenQueryWindow, IPersistQuery, CQFORM, DSQUERYINITPARAMS, Active Directory Display Structures