]>
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_
15 #include "wx/msw/wrapwin.h"
26 #include "wx/msw/winundef.h"
30 // ----------------------------------------------------------------------------
31 // wxItemIdList implements RAII on top of ITEMIDLIST
32 // ----------------------------------------------------------------------------
37 // ctor takes ownership of the item and will free it
38 wxItemIdList(LPITEMIDLIST pidl
)
43 static void Free(LPITEMIDLIST pidl
)
48 SHGetMalloc(&pMalloc
);
56 wxLogLastError(wxT("SHGetMalloc"));
66 // implicit conversion to LPITEMIDLIST
67 operator LPITEMIDLIST() const { return m_pidl
; }
69 // get the corresponding path, returns empty string on error
70 wxString
GetPath() const
73 if ( !SHGetPathFromIDList(m_pidl
, wxStringBuffer(path
, MAX_PATH
)) )
75 wxLogLastError(wxT("SHGetPathFromIDList"));
84 wxDECLARE_NO_COPY_CLASS(wxItemIdList
);
87 // enable autocompleting filenames in the text control with given HWND
89 // this only works on systems with shlwapi.dll 5.0 or later
91 // implemented in src/msw/utilsgui.cpp
92 extern bool wxEnableFileNameAutoComplete(HWND hwnd
);
94 #endif // _WX_MSW_WRAPSHL_H_