Share via

CppWinRT - Gaming Gamebar IsInputRedirected or IsInputRedirectedChanged Blocking on Windows 11 Shortcuts

leeroy 6 Reputation points
2022-04-12T19:24:10.473+00:00

We are running into a scenario with a user of Windows 11 when they launch our application via a shortcut, even if they create that shortcut right next to the executable it sits at, it blocks at winrt::Windows::Gaming::UI::GameBar::IsInputRedirected() or winrt::Windows::Gaming::UI::GameBar::IsInputRedirectedChanged(inputHandler) and never comes back... For additional context this does run within CEF (Chromium Embedded framework) and is running in the MAIN or UI thread.

We've been unable to reproduce and there doesn't seem to be anything unique about this users machine. Is there any reason any of these would get "stuck"? I don't have a lot of experience working with Windows Runtime APIs, but cppwinrt has certainly transformed that experience.

I've even tried using WRL and it seems to get stuck on GetActivationFactory as well, so likely not a problem with cppwinrt specifically.

Developer technologies | Universal Windows Platform (UWP)
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


1 answer

Sort by: Most helpful
  1. leeroy 6 Reputation points
    2022-04-14T17:36:55.45+00:00

    @Anonymous and @Xiaopo Yang - MSFT Looks like the issue is that Game Bar uses the caller’s App User Model ID. When a process is launched by a shortcut the system tries to figure one out from the shortcut context, but gets stuck. Processes launched by ShellExecute or double-clicking on the .exe don't have the shortcut context, so they get an AUMID correctly.

    Being tracked @ http://task.ms/39033892

    For the full details: I thought I had included this link with my original post, but originally filed this with cppwinrt at https://github.com/microsoft/cppwinrt/issues/1133

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.