New Windows Gaming Handheld Code Samples Released

These samples provide best practices and code examples that can be integrated into your games when considering Windows gaming handheld scenarios.

July 29, 2025
Dual Device Hero image

Today, Microsoft is releasing samples to provide examples & education material that builds on our checklist for games on Windows handhelds. These samples provide best practices and code examples that can be integrated into your games when considering Windows gaming handheld scenarios.

This Handheld Experience Best Practices release includes two samples, a native C++ sample and a Unity managed C# sample. Both provide a similar set of best practices around how to leverage APIs to manage your games handheld experience easily. These include examples demonstrating how to: 

  • Determine if a device is a handheld.
  • Determine if a device is running on battery power, charging or using external power.
  • Look up device specific properties, including integrated display properties.
  • Handle DPI changes and scale UI accordingly.
  • Leverage Virtual Keyboards for text entry.
  • Look up network devices & types.
  • Determine network and Bluetooth connectivity.
  • Handle input from Gamepad, Keyboard and Mouse.
  • Determine input modality (i.e. latest input device used).

These samples will continue to be updated as Windows enhancements are made that are beneficial to Windows handheld gaming scenarios and as we gather feedback from game developers who build for these devices.

To acquire these samples, please see:

For more on handheld game development, be sure to check out our Xbox Handheld Gaming Developer Resource Hub.