Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:47

0001 /*
0002  * Copyright 2016 Klemens D. Morgenstern
0003  *
0004  * Distributed under the Boost Software License, Version 1.0.
0005  * See http://www.boost.org/LICENSE_1_0.txt
0006  */
0007 
0008 #ifndef BOOST_WINAPI_SHELL_HPP_INCLUDED_
0009 #define BOOST_WINAPI_SHELL_HPP_INCLUDED_
0010 
0011 #include <boost/winapi/basic_types.hpp>
0012 #include <boost/winapi/limits.hpp>
0013 #if defined( BOOST_USE_WINDOWS_H )
0014 #include <shellapi.h>
0015 #endif
0016 
0017 #ifdef BOOST_HAS_PRAGMA_ONCE
0018 #pragma once
0019 #endif
0020 
0021 #if BOOST_WINAPI_PARTITION_DESKTOP
0022 
0023 #include <boost/winapi/detail/header.hpp>
0024 
0025 #if !defined( BOOST_USE_WINDOWS_H )
0026 extern "C" {
0027 
0028 BOOST_WINAPI_DETAIL_DECLARE_HANDLE(HICON);
0029 
0030 #if !defined( BOOST_NO_ANSI_APIS )
0031 struct _SHFILEINFOA;
0032 #endif
0033 struct _SHFILEINFOW;
0034 
0035 #if !defined( BOOST_NO_ANSI_APIS )
0036 BOOST_WINAPI_IMPORT boost::winapi::DWORD_PTR_ BOOST_WINAPI_WINAPI_CC SHGetFileInfoA(
0037     boost::winapi::LPCSTR_ pszPath,
0038     boost::winapi::DWORD_ dwFileAttributes,
0039     ::_SHFILEINFOA *psfinsigned,
0040     boost::winapi::UINT_ cbFileInfons,
0041     boost::winapi::UINT_ uFlags);
0042 #endif
0043 
0044 BOOST_WINAPI_IMPORT boost::winapi::DWORD_PTR_ BOOST_WINAPI_WINAPI_CC SHGetFileInfoW(
0045     boost::winapi::LPCWSTR_ pszPath,
0046     boost::winapi::DWORD_ dwFileAttributes,
0047     ::_SHFILEINFOW *psfinsigned,
0048     boost::winapi::UINT_ cbFileInfons,
0049     boost::winapi::UINT_ uFlags);
0050 
0051 } // extern "C"
0052 #endif // !defined( BOOST_USE_WINDOWS_H )
0053 
0054 namespace boost {
0055 namespace winapi {
0056 
0057 typedef ::HICON HICON_;
0058 
0059 #if defined( BOOST_USE_WINDOWS_H )
0060 
0061 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ICON_              = SHGFI_ICON;
0062 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_DISPLAYNAME_       = SHGFI_DISPLAYNAME;
0063 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_TYPENAME_          = SHGFI_TYPENAME;
0064 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ATTRIBUTES_        = SHGFI_ATTRIBUTES;
0065 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ICONLOCATION_      = SHGFI_ICONLOCATION;
0066 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_EXETYPE_           = SHGFI_EXETYPE;
0067 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SYSICONINDEX_      = SHGFI_SYSICONINDEX;
0068 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_LINKOVERLAY_       = SHGFI_LINKOVERLAY;
0069 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SELECTED_          = SHGFI_SELECTED;
0070 #if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K)
0071 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ATTR_SPECIFIED_    = SHGFI_ATTR_SPECIFIED;
0072 #endif
0073 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_LARGEICON_         = SHGFI_LARGEICON;
0074 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SMALLICON_         = SHGFI_SMALLICON;
0075 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_OPENICON_          = SHGFI_OPENICON;
0076 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SHELLICONSIZE_     = SHGFI_SHELLICONSIZE;
0077 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_PIDL_              = SHGFI_PIDL;
0078 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_USEFILEATTRIBUTES_ = SHGFI_USEFILEATTRIBUTES;
0079 
0080 #else // defined( BOOST_USE_WINDOWS_H )
0081 
0082 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ICON_              = 0x000000100;
0083 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_DISPLAYNAME_       = 0x000000200;
0084 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_TYPENAME_          = 0x000000400;
0085 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ATTRIBUTES_        = 0x000000800;
0086 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ICONLOCATION_      = 0x000001000;
0087 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_EXETYPE_           = 0x000002000;
0088 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SYSICONINDEX_      = 0x000004000;
0089 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_LINKOVERLAY_       = 0x000008000;
0090 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SELECTED_          = 0x000010000;
0091 #if (BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN2K)
0092 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ATTR_SPECIFIED_    = 0x000020000;
0093 #endif
0094 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_LARGEICON_         = 0x000000000;
0095 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SMALLICON_         = 0x000000001;
0096 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_OPENICON_          = 0x000000002;
0097 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_SHELLICONSIZE_     = 0x000000004;
0098 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_PIDL_              = 0x000000008;
0099 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_USEFILEATTRIBUTES_ = 0x000000010;
0100 
0101 #endif // defined( BOOST_USE_WINDOWS_H )
0102 
0103 // These constants are only declared for _WIN32_IE >= 0x0500. We don't set IE version
0104 // and 5.0 is the default version since NT4 SP6, so just define the constants unconditionally.
0105 // They are also missing from MinGW.
0106 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_ADDOVERLAYS_       = 0x000000020;
0107 BOOST_CONSTEXPR_OR_CONST DWORD_ SHGFI_OVERLAYINDEX_      = 0x000000040;
0108 
0109 typedef struct BOOST_MAY_ALIAS _SHFILEINFOA {
0110     HICON_ hIcon;
0111     int iIcon;
0112     DWORD_ dwAttributes;
0113     CHAR_ szDisplayName[MAX_PATH_];
0114     CHAR_ szTypeName[80];
0115 } SHFILEINFOA_;
0116 
0117 typedef struct BOOST_MAY_ALIAS _SHFILEINFOW {
0118     HICON_ hIcon;
0119     int iIcon;
0120     DWORD_ dwAttributes;
0121     WCHAR_ szDisplayName[MAX_PATH_];
0122     WCHAR_ szTypeName[80];
0123 } SHFILEINFOW_;
0124 
0125 #if !defined( BOOST_NO_ANSI_APIS )
0126 
0127 BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoA(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
0128 {
0129     return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
0130 }
0131 
0132 BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOA_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
0133 {
0134     return ::SHGetFileInfoA(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOA* >(psfinsigned), cbFileInfons, uFlags);
0135 }
0136 
0137 #endif // BOOST_NO_ANSI_APIS
0138 
0139 BOOST_FORCEINLINE DWORD_PTR_ SHGetFileInfoW(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
0140 {
0141     return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
0142 }
0143 
0144 BOOST_FORCEINLINE DWORD_PTR_ sh_get_file_info(LPCWSTR_ pszPath, DWORD_ dwFileAttributes, SHFILEINFOW_* psfinsigned, UINT_ cbFileInfons, UINT_ uFlags)
0145 {
0146     return ::SHGetFileInfoW(pszPath, dwFileAttributes, reinterpret_cast< ::_SHFILEINFOW* >(psfinsigned), cbFileInfons, uFlags);
0147 }
0148 
0149 }
0150 }
0151 
0152 #include <boost/winapi/detail/footer.hpp>
0153 
0154 #endif // BOOST_WINAPI_PARTITION_DESKTOP
0155 #endif // BOOST_WINAPI_SHELL_HPP_INCLUDED_