]>
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
7 // Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_WRAPSHL_H_
12 #define _WX_MSW_WRAPSHL_H_
14 #include "wx/msw/wrapwin.h"
25 #include "wx/msw/winundef.h"
29 // ----------------------------------------------------------------------------
30 // wxItemIdList implements RAII on top of ITEMIDLIST
31 // ----------------------------------------------------------------------------
36 // ctor takes ownership of the item and will free it
37 wxItemIdList(LPITEMIDLIST pidl
)
42 static void Free(LPITEMIDLIST pidl
)
47 SHGetMalloc(&pMalloc
);
55 wxLogLastError(wxT("SHGetMalloc"));
65 // implicit conversion to LPITEMIDLIST
66 operator LPITEMIDLIST() const { return m_pidl
; }
68 // get the corresponding path, returns empty string on error
69 wxString
GetPath() const
72 if ( !SHGetPathFromIDList(m_pidl
, wxStringBuffer(path
, MAX_PATH
)) )
74 wxLogLastError(wxT("SHGetPathFromIDList"));
83 wxDECLARE_NO_COPY_CLASS(wxItemIdList
);
86 // enable autocompleting filenames in the text control with given HWND
88 // this only works on systems with shlwapi.dll 5.0 or later
90 // implemented in src/msw/utilsgui.cpp
91 extern bool wxEnableFileNameAutoComplete(HWND hwnd
);
93 #endif // _WX_MSW_WRAPSHL_H_