]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/wrapshl.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/wrapshl.h
3 // Purpose: wrapper class for stuff from shell32.dll
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_WRAPSHL_H_
13 #define _WX_MSW_WRAPSHL_H_
23 // ----------------------------------------------------------------------------
24 // wxItemIdList implements RAII on top of ITEMIDLIST
25 // ----------------------------------------------------------------------------
30 // ctor takes ownership of the item and will free it
31 wxItemIdList(LPITEMIDLIST pidl
)
36 static void Free(LPITEMIDLIST pidl
)
41 SHGetMalloc(&pMalloc
);
49 wxLogLastError(wxT("SHGetMalloc"));
59 // implicit conversion to LPITEMIDLIST
60 operator LPITEMIDLIST() const { return m_pidl
; }
62 // get the corresponding path, returns empty string on error
63 wxString
GetPath() const
66 if ( !SHGetPathFromIDList(m_pidl
, wxStringBuffer(path
, MAX_PATH
)) )
68 wxLogLastError(_T("SHGetPathFromIDList"));
77 DECLARE_NO_COPY_CLASS(wxItemIdList
)
80 #endif // _WX_MSW_WRAPSHL_H_