diff options
Diffstat (limited to 'lib/Thumbnail')
-rw-r--r-- | lib/Thumbnail/thumbnail.cpp | 28 | ||||
-rw-r--r-- | lib/Thumbnail/thumbnail.h | 8 |
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/Thumbnail/thumbnail.cpp b/lib/Thumbnail/thumbnail.cpp index 0176f89b..d35f15c3 100644 --- a/lib/Thumbnail/thumbnail.cpp +++ b/lib/Thumbnail/thumbnail.cpp @@ -27,22 +27,22 @@ thumb::HICON thumb::getThumbnail(const wchar_t* filename, int requestedSize) //r { const std::wstring filenameStr(filename); - ComPtr<IShellFolder> shellFolder; + ComPtr<IShellFolder> desktopFolder; { - HRESULT hr = ::SHGetDesktopFolder(shellFolder.init()); - if (FAILED(hr) || !shellFolder) + HRESULT hr = ::SHGetDesktopFolder(desktopFolder.init()); + if (FAILED(hr) || !desktopFolder) return nullptr; } PIDLIST_RELATIVE pidlFolder = nullptr; { - const std::wstring& pathName = beforeLast(filenameStr, '\\'); - HRESULT hr = shellFolder->ParseDisplayName(nullptr, // [in] HWND hwnd, - nullptr, // [in] IBindCtx *pbc, - const_cast<LPWSTR>(pathName.c_str()), // [in] LPWSTR pszDisplayName, - nullptr, // [out] ULONG *pchEaten, - &pidlFolder, // [out] PIDLIST_RELATIVE* ppidl, - nullptr); // [in, out] ULONG *pdwAttributes + const std::wstring& pathName = beforeLast(filenameStr, L'\\'); + HRESULT hr = desktopFolder->ParseDisplayName(nullptr, // [in] HWND hwnd, + nullptr, // [in] IBindCtx *pbc, + const_cast<LPWSTR>(pathName.c_str()), // [in] LPWSTR pszDisplayName, + nullptr, // [out] ULONG *pchEaten, + &pidlFolder, // [out] PIDLIST_RELATIVE* ppidl, + nullptr); // [in, out] ULONG *pdwAttributes if (FAILED(hr) || !pidlFolder) return nullptr; } @@ -50,16 +50,16 @@ thumb::HICON thumb::getThumbnail(const wchar_t* filename, int requestedSize) //r ComPtr<IShellFolder> imageFolder; { - HRESULT hr = shellFolder->BindToObject(pidlFolder, // [in] PCUIDLIST_RELATIVE pidl, - nullptr, - IID_PPV_ARGS(imageFolder.init())); + HRESULT hr = desktopFolder->BindToObject(pidlFolder, // [in] PCUIDLIST_RELATIVE pidl, + nullptr, // [in] IBindCtx *pbc, + IID_PPV_ARGS(imageFolder.init())); if (FAILED(hr) || !imageFolder) return nullptr; } PIDLIST_RELATIVE pidImage = nullptr; { - const std::wstring& shortName = afterLast(filenameStr, '\\'); + const std::wstring& shortName = afterLast(filenameStr, L'\\'); HRESULT hr = imageFolder->ParseDisplayName(nullptr, // [in] HWND hwnd, nullptr, // [in] IBindCtx *pbc, const_cast<LPWSTR>(shortName.c_str()), // [in] LPWSTR pszDisplayName, diff --git a/lib/Thumbnail/thumbnail.h b/lib/Thumbnail/thumbnail.h index b8b95d8f..6c3575b5 100644 --- a/lib/Thumbnail/thumbnail.h +++ b/lib/Thumbnail/thumbnail.h @@ -49,15 +49,15 @@ HICON getIconByIndex(int iconIndex, int shilIconType); //return 0 on failure, ca /*---------- |typedefs| ----------*/ -typedef HICON (*GetThumbnailFct )(const wchar_t* filename, int requestedSize); -typedef HICON (*GetIconByIndexFct)(int iconIndex, int shilIconType); +typedef HICON (*FunType_getThumbnail )(const wchar_t* filename, int requestedSize); +typedef HICON (*FunType_getIconByIndex)(int iconIndex, int shilIconType); /*-------------- |symbol names| --------------*/ //(use const pointers to ensure internal linkage) -const char getThumbnailFctName [] = "getThumbnail"; -const char getIconByIndexFctName [] = "getIconByIndex"; +const char funName_getThumbnail [] = "getThumbnail"; +const char funName_getIconByIndex[] = "getIconByIndex"; /*--------------- |library names| |