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_
15 #include "wx/msw/wrapwin.h"
26 #include "wx/msw/winundef.h"
28 // ----------------------------------------------------------------------------
29 // wxItemIdList implements RAII on top of ITEMIDLIST
30 // ----------------------------------------------------------------------------
35 // ctor takes ownership of the item and will free it
36 wxItemIdList(LPITEMIDLIST pidl
)
41 static void Free(LPITEMIDLIST pidl
)
46 SHGetMalloc(&pMalloc
);
54 wxLogLastError(wxT("SHGetMalloc"));
64 // implicit conversion to LPITEMIDLIST
65 operator LPITEMIDLIST() const { return m_pidl
; }
67 // get the corresponding path, returns empty string on error
68 wxString
GetPath() const
71 if ( !SHGetPathFromIDList(m_pidl
, wxStringBuffer(path
, MAX_PATH
)) )
73 wxLogLastError(_T("SHGetPathFromIDList"));
82 DECLARE_NO_COPY_CLASS(wxItemIdList
)
85 // enable autocompleting filenames in the text control with given HWND
87 // this only works on systems with shlwapi.dll 5.0 or later
89 // implemented in src/msw/utilsgui.cpp
90 extern bool wxEnableFileNameAutoComplete(HWND hwnd
);
92 #endif // _WX_MSW_WRAPSHL_H_