42 #ifndef _INC_COMUTIL // is comutil.h of MS headers not available? 50 extern const LPCTSTR sCFSTR_SHELLIDLIST;
51 #undef CFSTR_SHELLIDLIST 52 #define CFSTR_SHELLIDLIST sCFSTR_SHELLIDLIST 56 #define NOVTABLE __declspec(novtable) 67 #define COMExceptionBase _com_error 123 LOG(CURRENT_CONTEXT.getStackTrace());
132 LOG(CURRENT_CONTEXT.getStackTrace());
141 LOG(CURRENT_CONTEXT.getStackTrace());
150 LOG(CURRENT_CONTEXT.getStackTrace());
161 #define THROW_EXCEPTION(hr) throw COMException(hr, __FILE__, __LINE__) 162 #define CHECKERROR(hr) ((void)(FAILED(hr)? THROW_EXCEPTION(hr): 0)) 185 #if (_WIN32_WINNT>=0x0400) || defined(_WIN32_DCOM) 288 operator T const *()
const 478 {*
ppv=static_cast<BASE*>(
this); this->
AddRef();
return S_OK;}
508 template<
typename BASE,
typename OBJ>
552 #ifndef _NO_COMUTIL // _com_ptr available? 557 typedef IShellFolderPtr
super;
567 bool empty()
const {
return !
operator bool();}
571 #define IShellLinkPtr IShellLinkWPtr 573 #define IShellLinkPtr IShellLinkAPtr 579 typedef IShellLinkPtr
super;
587 bool empty()
const {
return !
operator bool();}
590 #else // _com_ptr not available -> use SIfacePtr 626 #define path_from_pidl path_from_pidlW 628 #define path_from_pidl path_from_pidlA 638 #define ILGetSize ILGetSize_local 641 #ifdef UNICODE // CFSTR_FILENAME was defined wrong in previous versions of MinGW. 642 #define CFSTR_FILENAMEW TEXT("FileNameW") 643 #undef CFSTR_FILENAME 644 #define CFSTR_FILENAME CFSTR_FILENAMEW 661 CONTEXT(
"ShellPath::ShellPath(IShellFolder*, LPCWSTR)");
671 OBJ_CONTEXT(
"ShellPath::ShellPath(LPCWSTR)",
path);
681 CONTEXT(
"ShellPath::ShellPath(IShellFolder*, LPCSTR)");
694 CONTEXT(
"ShellPath::ShellPath(LPCSTR)");
849 CONTEXT(
"ShellPath::get_folder()");
858 #if defined(__WINE__) && defined(NONAMELESSUNION) // Wine doesn't know of unnamed union members and uses some macros instead. 859 #define UNION_MEMBER(x) DUMMYUNIONNAME.##x 861 #define UNION_MEMBER(x) x 868 #define StrRet StrRetW 871 #define StrRet StrRetA 1049 CONTEXT(
"ShellItemEnumerator::ShellItemEnumerator()");
1066 if (
_stgm.hGlobal) {
1077 fetc.cfFormat = CF_IDLIST;
1079 fetc.dwAspect = DVASPECT_CONTENT;
1081 fetc.tymed = TYMED_HGLOBAL;
friend bool operator<(const ShellPath &a, const ShellPath &b)
void split(ShellPath &parent, ShellPath &obj) const
IComSrvBase(REFIID uuid_base)
COMException(HRESULT hr, const String &obj)
file system path of special folder
HRESULT CreateInstance(REFIID clsid, REFIID riid)
HRESULT GetData(IDataObject *selection)
SpecialFolderFSPath(int folder, HWND hwnd)
file system path of special folder
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define CFSTR_SHELLIDLIST
#define WideCharToMultiByte
Retrieval of file system paths of ShellPath objects.
void Free([in] LPVOID pv)
const T * operator->() const
ShellPath(LPITEMIDLIST p)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
TCHAR _displayname[MAX_PATH]
SIfacePtr(IUnknown *unknown, REFIID riid)
GLdouble GLdouble GLdouble r
ShellPath(IShellFolder *folder, LPCWSTR path)
SpecialFolder(int folder, HWND hwnd)
Retrieval of special shell folder paths.
const T & operator *() const
void operator=(SShellPtr const &)
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
HRESULT path_from_pidlW(IShellFolder *folder, LPCITEMIDLIST pidl, LPWSTR buffer, int len)
TCHAR _fullpath[MAX_PATH]
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
easy retrieval of multi byte strings out of STRRET structures
void GetString(const SHITEMID &shiid, LPSTR b, int l)
GLint GLint GLint GLint GLint x
STDMETHODIMP_(ULONG) Release()
IShellFolder smart pointer.
HRESULT ShellFolderContextMenu(IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *ppidl, int x, int y, CtxMenuInterfaces &cm_ifs)
void operator=(const SHITEMID &o)
SShellPtr< ITEMIDLIST > super
static IParseDisplayName ParseDisplayName
SIfacePtr & operator=(T *p)
GLfloat GLfloat GLfloat GLfloat h
IComSrvQI(REFIID uuid_base)
Exception with context information.
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
T const * operator->() const
static UINT WPARAM LPARAM lparam
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
UINT ILGetSize_local(LPCITEMIDLIST pidl)
IShellLink smart pointer.
COMExceptionBase(HRESULT hr)
String get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const
void attach(IShellFolder *parent, LPCITEMIDLIST pidl)
easy retrieval of wide char strings out of STRRET structures
#define FORMAT_MESSAGE_FROM_SYSTEM
OLE initialisation for drag drop support.
COMException(HRESULT hr, const char *file, int line)
#define SHBrowseForFolder
typedef bool(CARDLIBPROC *pCanDragProc)(CardRegion &stackobj
TCHAR _fullpath[MAX_PATH]
HRESULT path_from_pidlA(IShellFolder *folder, LPCITEMIDLIST pidl, LPSTR buffer, int len)
ExtContextMenuHandlerT(HWND hwnd)
GLboolean GLboolean GLboolean b
ShellFolder & GetDesktopFolder()
ShellPath(const ShellPath &o)
void operator+=(const SHITEMID &o)
COMException(HRESULT hr, const String &obj, const char *file, int line)
static IShellFolder ShellFolder
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
wrapper template class for pointers to shell objects managed by IMalloc
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv)
SIfacePtr< IShellLink > super
COM ExceptionBase class as replacement for _com_error.
void operator=(ITEMIDLIST *p)
Retrieval of special shell folder.
STDMETHODIMP_(ULONG) AddRef()
HRESULT QueryInterface(REFIID riid, I *p)
ShellPath(LPCITEMIDLIST p)
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv)
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
void GetString(const SHITEMID &shiid, LPWSTR b, int l)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
void CheckError(HRESULT hr)
#define memcpy(s1, s2, n)
void GetUIObjectOf(REFIID riid, LPVOID *ppvOut, HWND hWnd=0, ShellFolder &sf=GetDesktopFolder())
#define SHGetPathFromIDList
#define RegisterClipboardFormat
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Browse dialog operating on shell namespace.
LPVOID Alloc([in] SIZE_T cb)
static CommonShellMalloc s_cmn_shell_malloc
ShellPath create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
caching of desktop ShellFolder object
void assign(LPCITEMIDLIST pidl, size_t size)
void operator=(SIfacePtr const &o)
void operator=(const ShellPath &o)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
SShellPtr(const SShellPtr &)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
static ULONG WINAPI AddRef(IStream *iface)
GLint GLint GLint GLint GLint GLint y
void assign(LPCITEMIDLIST pidl)
#define MultiByteToWideChar
wrapper class for COM interface pointers
CtxMenuInterfaces _cm_ifs
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
ShellLinkPtr(IShellLink *p)
SIfacePtr(const SIfacePtr &o)
ExtContextMenuHandlerT(HWND hwnd, const PARA &info)
HRESULT name_from_pidl(IShellFolder *folder, LPCITEMIDLIST pidl, LPTSTR buffer, int len, SHGDNF flags)
ShellPath(IShellFolder *folder, LPCSTR path)
GLboolean GLboolean GLboolean GLboolean a
ShellFolder get_folder(IShellFolder *parent)
wrapper class for IMalloc with usage of common allocator
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
FolderBrowser(HWND owner, UINT flags, LPCTSTR title, LPCITEMIDLIST root=0)
We use a common IMalloc object for all shell memory allocations.
wrapper class for item ID lists
#define IsEqualIID(riid1, riid2)
FileSysShellPath(const ShellPath &o)
Shell folder of the desktop.
static UINT WPARAM wparam
SIfacePtr< IShellFolder > super
LPCTSTR ErrorMessage() const
Shell folder path of the desktop.
SpecialFolderPath(int folder, HWND hwnd)