Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the Windows 10 Game-Bar implemented?

Tags:

windows-10

Pressing Windows Key+G in Windows 10 causes the Xbox Game Bar to open - it overlays the current application, regardless of if it's a game or not (though Windows maintains its own database of games as a hint to show the bar automatically on process startup or not)

I wondered how this is possible - I don't have any Windows 10 Xbox App-related processes running on my computer.

Process Explorer shows that when WinKey+G is pressed, the following happens:

  1. An svchost.exe instance (which is hosting the BrokerInfrastructure, DcomLaunch, LSM, PlugPlay Power, and SystemEventsBroker services) invokes "%windir%\System32\bcastdvr.exe" -ServerName:Windows.Media.Capture.Internal.BroadcastDVRServer
  2. bcastdvr.exe then invokes "C:\Windows\System32\GamePanel.exe {hexString} /eventType=8 (where {hexString} is a 16-hex digit (8 byte) string, presumably a window handle or equivalent).
  3. GamePanel.exe then creates the window.

But the overlay window itself is special - it doesn't seem to be a normal hWnd - for example, I observe that my mouse cursor loses its drop-shadow and the "sonar pulse" effect (when I tap the Ctrl key to show my cursor location) stays in-place where my mouse cursor was when I opened the Game bar. I also noticed how smooth and fluid the game-bar's animations are - quite unlike a typical Win32 window. Is it using the XAML UI framework? If so, how is it doing it outside of the Windows UWP Sandbox?

Curiously, the game-bar is also able to target elevated windows too.

I tried - and failed - to inspect the windows using Spy++ because it disappears as soon as another window gets focus - but when I elected to start recording a window (so you get the recording overlay, which always remains on-screen), the overlay disappeared as soon as I used Spy++'s "Find Window" tool. How is the GameBar Recording Overlay doing this?

like image 837
Dai Avatar asked Aug 07 '16 05:08

Dai


People also ask

How does Windows game bar work?

Xbox Game Bar is built into Windows 11 so you can capture videos and screenshots while playing PC games. While you're playing a game, press the Windows logo key + G on your keyboard to open Xbox Game Bar. If you have an Xbox 360 or Xbox One controller plugged in to your PC, press the Xbox button.

How do I set up a game bar on Windows 10?

Right-click the button Start button and select “Settings.” Look for the “Gaming” option. Choose the “Xbox Game Bar” option. Toggle the option near the top of the screen so that it's switched on.

What is Xbox game bar process?

The Game Bar in Windows 10 is a tool designed to help gamers capture video, broadcast their gameplay online, take screenshots, and quickly access the Xbox app. It's an efficient tool, but not everyone needs to use it nor wants it on their PC.


1 Answers

So it turns out that after some research, I found out that the gamebar is a .exe file located in C:\Program Files\WindowsApps\Microsoft.XboxGamingOverlay_5.120.4062.0_x64__8wekyb3d8bbwe that is opened with the Win-G shortcut (which can be changed). From what I've seen, when opened, you will not be able to see the gamebar in the apps page of task manager, but rather the background processes page where it is grouped with the runtime broker which makes me believe that it is a program that is loaded by default on boot and built in to the ram of the OS of the device. You can find the properties of the gamebar when you expand the gamebar section in the background processes section then right click the "Xbox Game Bar" and then clicking properties. I think that the transition into the gamebar are smooth because of it potentially being an app built in the RAM and offloaded as a background process by default. The SYSTEM account also has full control of the file which furthers supports the possibility that the Xbox Game Bar is a feature that is pinned on windows ram.

like image 114
Nico Nekoru Avatar answered Sep 24 '22 12:09

Nico Nekoru