]>
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 #include "wx/msw/winundef.h" 
  25 // ---------------------------------------------------------------------------- 
  26 // wxItemIdList implements RAII on top of ITEMIDLIST 
  27 // ---------------------------------------------------------------------------- 
  32     // ctor takes ownership of the item and will free it 
  33     wxItemIdList(LPITEMIDLIST pidl
) 
  38     static void Free(LPITEMIDLIST pidl
) 
  43             SHGetMalloc(&pMalloc
); 
  51                 wxLogLastError(wxT("SHGetMalloc")); 
  61     // implicit conversion to LPITEMIDLIST 
  62     operator LPITEMIDLIST() const { return m_pidl
; } 
  64     // get the corresponding path, returns empty string on error 
  65     wxString 
GetPath() const 
  68         if ( !SHGetPathFromIDList(m_pidl
, wxStringBuffer(path
, MAX_PATH
)) ) 
  70             wxLogLastError(_T("SHGetPathFromIDList")); 
  79     DECLARE_NO_COPY_CLASS(wxItemIdList
) 
  82 // enable autocompleting filenames in the text control with given HWND 
  84 // this only works on systems with shlwapi.dll 5.0 or later 
  86 // implemented in src/msw/utilsgui.cpp 
  87 extern bool wxEnableFileNameAutoComplete(HWND hwnd
); 
  89 #endif // _WX_MSW_WRAPSHL_H_