IShareWindowCommandEventArgsInterop interface (sharewindowcommandsourceinterop.h)

A native interoperation interface that allows getting a window identifier (a window handle) from a Windows Runtime Windows::UI::Shell::ShareWindowCommandEventArgs object. This interface is available in C++ only.

Important

The IShareWindowCommandEventArgsInterop API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, contact Microsoft Support.

Inheritance

The IShareWindowCommandEventArgsInterop interface inherits from the IUnknown interface.

Methods

The IShareWindowCommandEventArgsInterop interface has these methods.

 
IShareWindowCommandEventArgsInterop::GetWindow

Gets the window identifier (a window handle).

Remarks

You can query interface a ShareWindowCommandEventArgs object for IShareWindowCommandEventArgsInterop.

void MyAppShareController::OnCommandInvoked(
    winrt::Windows::UI::Shell::ShareWindowCommandSource const& /*sender*/,
    winrt::Windows::UI::Shell::ShareWindowCommandEventArgs const& args)
{
    auto eventArgsInterop = eventArgs.as<IShareWindowCommandEventArgsInterop>();
    HWND windowId = 0;
    winrt::check_hresult(eventArgsInterop->get_WindowId(&windowId));

    ...
}

Requirements

Requirement Value
Minimum supported client Windows Build 22000
Minimum supported server Windows Build 22000
Header sharewindowcommandsourceinterop.h

See also