1 // shell.hpp --------------------------------------------------------------//
3 // Copyright 2016 Klemens D. Morgenstern
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 #ifndef BOOST_DETAIL_WINAPI_SHELL_HPP_
9 #define BOOST_DETAIL_WINAPI_SHELL_HPP_
11 #include <boost/detail/winapi/basic_types.hpp>
12 #include <boost/detail/winapi/limits.hpp>
13 #if defined( BOOST_USE_WINDOWS_H )
17 #ifdef BOOST_HAS_PRAGMA_ONCE
21 #if !defined( BOOST_USE_WINDOWS_H )
24 BOOST_DETAIL_WINAPI_DECLARE_HANDLE(HICON);
26 #if !defined( BOOST_NO_ANSI_APIS )
31 #if !defined( BOOST_NO_ANSI_APIS )
32 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_PTR_ WINAPI SHGetFileInfoA(
33 boost::detail::winapi::LPCSTR_ pszPath,
34 boost::detail::winapi::DWORD_ dwFileAttributes,
35 ::_SHFILEINFOA *psfinsigned,
36 boost::detail::winapi::UINT_ cbFileInfons,
37 boost::detail::winapi::UINT_ uFlags);
40 BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_PTR_ WINAPI SHGetFileInfoW(
41 boost::detail::winapi::LPCWSTR_ pszPath,
42 boost::detail::winapi::DWORD_ dwFileAttributes,
43 ::_SHFILEINFOW *psfinsigned,
44 boost::detail::winapi::UINT_ cbFileInfons,
45 boost::detail::winapi::UINT_ uFlags);
48 #endif // !defined( BOOST_USE_WINDOWS_H )
54 typedef ::HICON HICON_;
56 #if defined( BOOST_USE_WINDOWS_H )
58 const DWORD_ SHGFI_ICON_ = SHGFI_ICON;
59 const DWORD_ SHGFI_DISPLAYNAME_ = SHGFI_DISPLAYNAME;
60 const DWORD_ SHGFI_TYPENAME_ = SHGFI_TYPENAME;
61 const DWORD_ SHGFI_ATTRIBUTES_ = SHGFI_ATTRIBUTES;
62 const DWORD_ SHGFI_ICONLOCATION_ = SHGFI_ICONLOCATION;
63 const DWORD_ SHGFI_EXETYPE_ = SHGFI_EXETYPE;
64 const DWORD_ SHGFI_SYSICONINDEX_ = SHGFI_SYSICONINDEX;
65 const DWORD_ SHGFI_LINKOVERLAY_ = SHGFI_LINKOVERLAY;
66 const DWORD_ SHGFI_SELECTED_ = SHGFI_SELECTED;
67 const DWORD_ SHGFI_ATTR_SPECIFIED_ = SHGFI_ATTR_SPECIFIED;
68 const DWORD_ SHGFI_LARGEICON_ = SHGFI_LARGEICON;
69 const DWORD_ SHGFI_SMALLICON_ = SHGFI_SMALLICON;
70 const DWORD_ SHGFI_OPENICON_ = SHGFI_OPENICON;
71 const DWORD_ SHGFI_SHELLICONSIZE_ = SHGFI_SHELLICONSIZE;
72 const DWORD_ SHGFI_PIDL_ = SHGFI_PIDL;
73 const DWORD_ SHGFI_USEFILEATTRIBUTES_ = SHGFI_USEFILEATTRIBUTES;
75 #else // defined( BOOST_USE_WINDOWS_H )
77 const DWORD_ SHGFI_ICON_ = 0x000000100;
78 const DWORD_ SHGFI_DISPLAYNAME_ = 0x000000200;
79 const DWORD_ SHGFI_TYPENAME_ = 0x000000400;
80 const DWORD_ SHGFI_ATTRIBUTES_ = 0x000000800;
81 const DWORD_ SHGFI_ICONLOCATION_ = 0x000001000;
82 const DWORD_ SHGFI_EXETYPE_ = 0x000002000;
83 const DWORD_ SHGFI_SYSICONINDEX_ = 0x000004000;
84 const DWORD_ SHGFI_LINKOVERLAY_ = 0x000008000;
85 const DWORD_ SHGFI_SELECTED_ = 0x000010000;
86 const DWORD_ SHGFI_ATTR_SPECIFIED_ = 0x000020000;
87 const DWORD_ SHGFI_LARGEICON_ = 0x000000000;
88 const DWORD_ SHGFI_SMALLICON_ = 0x000000001;
89 const DWORD_ SHGFI_OPENICON_ = 0x000000002;
90 const DWORD_ SHGFI_SHELLICONSIZE_ = 0x000000004;
91 const DWORD_ SHGFI_PIDL_ = 0x000000008;
92 const DWORD_ SHGFI_USEFILEATTRIBUTES_ = 0x000000010;
94 #endif // defined( BOOST_USE_WINDOWS_H )
96 // These constants are only declared for _WIN32_IE >= 0x0500. We don't set IE version
97 // and 5.0 is the default version since NT4 SP6, so just define the constants unconditionally.
98 const DWORD_ SHGFI_ADDOVERLAYS_ = 0x000000020;
99 const DWORD_ SHGFI_OVERLAYINDEX_ = 0x000000040;
101 typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SHFILEINFOA {
105 CHAR_ szDisplayName[MAX_PATH_];
106 CHAR_ szTypeName[80];
109 typedef struct BOOST_DETAIL_WINAPI_MAY_ALIAS _SHFILEINFOW {
113 WCHAR_ szDisplayName[MAX_PATH_];
114 WCHAR_ szTypeName[80];
117 #if !defined( BOOST_NO_ANSI_APIS )
119 BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoA(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
121 return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
124 BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
126 return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
129 #endif // BOOST_NO_ANSI_APIS
131 BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoW(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
133 return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
136 BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
138 return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
145 #endif // BOOST_DETAIL_WINAPI_SHELL_HPP_