diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-11-23 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:57 +0300 |
commit | b717a4dbfe15fd7540e68e6c5ccbe91901bbadba (patch) | |
tree | c89b25a1f9a690e69cd20e313be9eb4180ee7a6f /CPP/7zip/UI/FileManager/RootFolder.cpp | |
parent | c10e6b16f6d5484ed896b2c614cb7fb77f336d24 (diff) |
4.61 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/RootFolder.cpp')
-rwxr-xr-x | CPP/7zip/UI/FileManager/RootFolder.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/CPP/7zip/UI/FileManager/RootFolder.cpp b/CPP/7zip/UI/FileManager/RootFolder.cpp index 0dec5412..1cb71e5f 100755 --- a/CPP/7zip/UI/FileManager/RootFolder.cpp +++ b/CPP/7zip/UI/FileManager/RootFolder.cpp @@ -81,17 +81,24 @@ STDMETHODIMP CRootFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIA return S_OK; } +typedef BOOL (WINAPI *SHGetSpecialFolderPathWp)(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate); +typedef BOOL (WINAPI *SHGetSpecialFolderPathAp)(HWND hwnd, LPSTR pszPath, int csidl, BOOL fCreate); + UString GetMyDocsPath() { UString us; WCHAR s[MAX_PATH + 1]; - if (SHGetSpecialFolderPathW(0, s, CSIDL_PERSONAL, FALSE)) + SHGetSpecialFolderPathWp getW = (SHGetSpecialFolderPathWp) + ::GetProcAddress(::GetModuleHandleA("shell32.dll"), "SHGetSpecialFolderPathW"); + if (getW && getW(0, s, CSIDL_PERSONAL, FALSE)) us = s; #ifndef _UNICODE else { + SHGetSpecialFolderPathAp getA = (SHGetSpecialFolderPathAp) + ::GetProcAddress(::GetModuleHandleA("shell32.dll"), "SHGetSpecialFolderPathA"); CHAR s2[MAX_PATH + 1]; - if (SHGetSpecialFolderPathA(0, s2, CSIDL_PERSONAL, FALSE)) + if (getA && getA(0, s2, CSIDL_PERSONAL, FALSE)) us = GetUnicodeString(s2); } #endif |