Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2008-11-23 03:00:00 +0300
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:57 +0300
commitb717a4dbfe15fd7540e68e6c5ccbe91901bbadba (patch)
treec89b25a1f9a690e69cd20e313be9eb4180ee7a6f /CPP/7zip/UI/FileManager/RootFolder.cpp
parentc10e6b16f6d5484ed896b2c614cb7fb77f336d24 (diff)
4.61 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/RootFolder.cpp')
-rwxr-xr-xCPP/7zip/UI/FileManager/RootFolder.cpp11
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