question

HubertHeinz-0414 avatar image
0 Votes"
HubertHeinz-0414 asked NicoZhu-MSFT commented

ScreenRecording

How can I enable ScreenRecording (Video) of my UWP by the XBox GameBar App? Now it's only possible if I build it with VisualStudio. If I install it out the Microsoft-Store it is not possible.

windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered NicoZhu-MSFT commented

Hello,
Welcome to Microsoft Q&A!

H

ow can I enable ScreenRecording (Video) of my UWP by the XBox GameBar App?

Yep, we could reproduce this problem, and it looks the game bar can't get your app's window that install from store, and currently there is workaround that use screen capture api your app to replace the game bar.

Thank you.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 20
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

161068-20211229-102012.jpg



I only want to record it by the XBox GameBar App.

0 Votes 0 ·
20211229-102012.jpg (755.3 KiB)

Please try use InjectKeyboard for your app to simulate press Win +G to call game bar.


 private async void Button_Click(object sender, RoutedEventArgs e)
 {
    
     InputInjector inputInjector = InputInjector.TryCreate();
    
     var win = new InjectedInputKeyboardInfo();
     win.VirtualKey = (ushort)(VirtualKey.LeftWindows);
     win.KeyOptions = InjectedInputKeyOptions.None;
    
    
     var g = new InjectedInputKeyboardInfo();
     g.VirtualKey = (ushort)(VirtualKey.G);
     g.KeyOptions = InjectedInputKeyOptions.None;
    
    
     inputInjector.InjectKeyboardInput(new[] { win, g });
    
     await Task.Delay(1000);
    
    
     var rwin = new InjectedInputKeyboardInfo();
     rwin.VirtualKey = (ushort)(VirtualKey.LeftWindows);
     rwin.KeyOptions = InjectedInputKeyOptions.KeyUp;
    
    
     var rg = new InjectedInputKeyboardInfo();
     rg.VirtualKey = (ushort)(VirtualKey.G);
     rg.KeyOptions = InjectedInputKeyOptions.KeyUp;
    
     inputInjector.InjectKeyboardInput(new[] { rwin, rg });
 }

Add capability

 <Package>
 xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
 IgnorableNamespaces="rescap"
    
 <Capabilities>
 <rescap:Capability Name="inputInjectionBrokered" />





0 Votes 0 ·

My problem is not to start XBox GameBar. If I start my App its not possible to record it. I think there' s missing a capability perhaps. In other UWPs like MyTube or Calculator it works without problems.
Thank you

0 Votes 0 ·
Show more comments