// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Microsoft_Windows_AppLifecycle_H #define WINRT_Microsoft_Windows_AppLifecycle_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/impl/Windows.ApplicationModel.Core.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Microsoft.Windows.AppLifecycle.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics::RegisterForFileTypeActivation(array_view supportedFileTypes, param::hstring const& logo, param::hstring const& displayName, array_view supportedVerbs, param::hstring const& exePath) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IActivationRegistrationManagerStatics)->RegisterForFileTypeActivation(supportedFileTypes.size(), get_abi(supportedFileTypes), *(void**)(&logo), *(void**)(&displayName), supportedVerbs.size(), get_abi(supportedVerbs), *(void**)(&exePath))); } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics::RegisterForProtocolActivation(param::hstring const& scheme, param::hstring const& logo, param::hstring const& displayName, param::hstring const& exePath) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IActivationRegistrationManagerStatics)->RegisterForProtocolActivation(*(void**)(&scheme), *(void**)(&logo), *(void**)(&displayName), *(void**)(&exePath))); } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics::RegisterForStartupActivation(param::hstring const& taskId, param::hstring const& exePath) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IActivationRegistrationManagerStatics)->RegisterForStartupActivation(*(void**)(&taskId), *(void**)(&exePath))); } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics::UnregisterForFileTypeActivation(array_view fileTypes, param::hstring const& exePath) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IActivationRegistrationManagerStatics)->UnregisterForFileTypeActivation(fileTypes.size(), get_abi(fileTypes), *(void**)(&exePath))); } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics::UnregisterForProtocolActivation(param::hstring const& scheme, param::hstring const& exePath) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IActivationRegistrationManagerStatics)->UnregisterForProtocolActivation(*(void**)(&scheme), *(void**)(&exePath))); } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics::UnregisterForStartupActivation(param::hstring const& taskId) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IActivationRegistrationManagerStatics)->UnregisterForStartupActivation(*(void**)(&taskId))); } template auto consume_Microsoft_Windows_AppLifecycle_IAppActivationArguments::Kind() const { winrt::Microsoft::Windows::AppLifecycle::ExtendedActivationKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppActivationArguments)->get_Kind(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_AppLifecycle_IAppActivationArguments::Data() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppActivationArguments)->get_Data(&value)); return winrt::Windows::Foundation::IInspectable{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::UnregisterKey() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->UnregisterKey()); } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::RedirectActivationToAsync(winrt::Microsoft::Windows::AppLifecycle::AppActivationArguments const& args) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->RedirectActivationToAsync(*(void**)(&args), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::GetActivatedEventArgs() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->GetActivatedEventArgs(&result)); return winrt::Microsoft::Windows::AppLifecycle::AppActivationArguments{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::Activated(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->add_Activated(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::Activated(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, Activated(handler)); } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::Activated(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->remove_Activated(impl::bind_in(token)); } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::Key() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->get_Key(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::IsCurrent() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->get_IsCurrent(&value)); return value; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::ProcessId() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstance)->get_ProcessId(&value)); return value; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics::GetCurrent() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics)->GetCurrent(&result)); return winrt::Microsoft::Windows::AppLifecycle::AppInstance{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics::GetInstances() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics)->GetInstances(&result)); return winrt::Windows::Foundation::Collections::IVector{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics::FindOrRegisterForKey(param::hstring const& key) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics)->FindOrRegisterForKey(*(void**)(&key), &result)); return winrt::Microsoft::Windows::AppLifecycle::AppInstance{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics2::Restart(param::hstring const& arguments) const { winrt::Windows::ApplicationModel::Core::AppRestartFailureReason result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics2)->Restart(*(void**)(&arguments), reinterpret_cast(&result))); return result; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RegisterForFileTypeActivation(uint32_t __supportedFileTypesSize, void** supportedFileTypes, void* logo, void* displayName, uint32_t __supportedVerbsSize, void** supportedVerbs, void* exePath) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterForFileTypeActivation(array_view(reinterpret_cast(supportedFileTypes), reinterpret_cast(supportedFileTypes) + __supportedFileTypesSize), *reinterpret_cast(&logo), *reinterpret_cast(&displayName), array_view(reinterpret_cast(supportedVerbs), reinterpret_cast(supportedVerbs) + __supportedVerbsSize), *reinterpret_cast(&exePath)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RegisterForProtocolActivation(void* scheme, void* logo, void* displayName, void* exePath) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterForProtocolActivation(*reinterpret_cast(&scheme), *reinterpret_cast(&logo), *reinterpret_cast(&displayName), *reinterpret_cast(&exePath)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RegisterForStartupActivation(void* taskId, void* exePath) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RegisterForStartupActivation(*reinterpret_cast(&taskId), *reinterpret_cast(&exePath)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UnregisterForFileTypeActivation(uint32_t __fileTypesSize, void** fileTypes, void* exePath) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnregisterForFileTypeActivation(array_view(reinterpret_cast(fileTypes), reinterpret_cast(fileTypes) + __fileTypesSize), *reinterpret_cast(&exePath)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UnregisterForProtocolActivation(void* scheme, void* exePath) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnregisterForProtocolActivation(*reinterpret_cast(&scheme), *reinterpret_cast(&exePath)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UnregisterForStartupActivation(void* taskId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnregisterForStartupActivation(*reinterpret_cast(&taskId)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Kind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Kind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Data(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Data()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall UnregisterKey() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnregisterKey(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RedirectActivationToAsync(void* args, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().RedirectActivationToAsync(*reinterpret_cast(&args))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetActivatedEventArgs(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetActivatedEventArgs()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_Activated(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Activated(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Activated(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Activated(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_Key(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Key()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsCurrent(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsCurrent()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ProcessId(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ProcessId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetCurrent(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetCurrent()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetInstances(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().GetInstances()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FindOrRegisterForKey(void* key, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().FindOrRegisterForKey(*reinterpret_cast(&key))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall Restart(void* arguments, int32_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().Restart(*reinterpret_cast(&arguments))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Microsoft::Windows::AppLifecycle { inline auto ActivationRegistrationManager::RegisterForFileTypeActivation(array_view supportedFileTypes, param::hstring const& logo, param::hstring const& displayName, array_view supportedVerbs, param::hstring const& exePath) { impl::call_factory([&](IActivationRegistrationManagerStatics const& f) { return f.RegisterForFileTypeActivation(supportedFileTypes, logo, displayName, supportedVerbs, exePath); }); } inline auto ActivationRegistrationManager::RegisterForProtocolActivation(param::hstring const& scheme, param::hstring const& logo, param::hstring const& displayName, param::hstring const& exePath) { impl::call_factory([&](IActivationRegistrationManagerStatics const& f) { return f.RegisterForProtocolActivation(scheme, logo, displayName, exePath); }); } inline auto ActivationRegistrationManager::RegisterForStartupActivation(param::hstring const& taskId, param::hstring const& exePath) { impl::call_factory([&](IActivationRegistrationManagerStatics const& f) { return f.RegisterForStartupActivation(taskId, exePath); }); } inline auto ActivationRegistrationManager::UnregisterForFileTypeActivation(array_view fileTypes, param::hstring const& exePath) { impl::call_factory([&](IActivationRegistrationManagerStatics const& f) { return f.UnregisterForFileTypeActivation(fileTypes, exePath); }); } inline auto ActivationRegistrationManager::UnregisterForProtocolActivation(param::hstring const& scheme, param::hstring const& exePath) { impl::call_factory([&](IActivationRegistrationManagerStatics const& f) { return f.UnregisterForProtocolActivation(scheme, exePath); }); } inline auto ActivationRegistrationManager::UnregisterForStartupActivation(param::hstring const& taskId) { impl::call_factory([&](IActivationRegistrationManagerStatics const& f) { return f.UnregisterForStartupActivation(taskId); }); } inline auto AppInstance::GetCurrent() { return impl::call_factory_cast([](IAppInstanceStatics const& f) { return f.GetCurrent(); }); } inline auto AppInstance::GetInstances() { return impl::call_factory_cast(*)(IAppInstanceStatics const&), AppInstance, IAppInstanceStatics>([](IAppInstanceStatics const& f) { return f.GetInstances(); }); } inline auto AppInstance::FindOrRegisterForKey(param::hstring const& key) { return impl::call_factory([&](IAppInstanceStatics const& f) { return f.FindOrRegisterForKey(key); }); } inline auto AppInstance::Restart(param::hstring const& arguments) { return impl::call_factory([&](IAppInstanceStatics2 const& f) { return f.Restart(arguments); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif