InputInjector.TryCreateForAppBroadcastOnly Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attempts to create a new instance of the InputInjector class.
public:
static InputInjector ^ TryCreateForAppBroadcastOnly();
static InputInjector TryCreateForAppBroadcastOnly();
public static InputInjector TryCreateForAppBroadcastOnly();
function tryCreateForAppBroadcastOnly()
Public Shared Function TryCreateForAppBroadcastOnly () As InputInjector
Returns
If successful, returns a new instance of the InputInjector class. Otherwise, returns null.
Windows requirements
Device family |
Windows 10 Fall Creators Update (introduced in 10.0.16299.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v5.0)
|
Examples
Here are some downloadable samples demonstrating basic input and input injection:
Remarks
Important
The APIs in this namespace require the inputInjectionBrokered restricted capability.
Using input injection requires the following be added to the Package.appxmanifest:
- To
<Package>
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="rescap"
- To
<Capabilities>
<rescap:Capability Name="inputInjectionBrokered" />
This method differs from TryCreate in that input injection is restricted to the process that is actively being captured for broadcast using an AppBroadcastServices object. Injected input is silently dropped when there is no such active process.