📄 dsclient.h
字号:
typedef HRESULT (CALLBACK *LPDSENUMATTRIBUTES)(LPARAM lParam, LPCWSTR pszAttributeName, LPCWSTR pszDisplayName, DWORD dwFlags);
//
// IDsDisplaySpecifier::GetClassCreationInfo information
//
#define DSCCIF_HASWIZARDDIALOG 0x00000001 // = 1 => return the wizard dialog CLSID
#define DSCCIF_HASWIZARDPRIMARYPAGE 0x00000002 // = 1 => returning a primary wizard dlg CLSID
typedef struct
{
DWORD dwFlags;
CLSID clsidWizardDialog;
CLSID clsidWizardPrimaryPage;
DWORD cWizardExtensions; // how many extension CLSIDs?
CLSID aWizardExtensions[1];
} DSCLASSCREATIONINFO, * LPDSCLASSCREATIONINFO;
//
// IDsDisplaySpecifier - a COM object for interacting with display specifiers
//
#undef INTERFACE
#define INTERFACE IDsDisplaySpecifier
DECLARE_INTERFACE_(IDsDisplaySpecifier, IUnknown)
{
// *** IUnknown methods ***
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
// *** IDsDisplaySpecifier methods ***
STDMETHOD(SetServer)(THIS_ LPCWSTR pszServer, LPCWSTR pszUserName, LPCWSTR pszPassword, DWORD dwFlags) PURE;
STDMETHOD(SetLanguageID)(THIS_ LANGID langid) PURE;
STDMETHOD(GetDisplaySpecifier)(THIS_ LPCWSTR pszObjectClass, REFIID riid, void **ppv) PURE;
STDMETHOD(GetIconLocation)(THIS_ LPCWSTR pszObjectClass, DWORD dwFlags, LPWSTR pszBuffer, INT cchBuffer, INT *presid) PURE;
STDMETHOD_(HICON, GetIcon)(THIS_ LPCWSTR pszObjectClass, DWORD dwFlags, INT cxIcon, INT cyIcon) PURE;
STDMETHOD(GetFriendlyClassName)(THIS_ LPCWSTR pszObjectClass, LPWSTR pszBuffer, INT cchBuffer) PURE;
STDMETHOD(GetFriendlyAttributeName)(THIS_ LPCWSTR pszObjectClass, LPCWSTR pszAttributeName, LPWSTR pszBuffer, UINT cchBuffer) PURE;
STDMETHOD_(BOOL, IsClassContainer)(THIS_ LPCWSTR pszObjectClass, LPCWSTR pszADsPath, DWORD dwFlags) PURE;
STDMETHOD(GetClassCreationInfo)(THIS_ LPCWSTR pszObjectClass, LPDSCLASSCREATIONINFO* ppdscci) PURE;
STDMETHOD(EnumClassAttributes)(THIS_ LPCWSTR pszObjectClass, LPDSENUMATTRIBUTES pcbEnum, LPARAM lParam) PURE;
STDMETHOD_(ADSTYPE, GetAttributeADsType)(LPCWSTR pszAttributeName) PURE;
};
//---------------------------------------------------------------------------//
//
// DsBrowseForContainer
// --------------------
// Provides a container browser similar to the SHBrowseForFolder, except
// targetting the DS.
//
// In:
// pInfo -> DSBROWSEINFO structure
//
// Out:
// == IDOK/IDCANCEL depending on buttons, -1 if error
//
//---------------------------------------------------------------------------//
typedef struct
{
DWORD cbStruct; // size of structure in bytes
HWND hwndOwner; // dialog owner
LPCWSTR pszCaption; // dialog caption text (can be NULL)
LPCWSTR pszTitle; // displayed above the tree view control (can be NULL)
LPCWSTR pszRoot; // ADS path to root (NULL == root of DS namespace)
LPWSTR pszPath; // [in/out] initial selection & returned path (required)
ULONG cchPath; // size of pszPath buffer in characters
DWORD dwFlags;
BFFCALLBACK pfnCallback; // callback function (see SHBrowseForFolder)
LPARAM lParam; // passed to pfnCallback as lpUserData
DWORD dwReturnFormat; // ADS_FORMAT_* (default is ADS_FORMAT_X500_NO_SERVER)
LPCWSTR pUserName; // Username and Password to authenticate against DS with
LPCWSTR pPassword;
LPWSTR pszObjectClass; // UNICODE string for the object class
ULONG cchObjectClass;
} DSBROWSEINFOW, *PDSBROWSEINFOW;
typedef struct
{
DWORD cbStruct;
HWND hwndOwner;
LPCSTR pszCaption;
LPCSTR pszTitle;
LPCWSTR pszRoot; // ADS paths are always UNICODE
LPWSTR pszPath; // ditto
ULONG cchPath;
DWORD dwFlags;
BFFCALLBACK pfnCallback;
LPARAM lParam;
DWORD dwReturnFormat;
LPCWSTR pUserName; // Username and Password to authenticate against DS with
LPCWSTR pPassword;
LPWSTR pszObjectClass; // object class of the selected object
ULONG cchObjectClass;
} DSBROWSEINFOA, *PDSBROWSEINFOA;
#ifdef UNICODE
#define DSBROWSEINFO DSBROWSEINFOW
#define PDSBROWSEINFO PDSBROWSEINFOW
#else
#define DSBROWSEINFO DSBROWSEINFOA
#define PDSBROWSEINFO PDSBROWSEINFOA
#endif
// DSBROWSEINFO flags
#define DSBI_NOBUTTONS 0x00000001 // NOT TVS_HASBUTTONS
#define DSBI_NOLINES 0x00000002 // NOT TVS_HASLINES
#define DSBI_NOLINESATROOT 0x00000004 // NOT TVS_LINESATROOT
#define DSBI_CHECKBOXES 0x00000100 // TVS_CHECKBOXES
#define DSBI_NOROOT 0x00010000 // don't include pszRoot in tree (its children become top level nodes)
#define DSBI_INCLUDEHIDDEN 0x00020000 // display hidden objects
#define DSBI_EXPANDONOPEN 0x00040000 // expand to the path specified in pszPath when opening the dialog
#define DSBI_ENTIREDIRECTORY 0x00090000 // browse the entire directory (defaults to having DSBI_NOROOT set)
#define DSBI_RETURN_FORMAT 0x00100000 // dwReturnFormat field is valid
#define DSBI_HASCREDENTIALS 0x00200000 // pUserName & pPassword are valid
#define DSBI_IGNORETREATASLEAF 0x00400000 // ignore the treat as leaf flag when calling IsClassContainer
#define DSBI_SIMPLEAUTHENTICATE 0x00800000 // don't use secure authentication to DS
#define DSBI_RETURNOBJECTCLASS 0x01000000 // return object class of selected object
#define DSB_MAX_DISPLAYNAME_CHARS 64
typedef struct
{
DWORD cbStruct;
LPCWSTR pszADsPath; // ADS paths are always Unicode
LPCWSTR pszClass; // ADS properties are always Unicode
DWORD dwMask;
DWORD dwState;
DWORD dwStateMask;
WCHAR szDisplayName[DSB_MAX_DISPLAYNAME_CHARS];
WCHAR szIconLocation[MAX_PATH];
INT iIconResID;
} DSBITEMW, *PDSBITEMW;
typedef struct
{
DWORD cbStruct;
LPCWSTR pszADsPath; // ADS paths are always Unicode
LPCWSTR pszClass; // ADS properties are always Unicode
DWORD dwMask;
DWORD dwState;
DWORD dwStateMask;
CHAR szDisplayName[DSB_MAX_DISPLAYNAME_CHARS];
CHAR szIconLocation[MAX_PATH];
INT iIconResID;
} DSBITEMA, *PDSBITEMA;
#ifdef UNICODE
#define DSBITEM DSBITEMW
#define PDSBITEM PDSBITEMW
#else
#define DSBITEM DSBITEMA
#define PDSBITEM PDSBITEMA
#endif
// DSBITEM mask flags
#define DSBF_STATE 0x00000001
#define DSBF_ICONLOCATION 0x00000002
#define DSBF_DISPLAYNAME 0x00000004
// DSBITEM state flags
#define DSBS_CHECKED 0x00000001
#define DSBS_HIDDEN 0x00000002
#define DSBS_ROOT 0x00000004
//
// this message is sent to the callback to see if it wants to insert or modify
// the item that is about to be inserted into the view.
//
#define DSBM_QUERYINSERTW 100 // lParam = PDSBITEMW (state, icon & name may be modified). Return TRUE if handled.
#define DSBM_QUERYINSERTA 101 // lParam = PDSBITEMA (state, icon & name may be modified). Return TRUE if handled.
#ifdef UNICODE
#define DSBM_QUERYINSERT DSBM_QUERYINSERTW
#else
#define DSBM_QUERYINSERT DSBM_QUERYINSERTA
#endif
//
// Called before we change the state of the icon (on tree collapse/expand)
//
#define DSBM_CHANGEIMAGESTATE 102 // lParam = adspath. Return TRUE/FALSE top allow/disallow
//
// The dialog receives a WM_HELP
//
#define DSBM_HELP 103 // lParam == LPHELPINFO structure
//
// The dialog receives a WM_CONTEXTMENU, DSBID_xxx are the control ID's for this
// dialog so that you can display suitable help.
//
#define DSBM_CONTEXTMENU 104 // lParam == window handle to retrieve help for
//
// These are the control IDs for the controls in the dialog. The callback can use
// these to modify the contents of the dialog as required.
//
#define DSBID_BANNER 256
#define DSBID_CONTAINERLIST 257
//
// API exported for browsing for containers.
//
STDAPI_(int) DsBrowseForContainerW(PDSBROWSEINFOW pInfo);
STDAPI_(int) DsBrowseForContainerA(PDSBROWSEINFOA pInfo);
#ifdef UNICODE
#define DsBrowseForContainer DsBrowseForContainerW
#else
#define DsBrowseForContainer DsBrowseForContainerA
#endif
//BUGBUG: these are here to keep old clients building - remove soon
STDAPI_(HICON) DsGetIcon(DWORD dwFlags, LPWSTR pszObjectClass, INT cxImage, INT cyImage);
STDAPI DsGetFriendlyClassName(LPWSTR pszObjectClass, LPWSTR pszBuffer, UINT cchBuffer);
#endif // GUID_DEFS_ONLY
#pragma option pop /*P_O_Pop*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -