// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #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.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/impl/Microsoft.Windows.AppLifecycle.2.h" #include "winrt/impl/Windows.ApplicationModel.Core.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics< D>::RegisterForFileTypeActivation(array_view supportedFileTypes, param::hstring const& logo, param::hstring const& displayName, array_view supportedVerbs, param::hstring const& exePath) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AppLifecycle:: IActivationRegistrationManagerStatics>**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RegisterForFileTypeActivation( supportedFileTypes.size(), get_abi(supportedFileTypes), *(void**)(&logo), *(void**)(&displayName), supportedVerbs.size(), get_abi(supportedVerbs), *(void**)(&exePath))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RegisterForFileTypeActivation( supportedFileTypes.size(), get_abi(supportedFileTypes), *(void**)(&logo), *(void**)(&displayName), supportedVerbs.size(), get_abi(supportedVerbs), *(void**)(&exePath))); } } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics< D>::RegisterForProtocolActivation(param::hstring const& scheme, param::hstring const& logo, param::hstring const& displayName, param::hstring const& exePath) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AppLifecycle:: IActivationRegistrationManagerStatics>**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RegisterForProtocolActivation( *(void**)(&scheme), *(void**)(&logo), *(void**)(&displayName), *(void**)(&exePath))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RegisterForProtocolActivation( *(void**)(&scheme), *(void**)(&logo), *(void**)(&displayName), *(void**)(&exePath))); } } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics< D>::RegisterForStartupActivation(param::hstring const& taskId, param::hstring const& exePath) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AppLifecycle:: IActivationRegistrationManagerStatics>**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RegisterForStartupActivation( *(void**)(&taskId), *(void**)(&exePath))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RegisterForStartupActivation( *(void**)(&taskId), *(void**)(&exePath))); } } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics< D>::UnregisterForFileTypeActivation(array_view fileTypes, param::hstring const& exePath) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AppLifecycle:: IActivationRegistrationManagerStatics>**)&_winrt_casted_result; check_hresult(_winrt_abi_type->UnregisterForFileTypeActivation( fileTypes.size(), get_abi(fileTypes), *(void**)(&exePath))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UnregisterForFileTypeActivation( fileTypes.size(), get_abi(fileTypes), *(void**)(&exePath))); } } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics< D>::UnregisterForProtocolActivation(param::hstring const& scheme, param::hstring const& exePath) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AppLifecycle:: IActivationRegistrationManagerStatics>**)&_winrt_casted_result; check_hresult(_winrt_abi_type->UnregisterForProtocolActivation( *(void**)(&scheme), *(void**)(&exePath))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UnregisterForProtocolActivation( *(void**)(&scheme), *(void**)(&exePath))); } } template auto consume_Microsoft_Windows_AppLifecycle_IActivationRegistrationManagerStatics< D>::UnregisterForStartupActivation(param::hstring const& taskId) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t< winrt::Microsoft::Windows::AppLifecycle:: IActivationRegistrationManagerStatics>**)&_winrt_casted_result; check_hresult( _winrt_abi_type->UnregisterForStartupActivation(*(void**)(&taskId))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->UnregisterForStartupActivation(*(void**)(&taskId))); } } template auto consume_Microsoft_Windows_AppLifecycle_IAppActivationArguments::Kind() const { winrt::Microsoft::Windows::AppLifecycle::ExtendedActivationKind value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppActivationArguments, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_Kind(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_Kind(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_AppLifecycle_IAppActivationArguments::Data() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppActivationArguments, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Data(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Data(&value)); } return winrt::Windows::Foundation::IInspectable{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::UnregisterKey() const { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->UnregisterKey()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UnregisterKey()); } } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance:: RedirectActivationToAsync( winrt::Microsoft::Windows::AppLifecycle::AppActivationArguments const& args) const { void* operation{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->RedirectActivationToAsync(*(void**)(&args), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->RedirectActivationToAsync(*(void**)(&args), &operation)); } return winrt::Windows::Foundation::IAsyncAction{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance< D>::GetActivatedEventArgs() const { void* result{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetActivatedEventArgs(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Microsoft::Windows::AppLifecycle::AppActivationArguments> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->add_Activated(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->add_Activated(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::Activated( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Microsoft::Windows::AppLifecycle::AppActivationArguments> 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 { if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_Activated(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_Activated(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::Key() const { void* value{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_Key(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Key(&value)); } return hstring{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::IsCurrent() const { bool value{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_IsCurrent(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_IsCurrent(&value)); } return value; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstance::ProcessId() const { uint32_t value{}; if constexpr (!std::is_same_v< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstance>) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstance, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ProcessId(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ProcessId(&value)); } return value; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics::GetCurrent() const { void* result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetCurrent(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetCurrent(&result)); } return winrt::Microsoft::Windows::AppLifecycle::AppInstance{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics< D>::GetInstances() const { void* result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->GetInstances(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetInstances(&result)); } return winrt::Windows::Foundation::Collections::IVector< winrt::Microsoft::Windows::AppLifecycle::AppInstance>{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_AppLifecycle_IAppInstanceStatics< D>::FindOrRegisterForKey(param::hstring const& key) const { void* result{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics, D const*>( static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->FindOrRegisterForKey(*(void**)(&key), &result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->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{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics2, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->Restart( *(void**)(&arguments), reinterpret_cast(&result))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< D, winrt::Microsoft::Windows::AppLifecycle::IAppActivationArguments> { int32_t __stdcall get_Kind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::AppLifecycle::ExtendedActivationKind>( 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< winrt::Microsoft::Windows::AppLifecycle::AppActivationArguments>( 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< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics> { 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< D, winrt::Microsoft::Windows::AppLifecycle::IAppInstanceStatics2> { int32_t __stdcall Restart(void* arguments, int32_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from< winrt::Windows::ApplicationModel::Core::AppRestartFailureReason>( this->shim().Restart(*reinterpret_cast(&arguments))); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl 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< winrt::Microsoft::Windows::AppLifecycle::AppInstance (*)( IAppInstanceStatics const&), AppInstance, IAppInstanceStatics>( [](IAppInstanceStatics const& f) { return f.GetCurrent(); }); } inline auto AppInstance::GetInstances() { return impl::call_factory_cast< winrt::Windows::Foundation::Collections::IVector< winrt::Microsoft::Windows::AppLifecycle::AppInstance> (*)( 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::Microsoft::Windows::AppLifecycle::ActivationRegistrationManager> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif