PDH_BROWSE_DLG_CONFIG

The PDH_BROWSE_DLG_CONFIG structure is used by the PdhBrowseCounters function to configure the PDH Browse Counters dialog box.

typedef struct _BrowseDlgConfig {
    // Configuration flags
    DWORD   bIncludeInstanceIndex:1,
            bSingleCounterPerAdd:1,
            bSingleCounterPerDialog:1,
            bLocalCountersOnly:1,
            bWildCardInstances:1,
            bHideDetailBox:1,
            bInitializePath:1,
            bReserved:25;

    HWND                hWndOwner;
    LPTSTR              szReserved;
    LPTSTR              szReturnPathBuffer;
    DWORD               cchReturnPathLength;
    CounterPathCallBack pCallBack;
    DWORD               dwCallBackArg;
    PDH_STATUS          CallBackStatus;
    DWORD               dwDefaultDetailLevel;
    LPTSTR              szDialogBoxCaption;
} PDH_BROWSE_DLG_CONFIG, *PPDH_BROWSE_DLG_CONFIG;
 

Members

Configuration Flags
The initial DWORD of the PDH_BROWSE_DLG_CONFIG structure contains the following configuration flag fields. The default value for each field is FALSE.
bIncludeInstanceIndex
TRUE: The returned counter path will include the instance index for the instance.

FALSE: The returned counter path will not contain an instance number.

bSingleCounterPerAdd
TRUE: Multiple and wild card selections are permitted. Selected counters are returned as a MULTI_SZ string each time the Add button is clicked.

FALSE: Multiple selections are not permitted. Only one counter will be returned each time the Add button is clicked.

bSingleCounterPerDialog
TRUE: The dialog box is closed after the Add button is clicked the first time. Therefore, you can only add a single counter.

FALSE: The dialog box is not closed until the Close button is clicked. The Add button can be clicked multiple times.

bLocalCountersOnly
TRUE: The machine name will not prefix the counter path in the returned string.

FALSE: The machine name will prefix the counter path unless the user selects the Local Counters Only radio button.

bWildCardInstances
TRUE: If wild card instances (for example, ALL) are selected, then the returned counter path will include the wild-card syntax (for example, "*") for the instance field.

FALSE: If All Instances has been selected, all the instances currently found for that object will be returned in a MULTI_SZ string.

bHideDetailBox
TRUE: Removes the Detail Level combo box from the dialog box so the user cannot change the detail level of the counters displayed in the dialog box. The detail level will be fixed to the value of the dwDefaultDetailLevel member.

FALSE: Displays the Detail Level combo box in the dialog box, allowing the user to change the detail level of the counters displayed.

Note that the counters displayed will be those whose detail level is less than or equal to the current detail level selection. Selecting a detail level of Wizard will display all counters and objects.

bInitializePath
TRUE: Selects the counter and object based on the first counter path contained in the szReturnPathBuffer member when the dialog box is first displayed, instead of using the default counter and object specified by the machine.

FALSE: Selects the initial counter and object using the default counter and object information returned by the machine.

hWndOwner
The handle of the calling function's window.
szReserved
Reserved. Must be NULL.
szReturnPathBuffer
The buffer, allocated by the caller, that is used to initialize the first selection in the list boxes (bInitializePath == TRUE) and to return the selected counters to the calling function or the callback procedure.
cchReturnPathLength
The current maximum size, in characters, of the buffer referenced by the szReturnPathBuffer member. If the callback function reallocates a new buffer, it must also update this value.
pCallBack
The address of the callback function used to update application buffers and controls when a multiple-selection dialog box is configured. For more information, see CounterPathCallback.
dwCallBackArg
User-defined argument that is passed as the only argument to the callback function when it is called by the dialog box.
CallBackStatus
On entry to the callback function, this member contains the status of the path buffer. On exit, the callback function sets the status value resulting from processing.

If the buffer is too small to load the current selection, the browser will set this value to PDH_MORE_DATA. If the browser sets this member to ERROR_SUCCESS, then the szReturnPathBuffer member contains a valid counter path or counter path list.

If the callback function reallocates a new buffer, it should set this member to PDH_RETRY so that the browser will try to load the buffer with the selected paths and call the callback function again.

If some other error occurred, then the callback function should return the appropriate PDH error status value.

dwDefaultDetailLevel
The default detail level to show on startup in the Detail Level combo box. If the Detail Level combo box is not shown, this is the detail level to use in filtering the displayed performance counters and objects.
szDialogBoxCaption
The optional caption to be displayed in the caption bar of the PDH Browse Counters dialog box. If this member is NULL, the caption will be Browse Performance Counters.

Remarks

Each time the Add button is clicked, the szReturnPathBuffer buffer contains the selected counter and the pCallBack callback function is called. The callback function should call the PdhAddCounter function for each counter in the buffer.

See Also

Performance Data Helper Overview, Performance Data Structures, CounterPathCallback, PdhAddCounter, PdhBrowseCounters