ShlObj.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:141k
- SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
- SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
- #ifdef UNICODE
- #define SHGetFolderPath SHGetFolderPathW
- #else
- #define SHGetFolderPath SHGetFolderPathA
- #endif // !UNICODE
- SHSTDAPI SHGetFolderLocation(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPITEMIDLIST *ppidl);
- SHFOLDERAPI SHGetFolderPathAndSubDirA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCSTR pszSubDir, LPSTR pszPath);
- SHFOLDERAPI SHGetFolderPathAndSubDirW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubDir, LPWSTR pszPath);
- #ifdef UNICODE
- #define SHGetFolderPathAndSubDir SHGetFolderPathAndSubDirW
- #else
- #define SHGetFolderPathAndSubDir SHGetFolderPathAndSubDirA
- #endif // !UNICODE
- #endif // _WIN32_IE >= 0x0500
- #endif // _WIN32_IE >= 0x0400
- //-------------------------------------------------------------------------
- //
- // SHBrowseForFolder API
- //
- //
- //-------------------------------------------------------------------------
- typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
- #include <pshpack8.h>
- typedef struct _browseinfoA {
- HWND hwndOwner;
- LPCITEMIDLIST pidlRoot;
- LPSTR pszDisplayName; // Return display name of item selected.
- LPCSTR lpszTitle; // text to go in the banner over the tree.
- UINT ulFlags; // Flags that control the return stuff
- BFFCALLBACK lpfn;
- LPARAM lParam; // extra info that's passed back in callbacks
- int iImage; // output var: where to return the Image index.
- } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
- typedef struct _browseinfoW {
- HWND hwndOwner;
- LPCITEMIDLIST pidlRoot;
- LPWSTR pszDisplayName; // Return display name of item selected.
- LPCWSTR lpszTitle; // text to go in the banner over the tree.
- UINT ulFlags; // Flags that control the return stuff
- BFFCALLBACK lpfn;
- LPARAM lParam; // extra info that's passed back in callbacks
- int iImage; // output var: where to return the Image index.
- } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
- #include <poppack.h> /* Return to byte packing */
- #ifdef UNICODE
- #define BROWSEINFO BROWSEINFOW
- #define PBROWSEINFO PBROWSEINFOW
- #define LPBROWSEINFO LPBROWSEINFOW
- #else
- #define BROWSEINFO BROWSEINFOA
- #define PBROWSEINFO PBROWSEINFOA
- #define LPBROWSEINFO LPBROWSEINFOA
- #endif
- // Browsing for directory.
- #define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start document searching
- #define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer
- #define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
- // this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the
- // rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
- // all three lines of text.
- #define BIF_RETURNFSANCESTORS 0x0008
- #define BIF_EDITBOX 0x0010 // Add an editbox to the dialog
- #define BIF_VALIDATE 0x0020 // insist on valid result (or CANCEL)
- #define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
- // Caller needs to call OleInitialize() before using this API
- #define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
- #define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
- #define BIF_UAHINT 0x0100 // Add a UA hint to the dialog, in place of the edit box. May not be combined with BIF_EDITBOX
- #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
- #define BIF_NOTRANSLATETARGETS 0x0400 // don't traverse target as shortcut
- #define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers.
- #define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers
- #define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything
- #define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI)
- // message from browser
- #define BFFM_INITIALIZED 1
- #define BFFM_SELCHANGED 2
- #define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog)
- #define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog)
- #define BFFM_IUNKNOWN 5 // provides IUnknown to client. lParam: IUnknown*
- // messages to browser
- #define BFFM_SETSTATUSTEXTA (WM_USER + 100)
- #define BFFM_ENABLEOK (WM_USER + 101)
- #define BFFM_SETSELECTIONA (WM_USER + 102)
- #define BFFM_SETSELECTIONW (WM_USER + 103)
- #define BFFM_SETSTATUSTEXTW (WM_USER + 104)
- #define BFFM_SETOKTEXT (WM_USER + 105) // Unicode only
- #define BFFM_SETEXPANDED (WM_USER + 106) // Unicode only
- SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderA(LPBROWSEINFOA lpbi);
- SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderW(LPBROWSEINFOW lpbi);
- #ifdef UNICODE
- #define SHBrowseForFolder SHBrowseForFolderW
- #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
- #define BFFM_SETSELECTION BFFM_SETSELECTIONW
- #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
- #else
- #define SHBrowseForFolder SHBrowseForFolderA
- #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
- #define BFFM_SETSELECTION BFFM_SETSELECTIONA
- #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
- #endif
- //-------------------------------------------------------------------------
- //
- // SHLoadInProc
- //
- // When this function is called, the shell calls CoCreateInstance
- // (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
- // from within the shell's process and release it immediately.
- //
- //-------------------------------------------------------------------------
- SHSTDAPI SHLoadInProc(REFCLSID rclsid);
- #if _WIN32_IE >= 0x0600
- //-------------------------------------------------------------------------
- //
- // SHEnableServiceObject
- //
- // Like SHLoadInProc, but gives control over the object's lifetime
- // via fEnable parameter. TRUE tells the shell to create the object
- // and hold onto it, FALSE tells the shell to look for the previously
- // created instance of the object and release it.
- //
- //-------------------------------------------------------------------------
- SHSTDAPI SHEnableServiceObject(REFCLSID rclsid, BOOL fEnable);
- #endif
- //-------------------------------------------------------------------------
- //
- // Internet Shortcut Object
- //
- //-------------------------------------------------------------------------
- // Cmds for CGID_ShortCut
- enum {
- ISHCUTCMDID_DOWNLOADICON = 0,
- ISHCUTCMDID_INTSHORTCUTCREATE = 1,
- };
- #define CMDID_INTSHORTCUTCREATE ISHCUTCMDID_INTSHORTCUTCREATE
- //
- // Helper function which returns a IShellFolder interface to the desktop
- // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
- //
- // CoCreateInstance(CLSID_Desktop, NULL,
- // CLSCTX_INPROC, IID_IShellFolder, &pshf);
- //
- SHSTDAPI SHGetDesktopFolder(IShellFolder **ppshf);
- // IShellFolder IBindCtx* parameters. the IUnknown for these are
- // accessed through IBindCtx::RegisterObjectParam/GetObjectParam
- // use this to provide the data needed create IDLists through
- // IShellFolder::ParseDisplayName(). this data applies to the last element
- // of the name that is parsed (c:foobar.txt, data applies to bar.txt)
- // this makes creating these IDLists much faster that suppling the name only
- #define STR_FILE_SYS_BIND_DATA L"File System Bind Data"
- #undef INTERFACE
- #define INTERFACE IFileSystemBindData
- DECLARE_INTERFACE_(IFileSystemBindData, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IFileSystemBindData methods ***
- STDMETHOD(SetFindData)(THIS_ const WIN32_FIND_DATAW *pfd) PURE;
- STDMETHOD(GetFindData)(THIS_ WIN32_FIND_DATAW *pfd) PURE;
- };
- #undef INTERFACE
- #define INTERFACE IShellDetails
- DECLARE_INTERFACE_(IShellDetails, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IShellDetails methods ***
- STDMETHOD(GetDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE;
- STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
- };
- //-------------------------------------------------------------------------
- //
- // IObjMgr interface
- //
- //
- // [Member functions]
- //
- // IObjMgr::Append(punk)
- // This function adds an object to the end of a list of objects.
- //
- // IObjMgr::Remove(punk)
- // This function removes an object from a list of objects.
- //
- // This is implemented by CLSID_ACLMulti so each AutoComplete List
- // (CLSID_ACLHistory, CLSID_ACListISF, CLSID_ACLMRU) can be added.
- // CLSID_ACLMulti's IEnumString will then be the union of the results
- // from the COM Objects added.
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IObjMgr
- DECLARE_INTERFACE_(IObjMgr, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
- // *** IObjMgr specific methods ***
- STDMETHOD(Append) (THIS_ IUnknown *punk) PURE;
- STDMETHOD(Remove) (THIS_ IUnknown *punk) PURE;
- };
- //-------------------------------------------------------------------------
- //
- // ICurrentWorkingDirectory interface
- //
- //
- // [Member functions]
- //
- // ICurrentWorkingDirectory::GetDirectory(LPWSTR pwzPath, DWORD cchSize)
- // This function gets the Current Working Directory from a COM object that
- // stores such state.
- //
- // ICurrentWorkingDirectory::SetDirectory(LPCWSTR pwzPath)
- // This function sets the Current Working Directory of a COM object that
- // stores such state.
- //
- // This function can be used generically. One COM object that implements it
- // is CLSID_ACListISF so that the AutoComplete engine can complete relative
- // paths. SetDirectory() will set the "Current Working Directory" and
- // AutoComplete with then complete both absolute and relative paths.
- // For Example, if ::SetDirectory(L"C:Program Files") is called, then
- // the user can AutoComplete "..winnt". In order to set the current
- // working directory for non-file system paths, "ftp://ftp.microsoft.com/" or
- // "Control Panel" for example, use IPersistFolder.
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE ICurrentWorkingDirectory
- DECLARE_INTERFACE_(ICurrentWorkingDirectory, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
- // *** ICurrentWorkingDirectory specific methods ***
- STDMETHOD(GetDirectory) (THIS_ LPWSTR pwzPath, DWORD cchSize) PURE;
- STDMETHOD(SetDirectory) (THIS_ LPCWSTR pwzPath) PURE;
- };
- //-------------------------------------------------------------------------
- //
- // IACList interface
- //
- //
- // [Member functions]
- //
- // IObjMgr::Expand(LPCOLESTR)
- // This function tells an autocomplete list to expand a specific string.
- //
- // If the user enters a multi-level path, AutoComplete (CLSID_AutoComplete)
- // will use this interface to tell the "AutoComplete Lists" where to expand
- // the results.
- //
- // For Example, if the user enters "C:Program FilesMicros", AutoComplete
- // first completely enumerate the "AutoComplete Lists" via IEnumString. Then it
- // will call the "AutoComplete Lists" with IACList::Expand(L"C:Program Files").
- // It will then enumerate the IEnumString interface again to get results in
- // that directory.
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IACList
- DECLARE_INTERFACE_(IACList, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef) (THIS) PURE;
- STDMETHOD_(ULONG, Release) (THIS) PURE;
- // *** IACList specific methods ***
- STDMETHOD(Expand) (THIS_ LPCOLESTR pszExpand) PURE;
- };
- //-------------------------------------------------------------------------
- //
- // IACList2 interface
- //
- // [Description]
- // This interface exists to allow the caller to set filter criteria
- // for an AutoComplete List. AutoComplete Lists generates the list of
- // possible AutoComplete completions. CLSID_ACListISF is one AutoComplete
- // List COM object that implements this interface.
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IACList2
- typedef enum _tagAUTOCOMPLETELISTOPTIONS
- {
- ACLO_NONE = 0, // don't enumerate anything
- ACLO_CURRENTDIR = 1, // enumerate current directory
- ACLO_MYCOMPUTER = 2, // enumerate MyComputer
- ACLO_DESKTOP = 4, // enumerate Desktop Folder
- ACLO_FAVORITES = 8, // enumerate Favorites Folder
- ACLO_FILESYSONLY = 16, // enumerate only the file system
- ACLO_FILESYSDIRS = 32, // enumerate only the file system dirs, UNC shares, and UNC servers.
- } AUTOCOMPLETELISTOPTIONS;
- DECLARE_INTERFACE_(IACList2, IACList)
- {
- // *** IACList2 specific methods ***
- STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
- STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE;
- };
- /*-------------------------------------------------------------------------*
- INTERFACE: IProgressDialog
- DESCRIPTION:
- CLSID_ProgressDialog/IProgressDialog exist to allow a caller to create
- a progress dialog, set it's title, animation, text lines, progress, and
- it will do all the work of updating on a background thread, being modless,
- handling the user cancelling the operation, and estimating the time remaining
- until the operation completes.
- USAGE:
- This is how the dialog is used during operations that require progress
- and the ability to cancel:
- {
- DWORD dwComplete, dwTotal;
- IProgressDialog * ppd;
- CoCreateInstance(CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, IID_IProgressDialog, (void **)&ppd);
- ppd->SetTitle(L"My Slow Operation"); // Set the title of the dialog.
- ppd->SetAnimation(hInstApp, IDA_OPERATION_ANIMATION); // Set the animation to play.
- ppd->StartProgressDialog(hwndParent, punk, PROGDLG_AUTOTIME, NULL); // Display and enable automatic estimated time remaining.
- ppd->SetCancelMsg(L"Please wait while the current operation is cleaned up", NULL); // Will only be displayed if Cancel button is pressed.
- dwComplete = 0;
- dwTotal = CalcTotalUnitsToDo();
- // Reset because CalcTotalUnitsToDo() took a long time and the estimated time
- // is based on the time between ::StartProgressDialog() and the first
- // ::SetProgress() call.
- ppd->Timer(PDTIMER_RESET, NULL);
- for (nIndex = 0; nIndex < nTotal; nIndex++)
- {
- if (TRUE == ppd->HasUserCancelled())
- break;
- ppd->SetLine(2, L"I'm processing item n", FALSE, NULL);
- dwComplete += DoSlowOperation();
- ppd->SetProgress(dwCompleted, dwTotal);
- }
- ppd->StopProgressDialog();
- ppd->Release();
- }
- *-------------------------------------------------------------------------*/
- // Flags for IProgressDialog::StartProgressDialog() (dwFlags)
- #define PROGDLG_NORMAL 0x00000000 // default normal progress dlg behavior
- #define PROGDLG_MODAL 0x00000001 // the dialog is modal to its hwndParent (default is modeless)
- #define PROGDLG_AUTOTIME 0x00000002 // automatically updates the "Line3" text with the "time remaining" (you cant call SetLine3 if you passs this!)
- #define PROGDLG_NOTIME 0x00000004 // we dont show the "time remaining" if this is set. We need this if dwTotal < dwCompleted for sparse files
- #define PROGDLG_NOMINIMIZE 0x00000008 // Do not have a minimize button in the caption bar.
- #define PROGDLG_NOPROGRESSBAR 0x00000010 // Don't display the progress bar
- // Time Actions (dwTimerAction)
- #define PDTIMER_RESET 0x00000001 // Reset the timer so the progress will be calculated from now until the first ::SetProgress() is called so
- // those this time will correspond to the values passed to ::SetProgress(). Only do this before ::SetProgress() is called.
- #undef INTERFACE
- #define INTERFACE IProgressDialog
- DECLARE_INTERFACE_(IProgressDialog, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IProgressDialog specific methods
- STDMETHOD(StartProgressDialog)(THIS_ HWND hwndParent, IUnknown * punkEnableModless, DWORD dwFlags, LPCVOID pvResevered) PURE;
- STDMETHOD(StopProgressDialog)(THIS) PURE;
- STDMETHOD(SetTitle)(THIS_ LPCWSTR pwzTitle) PURE;
- STDMETHOD(SetAnimation)(THIS_ HINSTANCE hInstAnimation, UINT idAnimation) PURE;
- STDMETHOD_(BOOL,HasUserCancelled) (THIS) PURE;
- STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
- STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
- STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, LPCWSTR pwzString, BOOL fCompactPath, LPCVOID pvResevered) PURE;
- STDMETHOD(SetCancelMsg)(THIS_ LPCWSTR pwzCancelMsg, LPCVOID pvResevered) PURE;
- STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, LPCVOID pvResevered) PURE;
- };
- //==========================================================================
- // IInputObjectSite/IInputObject interfaces
- //
- // These interfaces allow us (or ISVs) to install/update external Internet
- // Toolbar for IE and the shell. The frame will simply get the CLSID from
- // registry (to be defined) and CoCreateInstance it.
- //
- //==========================================================================
- //-------------------------------------------------------------------------
- //
- // IInputObjectSite interface
- //
- // A site implements this interface so the object can communicate
- // focus change to it.
- //
- // [Member functions]
- //
- // IInputObjectSite::OnFocusChangeIS(punkObj, fSetFocus)
- // Object (punkObj) is getting or losing the focus.
- //
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IInputObjectSite
- DECLARE_INTERFACE_(IInputObjectSite, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IInputObjectSite specific methods ***
- STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus) PURE;
- };
- //-------------------------------------------------------------------------
- //
- // IInputObject interface
- //
- // An object implements this interface so the site can communicate
- // activation and accelerator events to it.
- //
- // [Member functions]
- //
- // IInputObject::UIActivateIO(fActivate, lpMsg)
- // Activates or deactivates the object. lpMsg may be NULL. Returns
- // S_OK if the activation succeeded.
- //
- // IInputObject::HasFocusIO()
- // Returns S_OK if the object has the focus, S_FALSE if not.
- //
- // IInputObject::TranslateAcceleratorIO(lpMsg)
- // Allow the object to process the message. Returns S_OK if the
- // message was processed (eaten).
- //
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IInputObject
- DECLARE_INTERFACE_(IInputObject, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IInputObject specific methods ***
- STDMETHOD(UIActivateIO)(THIS_ BOOL fActivate, LPMSG lpMsg) PURE;
- STDMETHOD(HasFocusIO)(THIS) PURE;
- STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
- };
- //==========================================================================
- // IDockingWindowSite/IDockingWindow/IDockingWindowFrame interfaces
- // IInputObjectSite/IInputObject interfaces
- //
- // These interfaces allow us (or ISVs) to install/update external Internet
- // Toolbar for IE and the shell. The frame will simply get the CLSID from
- // registry (to be defined) and CoCreateInstance it.
- //
- //==========================================================================
- //-------------------------------------------------------------------------
- //
- // IDockingWindowSite interface
- //
- // A site implements this interface so the object can negotiate for
- // and inquire about real estate on the site.
- //
- // [Member functions]
- //
- // IDockingWindowSite::GetBorderDW(punkObj, prcBorder)
- // Site returns the bounding rectangle of the given source object
- // (punkObj).
- //
- // IDockingWindowSite::RequestBorderSpaceDW(punkObj, pbw)
- // Object requests that the site makes room for it, as specified in
- // *pbw.
- //
- // IDockingWindowSite::SetBorderSpaceDW(punkObj, pbw)
- // Object requests that the site set the border spacing to the size
- // specified in *pbw.
- //
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IDockingWindowSite
- DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IOleWindow methods ***
- STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
- STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
- // *** IDockingWindowSite methods ***
- STDMETHOD(GetBorderDW) (THIS_ IUnknown* punkObj, LPRECT prcBorder) PURE;
- STDMETHOD(RequestBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
- STDMETHOD(SetBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
- };
- //-------------------------------------------------------------------------
- //
- // IDockingWindowFrame interface
- //
- //
- // [Member functions]
- //
- // IDockingWindowFrame::AddToolbar(punkSrc, pwszItem, dwReserved)
- //
- // IDockingWindowFrame::RemoveToolbar(punkSrc, dwRemoveFlags)
- //
- // IDockingWindowFrame::FindToolbar(pwszItem, riid, ppv)
- //
- //-------------------------------------------------------------------------
- // flags for RemoveToolbar
- #define DWFRF_NORMAL 0x0000
- #define DWFRF_DELETECONFIGDATA 0x0001
- // flags for AddToolbar
- #define DWFAF_HIDDEN 0x0001 // add hidden
- #undef INTERFACE
- #define INTERFACE IDockingWindowFrame
- DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IOleWindow methods ***
- STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
- STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
- // *** IDockingWindowFrame methods ***
- STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
- STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
- STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, void **ppv) PURE;
- };
- #if (_WIN32_IE >= 0x0400)
- //-------------------------------------------------------------------------
- //
- // IRunnableTask interface
- //
- // This is a free threaded interface used for putting items on a background
- // scheduler for execution within the view. It allows a scheduler to start and
- // stop tasks on as many worker threads as it deems necessary.
- //
- // Run(), Kill() and Suspend() may be called from different threads.
- //
- // [Member functions]
- //
- // IRunnableTask::Run(void)
- // Initiate the task to run. This should return E_PENDING if the task
- // has been suspended.
- //
- // IRunnableTask::Kill(void)
- //
- // IRunnableTask::Suspend(void)
- //
- // IRunnableTask::Resume(void)
- //
- // IRunnableTask::IsRunning(void)
- //
- //-------------------------------------------------------------------------
- // Convenient state values
- #define IRTIR_TASK_NOT_RUNNING 0
- #define IRTIR_TASK_RUNNING 1
- #define IRTIR_TASK_SUSPENDED 2
- #define IRTIR_TASK_PENDING 3
- #define IRTIR_TASK_FINISHED 4
- #undef INTERFACE
- #define INTERFACE IRunnableTask
- DECLARE_INTERFACE_( IRunnableTask, IUnknown )
- {
- // *** IUnknown methods ***
- STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
- // *** IRunnableTask methods ***
- STDMETHOD (Run)(THIS) PURE;
- STDMETHOD (Kill)(THIS_ BOOL fWait ) PURE;
- STDMETHOD (Suspend)(THIS) PURE;
- STDMETHOD (Resume)(THIS) PURE;
- STDMETHOD_(ULONG, IsRunning)(THIS) PURE;
- };
- typedef IRunnableTask * LPRUNNABLETASK;
- #endif
- #if (_WIN32_IE >= 0x0400)
- /* ***************** IThumbnailCapture
- * CaptureThumbnail : takes an IHTMLDocument2 and returns a thumbnail of specified
- * size as an hbitmap
- */
- #undef INTERFACE
- #define INTERFACE IThumbnailCapture
- DECLARE_INTERFACE_ ( IThumbnailCapture, IUnknown )
- {
- // *** IThumbnailCapture methods ***
- STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize,
- IUnknown * pHTMLDoc2,
- HBITMAP * phbmThumbnail ) PURE;
- };
- typedef IThumbnailCapture * LPTHUMBNAILCAPTURE;
- #endif
- #if (_WIN32_IE >= 0x400)
- //
- // We need to make sure that WININET.H is included before this interface is
- // used because the COMPONENT structure uses INTERNET_MAX_URL_LENGTH
- //
- #ifdef _WININET_
- //
- // Flags and structures used by IActiveDesktop
- //
- typedef struct _tagWALLPAPEROPT
- {
- DWORD dwSize; // size of this Structure.
- DWORD dwStyle; // WPSTYLE_* mentioned above
- }
- WALLPAPEROPT;
- typedef WALLPAPEROPT *LPWALLPAPEROPT;
- typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
- typedef struct _tagCOMPONENTSOPT
- {
- DWORD dwSize; //Size of this structure
- BOOL fEnableComponents; //Enable components?
- BOOL fActiveDesktop; // Active desktop enabled ?
- }
- COMPONENTSOPT;
- typedef COMPONENTSOPT *LPCOMPONENTSOPT;
- typedef const COMPONENTSOPT *LPCCOMPONENTSOPT;
- typedef struct _tagCOMPPOS
- {
- DWORD dwSize; //Size of this structure
- int iLeft; //Left of top-left corner in screen co-ordinates.
- int iTop; //Top of top-left corner in screen co-ordinates.
- DWORD dwWidth; // Width in pixels.
- DWORD dwHeight; // Height in pixels.
- int izIndex; // Indicates the Z-order of the component.
- BOOL fCanResize; // Is the component resizeable?
- BOOL fCanResizeX; // Resizeable in X-direction?
- BOOL fCanResizeY; // Resizeable in Y-direction?
- int iPreferredLeftPercent; //Left of top-left corner as percent of screen width
- int iPreferredTopPercent; //Top of top-left corner as percent of screen height
- }
- COMPPOS;
- typedef COMPPOS *LPCOMPPOS;
- typedef const COMPPOS *LPCCOMPPOS;
- typedef struct _tagCOMPSTATEINFO
- {
- DWORD dwSize; // Size of this structure.
- int iLeft; // Left of the top-left corner in screen co-ordinates.
- int iTop; // Top of top-left corner in screen co-ordinates.
- DWORD dwWidth; // Width in pixels.
- DWORD dwHeight; // Height in pixels.
- DWORD dwItemState; // State of the component (full-screen mode or split-screen or normal state.
- }
- COMPSTATEINFO;
- typedef COMPSTATEINFO *LPCOMPSTATEINFO;
- typedef const COMPSTATEINFO *LPCCOMPSTATEINFO;
- #define COMPONENT_TOP (0x3fffffff) // izOrder value meaning component is at the top
- // iCompType values
- #define COMP_TYPE_HTMLDOC 0
- #define COMP_TYPE_PICTURE 1
- #define COMP_TYPE_WEBSITE 2
- #define COMP_TYPE_CONTROL 3
- #define COMP_TYPE_CFHTML 4
- #define COMP_TYPE_MAX 4
- // The following is the COMPONENT structure used in IE4.01, IE4.0 and Memphis. It is kept here for compatibility
- // reasons.
- typedef struct _tagIE4COMPONENT
- {
- DWORD dwSize; //Size of this structure
- DWORD dwID; //Reserved: Set it always to zero.
- int iComponentType; //One of COMP_TYPE_*
- BOOL fChecked; // Is this component enabled?
- BOOL fDirty; // Had the component been modified and not yet saved to disk?
- BOOL fNoScroll; // Is the component scrollable?
- COMPPOS cpPos; // Width, height etc.,
- WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
- WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
- WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
- }
- IE4COMPONENT;
- typedef IE4COMPONENT *LPIE4COMPONENT;
- typedef const IE4COMPONENT *LPCIE4COMPONENT;
- //
- // The following is the new NT5 component structure. Note that the initial portion of this component exactly
- // matches the IE4COMPONENT structure. All new fields are added at the bottom and the dwSize field is used to
- // distinguish between IE4COMPONENT and the new COMPONENT structures.
- //
- typedef struct _tagCOMPONENT
- {
- DWORD dwSize; //Size of this structure
- DWORD dwID; //Reserved: Set it always to zero.
- int iComponentType; //One of COMP_TYPE_*
- BOOL fChecked; // Is this component enabled?
- BOOL fDirty; // Had the component been modified and not yet saved to disk?
- BOOL fNoScroll; // Is the component scrollable?
- COMPPOS cpPos; // Width, height etc.,
- WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
- WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
- WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
- //New fields are added below. Everything above here must exactly match the IE4COMPONENT Structure.
- DWORD dwCurItemState; // Current state of the Component.
- COMPSTATEINFO csiOriginal; // Original state of the component when it was first added.
- COMPSTATEINFO csiRestored; // Restored state of the component.
- }
- COMPONENT;
- typedef COMPONENT *LPCOMPONENT;
- typedef const COMPONENT *LPCCOMPONENT;
- // Defines for dwCurItemState
- #define IS_NORMAL 0x00000001
- #define IS_FULLSCREEN 0x00000002
- #define IS_SPLIT 0x00000004
- #define IS_VALIDSIZESTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN) // The set of IS_* state bits which define the "size" of the component - these bits are mutually exclusive.
- #define IS_VALIDSTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN | 0x80000000 | 0x40000000) // All of the currently defined IS_* bits.
- ////////////////////////////////////////////
- // Flags for IActiveDesktop::ApplyChanges()
- #define AD_APPLY_SAVE 0x00000001
- #define AD_APPLY_HTMLGEN 0x00000002
- #define AD_APPLY_REFRESH 0x00000004
- #define AD_APPLY_ALL (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)
- #define AD_APPLY_FORCE 0x00000008
- #define AD_APPLY_BUFFERED_REFRESH 0x00000010
- #define AD_APPLY_DYNAMICREFRESH 0x00000020
- ////////////////////////////////////////////
- // Flags for IActiveDesktop::GetWallpaperOptions()
- // IActiveDesktop::SetWallpaperOptions()
- #define WPSTYLE_CENTER 0
- #define WPSTYLE_TILE 1
- #define WPSTYLE_STRETCH 2
- #define WPSTYLE_MAX 3
- ////////////////////////////////////////////
- // Flags for IActiveDesktop::ModifyComponent()
- #define COMP_ELEM_TYPE 0x00000001
- #define COMP_ELEM_CHECKED 0x00000002
- #define COMP_ELEM_DIRTY 0x00000004
- #define COMP_ELEM_NOSCROLL 0x00000008
- #define COMP_ELEM_POS_LEFT 0x00000010
- #define COMP_ELEM_POS_TOP 0x00000020
- #define COMP_ELEM_SIZE_WIDTH 0x00000040
- #define COMP_ELEM_SIZE_HEIGHT 0x00000080
- #define COMP_ELEM_POS_ZINDEX 0x00000100
- #define COMP_ELEM_SOURCE 0x00000200
- #define COMP_ELEM_FRIENDLYNAME 0x00000400
- #define COMP_ELEM_SUBSCRIBEDURL 0x00000800
- #define COMP_ELEM_ORIGINAL_CSI 0x00001000
- #define COMP_ELEM_RESTORED_CSI 0x00002000
- #define COMP_ELEM_CURITEMSTATE 0x00004000
- #define COMP_ELEM_ALL (COMP_ELEM_TYPE | COMP_ELEM_CHECKED | COMP_ELEM_DIRTY |
- COMP_ELEM_NOSCROLL | COMP_ELEM_POS_LEFT | COMP_ELEM_SIZE_WIDTH |
- COMP_ELEM_SIZE_HEIGHT | COMP_ELEM_POS_ZINDEX | COMP_ELEM_SOURCE |
- COMP_ELEM_FRIENDLYNAME | COMP_ELEM_POS_TOP | COMP_ELEM_SUBSCRIBEDURL |
- COMP_ELEM_ORIGINAL_CSI | COMP_ELEM_RESTORED_CSI | COMP_ELEM_CURITEMSTATE)
- ////////////////////////////////////////////
- // Flags for IActiveDesktop::AddDesktopItemWithUI()
- typedef enum tagDTI_ADTIWUI
- {
- DTI_ADDUI_DEFAULT = 0x00000000,
- DTI_ADDUI_DISPSUBWIZARD = 0x00000001,
- DTI_ADDUI_POSITIONITEM = 0x00000002,
- };
- ////////////////////////////////////////////
- // Flags for IActiveDesktop::AddUrl()
- #define ADDURL_SILENT 0X0001
- ////////////////////////////////////////////
- // Default positions for ADI
- #define COMPONENT_DEFAULT_LEFT (0xFFFF)
- #define COMPONENT_DEFAULT_TOP (0xFFFF)
- //
- // Interface for manipulating the Active Desktop.
- //
- #undef INTERFACE
- #define INTERFACE IActiveDesktop
- DECLARE_INTERFACE_( IActiveDesktop, IUnknown )
- {
- // IUnknown methods
- STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
- STDMETHOD_(ULONG, Release) ( THIS ) PURE;
- // IActiveDesktop methods
- STDMETHOD (ApplyChanges)(THIS_ DWORD dwFlags) PURE;
- STDMETHOD (GetWallpaper)(THIS_ LPWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwReserved) PURE;
- STDMETHOD (SetWallpaper)(THIS_ LPCWSTR pwszWallpaper, DWORD dwReserved) PURE;
- STDMETHOD (GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
- STDMETHOD (SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
- STDMETHOD (GetPattern)(THIS_ LPWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
- STDMETHOD (SetPattern)(THIS_ LPCWSTR pwszPattern, DWORD dwReserved) PURE;
- STDMETHOD (GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
- STDMETHOD (SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
- STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
- STDMETHOD (AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
- STDMETHOD (ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
- STDMETHOD (RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
- STDMETHOD (GetDesktopItemCount)(THIS_ LPINT lpiCount, DWORD dwReserved) PURE;
- STDMETHOD (GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
- STDMETHOD (GetDesktopItemByID)(THIS_ ULONG_PTR dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
- STDMETHOD (GenerateDesktopItemHtml)(THIS_ LPCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
- STDMETHOD (AddUrl)(THIS_ HWND hwnd, LPCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
- STDMETHOD (GetDesktopItemBySource)(THIS_ LPCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
- };
- typedef IActiveDesktop * LPACTIVEDESKTOP;
- #endif // _WININET_
- #if (_WIN32_IE >= 0x0500)
- #define MAX_COLUMN_NAME_LEN 80
- #define MAX_COLUMN_DESC_LEN 128
- #include <pshpack1.h>
- typedef struct {
- SHCOLUMNID scid; // OUT the unique identifier of this column
- VARTYPE vt; // OUT the native type of the data returned
- DWORD fmt; // OUT this listview format (LVCFMT_LEFT, usually)
- UINT cChars; // OUT the default width of the column, in characters
- DWORD csFlags; // OUT SHCOLSTATE flags
- WCHAR wszTitle[MAX_COLUMN_NAME_LEN]; // OUT the title of the column
- WCHAR wszDescription[MAX_COLUMN_DESC_LEN]; // OUT full description of this column
- } SHCOLUMNINFO, *LPSHCOLUMNINFO;
- typedef const SHCOLUMNINFO* LPCSHCOLUMNINFO;
- #include <poppack.h> /* Return to default */
- #include <pshpack8.h>
- typedef struct {
- ULONG dwFlags; // initialization flags
- ULONG dwReserved; // reserved for future use.
- WCHAR wszFolder[MAX_PATH]; // fully qualified folder path (or empty if multiple folders)
- } SHCOLUMNINIT, *LPSHCOLUMNINIT;
- typedef const SHCOLUMNINIT* LPCSHCOLUMNINIT;
- #define SHCDF_UPDATEITEM 0x00000001 // this flag is a hint that the file has changed since the last call to GetItemData
- typedef struct {
- ULONG dwFlags; // combination of SHCDF_ flags.
- DWORD dwFileAttributes; // file attributes.
- ULONG dwReserved; // reserved for future use.
- WCHAR* pwszExt; // address of file name extension
- WCHAR wszFile[MAX_PATH]; // Absolute path of file.
- } SHCOLUMNDATA, *LPSHCOLUMNDATA;
- typedef const SHCOLUMNDATA* LPCSHCOLUMNDATA;
- #include <poppack.h> /* Return to byte packing */
- #undef INTERFACE
- #define INTERFACE IColumnProvider
- // Note: these objects must be threadsafe! GetItemData _will_ be called
- // simultaneously from multiple threads.
- DECLARE_INTERFACE_(IColumnProvider, IUnknown)
- {
- // IUnknown methods
- STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
- // IColumnProvider methods
- STDMETHOD (Initialize)(THIS_ LPCSHCOLUMNINIT psci) PURE;
- STDMETHOD (GetColumnInfo)(THIS_ DWORD dwIndex, SHCOLUMNINFO *psci) PURE;
- STDMETHOD (GetItemData)(THIS_ LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) PURE;
- };
- ///////////////////////////////////////////////////////
- //
- // Drag and Drop helper
- //
- // Purpose: To expose the Shell drag images
- //
- // This interface is implemented in the shell by CLSID_DragDropHelper.
- //
- // To use:
- // If you are the source of a drag (i.e. in response to LV_DRAGBEGIN or
- // equivelent begin drag message) call
- // IDragSourceHelper::InitializeFromWindow
- // (<hwnd of window supporting DI_GETDRAGIMAGE>,
- // <pointer to POINT indicating offset to the mouse from
- // the upper left corner of the image>,
- // <pointer to data object>)
- //
- // NOTE: The Data object must support IDataObject::SetData with multiple
- // data types and GetData must implement data type cloning
- // (Including HGLOBAL), not just aliasing.
- //
- // If you wish to have an image while over your application add the
- // IDragImages::Dr* calls to your IDropTarget implementation. For Example:
- //
- // STDMETHODIMP CUserDropTarget::DragEnter(IDataObject* pDataObject,
- // DWORD grfKeyState,
- // POINTL pt, DWORD* pdwEffect)
- // {
- // // Process your DragEnter
- // // Call IDragImages::DragEnter last.
- // _pDropTargetHelper->DragEnter(_hwndDragOver, pDataObject,
- // (POINT*)&pt, *pdwEffect);
- // return hres;
- // }
- //
- //
- // If you wish to be able to source a drag image from a custom control,
- // implement a handler for the RegisterWindowMessage(DI_GETDRAGIMAGE).
- // The LPARAM is a pointer to an SHDRAGIMAGE structure.
- //
- // sizeDragImage - Calculate the length and width required to render
- // the images.
- // ptOffset - Calculate the offset from the upper left corner to
- // the mouse cursor within the image
- // hbmpDragImage - CreateBitmap( sizeDragImage.cx, sizeDragImage.cy,
- // GetDeviceCaps(hdcScreen, PLANES),
- // GetDeviceCaps(hdcScreen, BITSPIXEL),
- // NULL);
- //
- // Drag Images will only be displayed on Windows NT 5.0 or later.
- //
- //
- // Note about IDropTargetHelper::Show - This method is provided for
- // showing/hiding the Drag image in low color depth video modes. When
- // painting to a window that is currently being dragged over (i.e. For
- // indicating a selection) you need to hide the drag image by calling this
- // method passing FALSE. After the window is done painting, Show the image
- // again by passing TRUE.
- #include <pshpack8.h>
- typedef struct
- {
- SIZE sizeDragImage; // OUT - The length and Width of the
- // rendered image
- POINT ptOffset; // OUT - The Offset from the mouse cursor to
- // the upper left corner of the image
- HBITMAP hbmpDragImage; // OUT - The Bitmap containing the rendered
- // drag images
- COLORREF crColorKey; // OUT - The COLORREF that has been blitted
- // to the background of the images
- } SHDRAGIMAGE, *LPSHDRAGIMAGE;
- #include <poppack.h> /* Return to byte packing */
- // This is sent to a window to get the rendered images to a bitmap
- // Call RegisterWindowMessage to get the ID
- #define DI_GETDRAGIMAGE TEXT("ShellGetDragImage")
- #undef INTERFACE
- #define INTERFACE IDropTargetHelper
- DECLARE_INTERFACE_( IDropTargetHelper, IUnknown )
- {
- // IUnknown methods
- STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
- STDMETHOD_(ULONG, Release) ( THIS ) PURE;
- // IDropTargetHelper
- STDMETHOD (DragEnter)(THIS_ HWND hwndTarget, IDataObject* pDataObject,
- POINT* ppt, DWORD dwEffect) PURE;
- STDMETHOD (DragLeave)(THIS) PURE;
- STDMETHOD (DragOver)(THIS_ POINT* ppt, DWORD dwEffect) PURE;
- STDMETHOD (Drop)(THIS_ IDataObject* pDataObject, POINT* ppt,
- DWORD dwEffect) PURE;
- STDMETHOD (Show)(THIS_ BOOL fShow) PURE;
- };
- #undef INTERFACE
- #define INTERFACE IDragSourceHelper
- DECLARE_INTERFACE_( IDragSourceHelper, IUnknown )
- {
- // IUnknown methods
- STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
- STDMETHOD_(ULONG, Release) ( THIS ) PURE;
- // IDragSourceHelper
- STDMETHOD (InitializeFromBitmap)(THIS_ LPSHDRAGIMAGE pshdi,
- IDataObject* pDataObject) PURE;
- STDMETHOD (InitializeFromWindow)(THIS_ HWND hwnd, POINT* ppt,
- IDataObject* pDataObject) PURE;
- };
- #endif // _WIN32_IE >= 0x0500
- #endif // _WIN32_IE
- //==========================================================================
- // Clipboard format which may be supported by IDataObject from system
- // defined shell folders (such as directories, network, ...).
- //==========================================================================
- #define CFSTR_SHELLIDLIST TEXT("Shell IDList Array") // CF_IDLIST
- #define CFSTR_SHELLIDLISTOFFSET TEXT("Shell Object Offsets") // CF_OBJECTPOSITIONS
- #define CFSTR_NETRESOURCES TEXT("Net Resource") // CF_NETRESOURCE
- #define CFSTR_FILEDESCRIPTORA TEXT("FileGroupDescriptor") // CF_FILEGROUPDESCRIPTORA
- #define CFSTR_FILEDESCRIPTORW TEXT("FileGroupDescriptorW") // CF_FILEGROUPDESCRIPTORW
- #define CFSTR_FILECONTENTS TEXT("FileContents") // CF_FILECONTENTS
- #define CFSTR_FILENAMEA TEXT("FileName") // CF_FILENAMEA
- #define CFSTR_FILENAMEW TEXT("FileNameW") // CF_FILENAMEW
- #define CFSTR_PRINTERGROUP TEXT("PrinterFriendlyName") // CF_PRINTERS
- #define CFSTR_FILENAMEMAPA TEXT("FileNameMap") // CF_FILENAMEMAPA
- #define CFSTR_FILENAMEMAPW TEXT("FileNameMapW") // CF_FILENAMEMAPW
- #define CFSTR_SHELLURL TEXT("UniformResourceLocator")
- #define CFSTR_INETURLA CFSTR_SHELLURL
- #define CFSTR_INETURLW TEXT("UniformResourceLocatorW")
- #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
- #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect")
- #define CFSTR_PASTESUCCEEDED TEXT("Paste Succeeded")
- #define CFSTR_INDRAGLOOP TEXT("InShellDragLoop")
- #define CFSTR_DRAGCONTEXT TEXT("DragContext")
- #define CFSTR_MOUNTEDVOLUME TEXT("MountedVolume")
- #define CFSTR_PERSISTEDDATAOBJECT TEXT("PersistedDataObject")
- #define CFSTR_TARGETCLSID TEXT("TargetCLSID") // HGLOBAL with a CLSID of the drop target
- #define CFSTR_LOGICALPERFORMEDDROPEFFECT TEXT("Logical Performed DropEffect")
- #define CFSTR_AUTOPLAY_SHELLIDLISTS TEXT("Autoplay Enumerated IDList Array") // (HGLOBAL with LPIDA)
- #ifdef UNICODE
- #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORW
- #define CFSTR_FILENAME CFSTR_FILENAMEW
- #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPW
- #define CFSTR_INETURL CFSTR_INETURLW
- #else
- #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORA
- #define CFSTR_FILENAME CFSTR_FILENAMEA
- #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPA
- #define CFSTR_INETURL CFSTR_INETURLA
- #endif
- #define DVASPECT_SHORTNAME 2 // use for CF_HDROP to get short name version of file paths
- #define DVASPECT_COPY 3 // use to indicate format is a "Copy" of the data (FILECONTENTS, FILEDESCRIPTOR, etc)
- #define DVASPECT_LINK 4 // use to indicate format is a "Shortcut" to the data (FILECONTENTS, FILEDESCRIPTOR, etc)
- #include <pshpack8.h>
- //
- // format of CF_NETRESOURCE
- //
- typedef struct _NRESARRAY { // anr
- UINT cItems;
- NETRESOURCE nr[1];
- } NRESARRAY, * LPNRESARRAY;
- #include <poppack.h> /* Return to byte packing */
- //
- // format of CF_IDLIST
- //
- typedef struct _IDA {
- UINT cidl; // number of relative IDList
- UINT aoffset[1]; // [0]: folder IDList, [1]-[cidl]: item IDList
- } CIDA, * LPIDA;
- //
- // FILEDESCRIPTOR.dwFlags field indicate which fields are to be used
- //
- typedef enum {
- FD_CLSID = 0x0001,
- FD_SIZEPOINT = 0x0002,
- FD_ATTRIBUTES = 0x0004,
- FD_CREATETIME = 0x0008,
- FD_ACCESSTIME = 0x0010,
- FD_WRITESTIME = 0x0020,
- FD_FILESIZE = 0x0040,
- FD_PROGRESSUI = 0x4000, // Show Progress UI w/Drag and Drop
- FD_LINKUI = 0x8000, // 'link' UI is prefered
- } FD_FLAGS;
- typedef struct _FILEDESCRIPTORA { // fod
- DWORD dwFlags;
- CLSID clsid;
- SIZEL sizel;
- POINTL pointl;
- DWORD dwFileAttributes;
- FILETIME ftCreationTime;
- FILETIME ftLastAccessTime;
- FILETIME ftLastWriteTime;
- DWORD nFileSizeHigh;
- DWORD nFileSizeLow;
- CHAR cFileName[ MAX_PATH ];
- } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
- typedef struct _FILEDESCRIPTORW { // fod
- DWORD dwFlags;
- CLSID clsid;
- SIZEL sizel;
- POINTL pointl;
- DWORD dwFileAttributes;
- FILETIME ftCreationTime;
- FILETIME ftLastAccessTime;
- FILETIME ftLastWriteTime;
- DWORD nFileSizeHigh;
- DWORD nFileSizeLow;
- WCHAR cFileName[ MAX_PATH ];
- } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
- #ifdef UNICODE
- #define FILEDESCRIPTOR FILEDESCRIPTORW
- #define LPFILEDESCRIPTOR LPFILEDESCRIPTORW
- #else
- #define FILEDESCRIPTOR FILEDESCRIPTORA
- #define LPFILEDESCRIPTOR LPFILEDESCRIPTORA
- #endif
- //
- // format of CF_FILEGROUPDESCRIPTOR
- //
- typedef struct _FILEGROUPDESCRIPTORA { // fgd
- UINT cItems;
- FILEDESCRIPTORA fgd[1];
- } FILEGROUPDESCRIPTORA, * LPFILEGROUPDESCRIPTORA;
- typedef struct _FILEGROUPDESCRIPTORW { // fgd
- UINT cItems;
- FILEDESCRIPTORW fgd[1];
- } FILEGROUPDESCRIPTORW, * LPFILEGROUPDESCRIPTORW;
- #ifdef UNICODE
- #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORW
- #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORW
- #else
- #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORA
- #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORA
- #endif
- //
- // format of CF_HDROP and CF_PRINTERS, in the HDROP case the data that follows
- // is a double null terinated list of file names, for printers they are printer
- // friendly names
- //
- typedef struct _DROPFILES {
- DWORD pFiles; // offset of file list
- POINT pt; // drop point (client coords)
- BOOL fNC; // is it on NonClient area
- // and pt is in screen coords
- BOOL fWide; // WIDE character switch
- } DROPFILES, *LPDROPFILES;
- //====== File System Notification APIs ===============================
- //
- //
- // File System Notification flags
- //
- #define SHCNE_RENAMEITEM 0x00000001L
- #define SHCNE_CREATE 0x00000002L
- #define SHCNE_DELETE 0x00000004L
- #define SHCNE_MKDIR 0x00000008L
- #define SHCNE_RMDIR 0x00000010L
- #define SHCNE_MEDIAINSERTED 0x00000020L
- #define SHCNE_MEDIAREMOVED 0x00000040L
- #define SHCNE_DRIVEREMOVED 0x00000080L
- #define SHCNE_DRIVEADD 0x00000100L
- #define SHCNE_NETSHARE 0x00000200L
- #define SHCNE_NETUNSHARE 0x00000400L
- #define SHCNE_ATTRIBUTES 0x00000800L
- #define SHCNE_UPDATEDIR 0x00001000L
- #define SHCNE_UPDATEITEM 0x00002000L
- #define SHCNE_SERVERDISCONNECT 0x00004000L
- #define SHCNE_UPDATEIMAGE 0x00008000L
- #define SHCNE_DRIVEADDGUI 0x00010000L
- #define SHCNE_RENAMEFOLDER 0x00020000L
- #define SHCNE_FREESPACE 0x00040000L
- #if (_WIN32_IE >= 0x0400)
- // SHCNE_EXTENDED_EVENT: the extended event is identified in dwItem1,
- // packed in LPITEMIDLIST format (same as SHCNF_DWORD packing).
- // Additional information can be passed in the dwItem2 parameter
- // of SHChangeNotify (called "pidl2" below), which if present, must also
- // be in LPITEMIDLIST format.
- //
- // Unlike the standard events, the extended events are ORDINALs, so we
- // don't run out of bits. Extended events follow the SHCNEE_* naming
- // convention.
- //
- // The dwItem2 parameter varies according to the extended event.
- #define SHCNE_EXTENDED_EVENT 0x04000000L
- #endif // _WIN32_IE >= 0x0400
- #define SHCNE_ASSOCCHANGED 0x08000000L
- #define SHCNE_DISKEVENTS 0x0002381FL
- #define SHCNE_GLOBALEVENTS 0x0C0581E0L // Events that dont match pidls first
- #define SHCNE_ALLEVENTS 0x7FFFFFFFL
- #define SHCNE_INTERRUPT 0x80000000L // The presence of this flag indicates
- // that the event was generated by an
- // interrupt. It is stripped out before
- // the clients of SHCNNotify_ see it.
- #if (_WIN32_IE >= 0x0400)
- // SHCNE_EXTENDED_EVENT extended events. These events are ordinals.
- // This is not a bitfield.
- #define SHCNEE_ORDERCHANGED 2L // pidl2 is the changed folder
- #define SHCNEE_MSI_CHANGE 4L // pidl2 is a SHChangeProductKeyAsIDList
- #define SHCNEE_MSI_UNINSTALL 5L // pidl2 is a SHChangeProductKeyAsIDList
- #endif
- // Flags
- // uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
- #define SHCNF_IDLIST 0x0000 // LPITEMIDLIST
- #define SHCNF_PATHA 0x0001 // path name
- #define SHCNF_PRINTERA 0x0002 // printer friendly name
- #define SHCNF_DWORD 0x0003 // DWORD
- #define SHCNF_PATHW 0x0005 // path name
- #define SHCNF_PRINTERW 0x0006 // printer friendly name
- #define SHCNF_TYPE 0x00FF
- #define SHCNF_FLUSH 0x1000
- #define SHCNF_FLUSHNOWAIT 0x2000
- #ifdef UNICODE
- #define SHCNF_PATH SHCNF_PATHW
- #define SHCNF_PRINTER SHCNF_PRINTERW
- #else
- #define SHCNF_PATH SHCNF_PATHA
- #define SHCNF_PRINTER SHCNF_PRINTERA
- #endif
- //
- // APIs
- //
- SHSTDAPI_(void) SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
- //
- // IShellChangeNotify
- //
- #undef INTERFACE
- #define INTERFACE IShellChangeNotify
- DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IShellChangeNotify methods ***
- STDMETHOD(OnChange) (THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
- } ;
- //
- // IQueryInfo
- //
- //-------------------------------------------------------------------------
- //
- // IQueryInfo interface
- //
- // [Methods]
- // ::GetInfoTip()
- //-------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE IQueryInfo
- DECLARE_INTERFACE_(IQueryInfo, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** IQueryInfo methods ***
- STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR **ppwszTip) PURE;
- STDMETHOD(GetInfoFlags)(THIS_ DWORD *pdwFlags) PURE;
- } ;
- #define QITIPF_DEFAULT 0x00000000
- #define QITIPF_USENAME 0x00000001
- #define QITIPF_LINKNOTARGET 0x00000002
- #define QITIPF_LINKUSETARGET 0x00000004
- #define QITIPF_USESLOWTIP 0x00000008 // Flag says it's OK to take a long time generating tip
- #define QIF_CACHED 0x00000001
- #define QIF_DONTEXPANDFOLDER 0x00000002
- //
- // SHAddToRecentDocs
- //
- #define SHARD_PIDL 0x00000001L
- #define SHARD_PATHA 0x00000002L
- #define SHARD_PATHW 0x00000003L
- #ifdef UNICODE
- #define SHARD_PATH SHARD_PATHW
- #else
- #define SHARD_PATH SHARD_PATHA
- #endif
- SHSTDAPI_(void) SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
- #if (_WIN32_IE >= 0x0400)
- typedef struct _SHChangeProductKeyAsIDList {
- USHORT cb;
- WCHAR wszProductKey[39];
- USHORT cbZero;
- } SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList;
- SHSTDAPI_(void) SHUpdateImageA(LPCSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
- SHSTDAPI_(void) SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
- #ifdef UNICODE
- #define SHUpdateImage SHUpdateImageW
- #else
- #define SHUpdateImage SHUpdateImageA
- #endif // !UNICODE
- #endif /* _WIN32_IE */
- SHSTDAPI SHGetInstanceExplorer(IUnknown **ppunk);
- //
- // SHGetDataFromIDListA/W
- //
- // SHGetDataFromIDList nFormat values TCHAR
- #define SHGDFIL_FINDDATA 1
- #define SHGDFIL_NETRESOURCE 2
- #define SHGDFIL_DESCRIPTIONID 3
- #define SHDID_ROOT_REGITEM 1
- #define SHDID_FS_FILE 2
- #define SHDID_FS_DIRECTORY 3
- #define SHDID_FS_OTHER 4
- #define SHDID_COMPUTER_DRIVE35 5
- #define SHDID_COMPUTER_DRIVE525 6
- #define SHDID_COMPUTER_REMOVABLE 7
- #define SHDID_COMPUTER_FIXED 8
- #define SHDID_COMPUTER_NETDRIVE 9
- #define SHDID_COMPUTER_CDROM 10
- #define SHDID_COMPUTER_RAMDISK 11
- #define SHDID_COMPUTER_OTHER 12
- #define SHDID_NET_DOMAIN 13
- #define SHDID_NET_SERVER 14
- #define SHDID_NET_SHARE 15
- #define SHDID_NET_RESTOFNET 16
- #define SHDID_NET_OTHER 17
- #define SHDID_COMPUTER_IMAGING 18
- #define SHDID_COMPUTER_AUDIO 19
- #define SHDID_COMPUTER_SHAREDDOCS 20
- #include <pshpack8.h>
- typedef struct _SHDESCRIPTIONID {
- DWORD dwDescriptionId;
- CLSID clsid;
- } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
- #include <poppack.h> /* Return to byte packing */
- // these delegate to IShellFolder2::GetItemData()
- SHSTDAPI SHGetDataFromIDListA(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
- SHSTDAPI SHGetDataFromIDListW(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
- #ifdef UNICODE
- #define SHGetDataFromIDList SHGetDataFromIDListW
- #else
- #define SHGetDataFromIDList SHGetDataFromIDListA
- #endif // !UNICODE
- //===========================================================================
- //
- // PROPIDs for Internet Shortcuts (FMTID_Intshcut) to be used with
- // IPropertySetStorage/IPropertyStorage
- //
- // The known property ids and their variant types are:
- // PID_IS_URL [VT_LPWSTR] URL
- // PID_IS_NAME [VT_LPWSTR] Name of the internet shortcut
- // PID_IS_WORKINGDIR [VT_LPWSTR] Working directory for the shortcut
- // PID_IS_HOTKEY [VT_UI2] Hotkey for the shortcut
- // PID_IS_SHOWCMD [VT_I4] Show command for shortcut
- // PID_IS_ICONINDEX [VT_I4] Index into file that has icon
- // PID_IS_ICONFILE [VT_LPWSTR] File that has the icon
- // PID_IS_WHATSNEW [VT_LPWSTR] What's New text
- // PID_IS_AUTHOR [VT_LPWSTR] Author
- // PID_IS_DESCRIPTION [VT_LPWSTR] Description text of site
- // PID_IS_COMMENT [VT_LPWSTR] User annotated comment
- //
- #define PID_IS_URL 2
- #define PID_IS_NAME 4
- #define PID_IS_WORKINGDIR 5
- #define PID_IS_HOTKEY 6
- #define PID_IS_SHOWCMD 7
- #define PID_IS_ICONINDEX 8
- #define PID_IS_ICONFILE 9
- #define PID_IS_WHATSNEW 10
- #define PID_IS_AUTHOR 11
- #define PID_IS_DESCRIPTION 12
- #define PID_IS_COMMENT 13
- //
- // PROPIDs for Internet Sites (FMTID_InternetSite) to be used with
- // IPropertySetStorage/IPropertyStorage
- //
- // The known property ids and their variant types are:
- // PID_INTSITE_WHATSNEW [VT_LPWSTR] What's New text
- // PID_INTSITE_AUTHOR [VT_LPWSTR] Author
- // PID_INTSITE_LASTVISIT [VT_FILETIME] Time site was last visited
- // PID_INTSITE_LASTMOD [VT_FILETIME] Time site was last modified
- // PID_INTSITE_VISITCOUNT [VT_UI4] Number of times user has visited
- // PID_INTSITE_DESCRIPTION [VT_LPWSTR] Description text of site
- // PID_INTSITE_COMMENT [VT_LPWSTR] User annotated comment
- // PID_INTSITE_RECURSE [VT_UI4] Levels to recurse (0-3)
- // PID_INTSITE_WATCH [VT_UI4] PIDISM_ flags
- // PID_INTSITE_SUBSCRIPTION [VT_UI8] Subscription cookie
- // PID_INTSITE_URL [VT_LPWSTR] URL
- // PID_INTSITE_TITLE [VT_LPWSTR] Title
- // PID_INTSITE_CODEPAGE [VT_UI4] Codepage of the document
- // PID_INTSITE_TRACKING [VT_UI4] Tracking
- // PID_INTSITE_ICONINDEX [VT_I4] Retrieve the index to the icon
- // PID_INTSITE_ICONFILE [VT_LPWSTR] Retrieve the file containing the icon index.
- #define PID_INTSITE_WHATSNEW 2
- #define PID_INTSITE_AUTHOR 3
- #define PID_INTSITE_LASTVISIT 4
- #define PID_INTSITE_LASTMOD 5
- #define PID_INTSITE_VISITCOUNT 6
- #define PID_INTSITE_DESCRIPTION 7
- #define PID_INTSITE_COMMENT 8
- #define PID_INTSITE_FLAGS 9
- #define PID_INTSITE_CONTENTLEN 10
- #define PID_INTSITE_CONTENTCODE 11
- #define PID_INTSITE_RECURSE 12
- #define PID_INTSITE_WATCH 13
- #define PID_INTSITE_SUBSCRIPTION 14
- #define PID_INTSITE_URL 15
- #define PID_INTSITE_TITLE 16
- #define PID_INTSITE_CODEPAGE 18
- #define PID_INTSITE_TRACKING 19
- #define PID_INTSITE_ICONINDEX 20
- #define PID_INTSITE_ICONFILE 21
- // Flags for PID_IS_FLAGS
- #define PIDISF_RECENTLYCHANGED 0x00000001
- #define PIDISF_CACHEDSTICKY 0x00000002
- #define PIDISF_CACHEIMAGES 0x00000010
- #define PIDISF_FOLLOWALLLINKS 0x00000020
- // Values for PID_INTSITE_WATCH
- #define PIDISM_GLOBAL 0 // Monitor based on global setting
- #define PIDISM_WATCH 1 // User says watch
- #define PIDISM_DONTWATCH 2 // User says don't watch
- ////////////////////////////////////////////////////////////////////
- //
- // The shell keeps track of some per-user state to handle display
- // options that is of major interest to ISVs.
- // The key one requested right now is "DoubleClickInWebView".
- //
- // SysFiles are these windows special files:
- // "dll sys vxd 386 drv"
- //
- // hidden files are files with the FILE_ATTRIBUTE_HIDDEN attribute
- //
- // system files are files with the FILE_ATTRIBUTE_SYSTEM attribute
- //
- // fShowAllObjects fShowSysFiles Result
- // --------------- ------------- ------
- // 0 0 hide hidden + SysFiles + system files
- // 0 1 hide hidden files.
- // 1 0 show all files.
- // 1 1 show all files.
- //
- typedef struct {
- BOOL fShowAllObjects : 1;
- BOOL fShowExtensions : 1;
- BOOL fNoConfirmRecycle : 1;
- BOOL fShowSysFiles : 1;
- BOOL fShowCompColor : 1;
- BOOL fDoubleClickInWebView : 1;
- BOOL fDesktopHTML : 1;
- BOOL fWin95Classic : 1;
- BOOL fDontPrettyPath : 1;
- BOOL fShowAttribCol : 1;
- BOOL fMapNetDrvBtn : 1;
- BOOL fShowInfoTip : 1;
- BOOL fHideIcons : 1;
- UINT fRestFlags : 3;
- } SHELLFLAGSTATE, *LPSHELLFLAGSTATE;
- #define SSF_SHOWALLOBJECTS 0x00000001
- #define SSF_SHOWEXTENSIONS 0x00000002
- #define SSF_SHOWCOMPCOLOR 0x00000008
- #define SSF_SHOWSYSFILES 0x00000020
- #define SSF_DOUBLECLICKINWEBVIEW 0x00000080
- #define SSF_SHOWATTRIBCOL 0x00000100
- #define SSF_DESKTOPHTML 0x00000200
- #define SSF_WIN95CLASSIC 0x00000400
- #define SSF_DONTPRETTYPATH 0x00000800
- #define SSF_SHOWINFOTIP 0x00002000
- #define SSF_MAPNETDRVBUTTON 0x00001000
- #define SSF_NOCONFIRMRECYCLE 0x00008000
- #define SSF_HIDEICONS 0x00004000
- // SHGetSettings(LPSHELLFLAGSTATE lpss, DWORD dwMask)
- //
- // Specify the bits you are interested in in dwMask and they will be
- // filled out in the lpss structure.
- //
- // When these settings change, a WM_SETTINGCHANGE message is sent
- // with the string lParam value of "ShellState".
- //
- SHSTDAPI_(void) SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
- // SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast)
- //
- // Given a pidl, you can get an interface pointer (as specified by riid) of the pidl's parent folder (in ppv)
- // If ppidlLast is non-NULL, you can also get the pidl of the last item.
- //
- SHSTDAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast);
- // SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
- //
- // given a string it will call psfDesktop->ParseDisplayName() to try and create a pidl
- // if no pbc specified, it uses the preferred options for parsing.
- // this includes mapping file system paths to their appropriate aliased location (RegisterObjectParam(STR_PARSE_TRANSLATE_ALIASES))
- // psfgaoOut is optional for SFGAO attributes
- //
- SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut);
- // SHPathPrepareForWrite(HWND hwnd, IUnknown *punkEnableModless, LPCTSTR pszPath, DWORD dwFlags)
- //
- // DESCRIPTION:
- // This API will prepare the path for the caller. This includes:
- // 1. Prompting for the ejectable media to be re-inserted. (Floppy, CD-ROM, ZIP drive, etc.)
- // 2. Prompting for the media to be formatted. (Floppy, hard drive, etc.)
- // 3. Remount mapped drives if the connection was lost. (\uncshare mapped to N: becomes disconnected)
- // 4. If the path doesn't exist, create it. (SHPPFW_DIRCREATE and SHPPFW_ASKDIRCREATE)
- // 5. Display an error if the media is read only. (SHPPFW_NOWRITECHECK not set)
- //
- // PARAMETERS:
- // hwnd: Parernt window for UI. NULL means don't display UI. OPTIONAL
- // punkEnableModless: Parent that will be set to modal during UI using IOleInPlaceActiveObject::EnableModeless(). OPTIONAL
- // pszPath: Path to verify is valid for writting. This can be a UNC or file drive path. The path
- // should only contain directories. Pass SHPPFW_IGNOREFILENAME if the last path segment
- // is always filename to ignore.
- // dwFlags: SHPPFW_* Flags to modify behavior
- //
- //-------------------------------------------------------------------------
- #define SHPPFW_NONE 0x00000000
- #define SHPPFW_DEFAULT SHPPFW_DIRCREATE // May change
- #define SHPPFW_DIRCREATE 0x00000001 // Create the directory if it doesn't exist without asking the user.
- #define SHPPFW_ASKDIRCREATE 0x00000002 // Create the directory if it doesn't exist after asking the user.
- #define SHPPFW_IGNOREFILENAME 0x00000004 // Ignore the last item in pszPath because it's a file. Example: pszPath="C:DirADirB", only use "C:DirA".
- #define SHPPFW_NOWRITECHECK 0x00000008 // Caller only needs to read from the drive, so don't check if it's READ ONLY.
- #define SHPPFW_MEDIACHECKONLY 0x00000010 // do the retrys on the media (or net path), return errors if the file can't be found
- SHSTDAPI SHPathPrepareForWriteA(HWND hwnd, IUnknown *punkEnableModless, LPCSTR pszPath, DWORD dwFlags);
- SHSTDAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *punkEnableModless, LPCWSTR pszPath, DWORD dwFlags);
- #ifdef UNICODE
- #define SHPathPrepareForWrite SHPathPrepareForWriteW
- #else
- #define SHPathPrepareForWrite SHPathPrepareForWriteA
- #endif // !UNICODE
- //--------------------------------------------------------------------------
- //
- // Interface used for exposing the INI file methods on a shortcut file
- //
- //
- //--------------------------------------------------------------------------
- #undef INTERFACE
- #define INTERFACE INamedPropertyBag
- DECLARE_INTERFACE_(INamedPropertyBag, IUnknown)
- {
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
- STDMETHOD_(ULONG,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG,Release) (THIS) PURE;
- // *** INamedPropertyBag methods ***
- STDMETHOD(ReadPropertyNPB) (THIS_ /* [in] */ LPCOLESTR pszBagname,
- /* [in] */ LPCOLESTR pszPropName,
- /* [out][in] */ PROPVARIANT *pVar) PURE;
- STDMETHOD(WritePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
- /* [in] */ LPCOLESTR pszPropName,
- /* [in] */ PROPVARIANT *pVar) PURE;
- STDMETHOD(RemovePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
- /* [in] */ LPCOLESTR pszPropName) PURE;
- };
- #ifdef __urlmon_h__
- // NOTE: urlmon.h must be included before shlobj.h to access this function.
- //
- // SoftwareUpdateMessageBox
- //
- // Provides a standard message box for the alerting the user that a software
- // update is available or installed. No UI will be displayed if there is no
- // update available or if the available update version is less than or equal
- // to the Advertised update version.
- //
- // hWnd - [in] Handle of owner window
- // szDistUnit - [in] Unique identifier string for a code distribution unit. For
- // ActiveX controls and Active Setup installed components, this
- // is typically a GUID string.
- // dwFlags - [in] Must be 0.
- // psdi - [in,out] Pointer to SOFTDISTINFO ( see URLMon.h ). May be NULL.
- // cbSize should be initialized
- // by the caller to sizeof(SOFTDISTINFO), dwReserved should be set to 0.
- //
- // RETURNS:
- //
- // IDNO - The user chose cancel. If *pbRemind is FALSE, the caller should save the
- // update version from the SOFTDISTINFO and pass it in as the Advertised
- // version in future calls.
- //
- // IDYES - The user has selected Update Now/About Update. The caller should navigate to
- // the SOFTDISTINFO's pszHREF to initiate the install or learn about it.
- // The caller should save the update version from the SOFTDISTINFO and pass
- // it in as the Advertised version in future calls.
- //
- // IDIGNORE - There is no pending software update. Note: There is
- // no Ignore button in the standard UI. This occurs if the available
- // version is less than the installed version or is not present or if the
- // Advertised version is greater than or equal to the update version.
- //
- // IDABORT - An error occured. Call GetSoftwareUpdateInfo() for a more specific HRESULT.
- // Note: There is no Abort button in the standard UI.
- SHDOCAPI_(DWORD) SoftwareUpdateMessageBox( HWND hWnd,
- LPCWSTR szDistUnit,
- DWORD dwFlags,
- LPSOFTDISTINFO psdi );
- #endif // if __urlmon_h__
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #include <poppack.h>
- SHDOCAPI_(BOOL) ImportPrivacySettings( LPCWSTR szFilename,
- IN OUT BOOL* pfParsePrivacyPreferences, IN OUT BOOL* pfParsePerSiteRules);
- #ifndef IEnumPrivacyRecords
- typedef interface IEnumPrivacyRecords IEnumPrivacyRecords;
- #endif
- SHDOCAPI DoPrivacyDlg( HWND hwndParent, LPOLESTR pszUrl, IEnumPrivacyRecords *pPrivacyEnum, BOOL fReportAllSites);
- #endif // _SHLOBJ_H_