ReactOS 0.4.16-dev-251-ga17b6e9
CNSCBand.cpp File Reference
#include "objects.h"
#include <shlobj.h>
#include <commoncontrols.h>
#include <undocshell.h>
#include <wine/debug.h>
Include dependency graph for CNSCBand.cpp:

Go to the source code of this file.

Classes

struct  CMenuTemp
 

Macros

#define TIMER_ID_REFRESH   9999
 
#define TARGET_EVENTS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shdocvw)
 
HRESULT SHDOCVW_GetPathOfShortcut (_In_opt_ HWND hWnd, _In_ LPCWSTR pszLnkFile, _Out_ LPWSTR pszPath)
 
HRESULT SHDOCVW_CreateShortcut (_In_ LPCWSTR pszLnkFileName, _In_ PCIDLIST_ABSOLUTE pidlTarget, _In_opt_ LPCWSTR pszDescription)
 
static HRESULT SHDOCVW_GetCurrentLocationFromView (_In_ IShellView &View, _In_ PIDLIST_ABSOLUTE *ppidl)
 

Macro Definition Documentation

◆ TARGET_EVENTS

#define TARGET_EVENTS
Value:
( \
)
#define SHCNE_DRIVEREMOVED
Definition: shlobj.h:1897
#define SHCNE_RMDIR
Definition: shlobj.h:1894
#define SHCNE_DELETE
Definition: shlobj.h:1892
#define SHCNE_MKDIR
Definition: shlobj.h:1893
#define SHCNE_UPDATEITEM
Definition: shlobj.h:1903
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1890
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1902
#define SHCNE_CREATE
Definition: shlobj.h:1891
#define SHCNE_RENAMEFOLDER
Definition: shlobj.h:1907
#define SHCNE_DRIVEADD
Definition: shlobj.h:1898
#define SHCNE_ASSOCCHANGED
Definition: shlobj.h:1911

◆ TIMER_ID_REFRESH

#define TIMER_ID_REFRESH   9999

Definition at line 13 of file CNSCBand.cpp.

Function Documentation

◆ SHDOCVW_CreateShortcut()

HRESULT SHDOCVW_CreateShortcut ( _In_ LPCWSTR  pszLnkFileName,
_In_ PCIDLIST_ABSOLUTE  pidlTarget,
_In_opt_ LPCWSTR  pszDescription 
)

Definition at line 49 of file CNSCBand.cpp.

53{
54 HRESULT hr;
55
56 CComPtr<IShellLink> psl;
57 hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
58 IID_PPV_ARG(IShellLink, &psl));
60 return hr;
61
62 psl->SetIDList(pidlTarget);
63
64 if (pszDescription)
65 psl->SetDescription(pszDescription);
66
67 CComPtr<IPersistFile> ppf;
70 return hr;
71
72 return ppf->Save(pszLnkFileName, TRUE);
73}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

◆ SHDOCVW_GetCurrentLocationFromView()

static HRESULT SHDOCVW_GetCurrentLocationFromView ( _In_ IShellView View,
_In_ PIDLIST_ABSOLUTE ppidl 
)
static

Definition at line 114 of file CNSCBand.cpp.

115{
116 CComPtr<IFolderView> pfv;
117 CComPtr<IShellFolder> psf;
119 if (SUCCEEDED(hr) && SUCCEEDED(hr = pfv->GetFolder(IID_PPV_ARG(IShellFolder, &psf))))
120 hr = SHELL_GetIDListFromObject(psf, ppidl);
121 return hr;
122}
EXTERN_C HRESULT SHELL_GetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: utility.cpp:18
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ SHDOCVW_GetPathOfShortcut()

HRESULT SHDOCVW_GetPathOfShortcut ( _In_opt_ HWND  hWnd,
_In_ LPCWSTR  pszLnkFile,
_Out_ LPWSTR  pszPath 
)

Definition at line 19 of file CNSCBand.cpp.

23{
24 *pszPath = UNICODE_NULL;
25 CComPtr<IShellLink> pShellLink;
26 HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
27 IID_PPV_ARG(IShellLink, &pShellLink));
29 return hr;
30
31 CComPtr<IPersistFile> pPersistFile;
32 hr = pShellLink->QueryInterface(IID_PPV_ARG(IPersistFile, &pPersistFile));
34 return hr;
35
36 hr = pPersistFile->Load(pszLnkFile, STGM_READ);
38 return hr;
39
41 hr = pShellLink->GetPath(pszPath, MAX_PATH, &find, 0);
43 return hr;
44
45 return S_OK;
46}
static TAGID TAGID find
Definition: db.cpp:155
#define MAX_PATH
Definition: compat.h:34
#define S_OK
Definition: intsafe.h:52
#define UNICODE_NULL
#define STGM_READ
Definition: objbase.h:917

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shdocvw  )