ahmed605 / InteractionTrackerCrossProcessVisuals

Render and interact with the same DWM visual in separate processes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cross process visuals with InteractionTracker

This demonstrates Cross Process Visuals by Ahmed Walid in the VirtualSurfaces composition sample from Microsoft. The result is two processes are able to display the same visual. One process (the “primary” process) creates a shared visual target and passes it to a new process (the “secondary” process) The secondary process creates the tile grid and handles interactions. It then sets the shared visual target to a RedirectVisual whose source is the root visual of the tile grid. By using a RedirectVisual and adding it as a VisualInteractionSource of the secondary process’s InteractionTracker, both processes respond to interaction.

Caveats

  • This sample uses internal APIs not meant for general public usage
  • Touch/pen manipulation needs to be redirected to InteractionTracker. This sample does not do that for the primary window. I have not yet tested if that is possible, so touch/pen interaction only works in the secondary window. Trackpad interaction works, however.

Demo

interaction.mp4

About

Render and interact with the same DWM visual in separate processes

License:MIT License


Languages

Language:C++ 84.1%Language:C 15.9%