From 94aff795d414f4d55ecd7eda44362c4c57023ce4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 14 Aug 2009 00:05:56 +0000 Subject: [PATCH] Added wxStandardPaths::MSWGetShellDir(). This function allows to get the location of Windows shell special folders not covered by wxStandardPaths methods (yet), e.g. CSIDL_DESKTOPDIRECTORY. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/stdpaths.h | 4 ++++ interface/wx/stdpaths.h | 20 ++++++++++++++++++++ src/msw/stdpaths.cpp | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/include/wx/msw/stdpaths.h b/include/wx/msw/stdpaths.h index e6668daa14..a9d53f38a6 100644 --- a/include/wx/msw/stdpaths.h +++ b/include/wx/msw/stdpaths.h @@ -62,6 +62,10 @@ public: // Undo the effects of all preceding IgnoreAppSubDir() calls. void DontIgnoreAppSubDir(); + + // Returns the directory corresponding to the specified Windows shell CSIDL + static wxString MSWGetShellDir(int csidl); + protected: // get the path corresponding to the given standard CSIDL_XXX constant static wxString DoGetDirectory(int csidl); diff --git a/interface/wx/stdpaths.h b/interface/wx/stdpaths.h index fa4d965c4f..78e1c8c787 100644 --- a/interface/wx/stdpaths.h +++ b/interface/wx/stdpaths.h @@ -275,6 +275,26 @@ public: */ void IgnoreAppBuildSubDirs(); + /** + Returns location of Windows shell special folder. + + This function is, by definition, MSW-specific. It can be used to access + pre-defined shell directories not covered by the existing methods of + this class, e.g.: + @code + #ifdef __WXMSW__ + // get the location of files waiting to be burned on a CD + wxString cdburnArea = + wxStandardPaths::MSWGetShellDir(CSIDL_CDBURN_AREA); + #endif // __WXMSW__ + @endcode + + @param csidl + + @since 2.9.1 + */ + static wxString MSWGetShellDir(int csidl); + /** Lets wxStandardPaths know about the real program installation prefix on a Unix system. By default, the value returned by GetInstallPrefix() is used. diff --git a/src/msw/stdpaths.cpp b/src/msw/stdpaths.cpp index 579844fad0..3667c1e954 100644 --- a/src/msw/stdpaths.cpp +++ b/src/msw/stdpaths.cpp @@ -321,6 +321,12 @@ void wxStandardPaths::DontIgnoreAppSubDir() m_appDir.clear(); } +/* static */ +wxString wxStandardPaths::MSWGetShellDir(int csidl) +{ + return DoGetDirectory(csidl); +} + // ---------------------------------------------------------------------------- // public functions // ---------------------------------------------------------------------------- -- 2.45.2