18 #ifndef _HIDE_GLOBAL_ASYNC_STATUS 19 #define _HIDE_GLOBAL_ASYNC_STATUS //Else AsyncInfo.h declares a global Error (and Started, Completed, Canceled), ambiguous with ZenLib::Error with "using namespace ZenLib" 22 #include <windows.foundation.h> 23 #include <windows.storage.h> 52 #if defined(WINDOWS) && !defined(WINDOWS_UWP) && !defined(ZENLIB_USEWX) 58 std::wstring FileName_To_Wide(
const Ztring &File_Name);
61 #if defined(WINDOWS) && !defined(WINDOWS_UWP) && !defined(UNICODE) && !defined(ZENLIB_USEWX) 66 std::wstring FileName_To_Wide_Existing(
const Ztring &File_Name);
73 Ztring
OpenFolder_Show(
void* Handle,
const Ztring &Title,
const Ztring &Caption);
80 inline HRESULT Await(
const Microsoft::WRL::ComPtr<T> &Operation)
85 Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncInfo> Info;
86 HRESULT Result=Operation.As(&Info);
90 ABI::Windows::Foundation::AsyncStatus Status;
91 while (SUCCEEDED(Result=Info->get_Status(&Status)) && Status==ABI::Windows::Foundation::AsyncStatus::Started)
94 if (FAILED(Result) || Status!=ABI::Windows::Foundation::AsyncStatus::Completed) {
96 Result=Info->get_ErrorCode(&Error_Code);
111 explicit WinRT_Name(
const Ztring &Name) : Wide(Name.To_Unicode()) {}
112 Microsoft::WRL::Wrappers::HStringReference Ref()
const {
return Microsoft::WRL::Wrappers::HStringReference(Wide.c_str(), (
unsigned int)Wide.size());}
115 const std::wstring Wide;
118 HRESULT Add_Item_To_FUA(Microsoft::WRL::Wrappers::HStringReference Path, Microsoft::WRL::ComPtr<ABI::Windows::Storage::IStorageItem> &Item);
119 HRESULT Get_File(Microsoft::WRL::Wrappers::HStringReference File_Name, Microsoft::WRL::ComPtr<ABI::Windows::Storage::IStorageFile> &File);
120 HRESULT Get_Folder(Microsoft::WRL::Wrappers::HStringReference Folder_Name, Microsoft::WRL::ComPtr<ABI::Windows::Storage::IStorageFolder> &Folder);
void Shell_Execute(const Ztring &ToExecute)
Definition: BitStream.h:23
Ztring FileName_From_Native(const char *File_Name)
std::string FileName_To_Native(const Ztring &File_Name)
Ztring OpenFolder_Show(void *Handle, const Ztring &Title, const Ztring &Caption)