Search code examples
c++windows-8.1desktop-applicationtablet

How does Windows 8.1 detect whether a machine is a desktop or a tablet?


Windows 8.1 -- the full version, not RT -- automatically boots to the desktop when run from a desktop computer and to the Start screen when run from a tablet. (This functionality may require Update 1; I'm not sure.)

What information does Windows 8.1 use to make this decision, and can I access it programmatically from C++? I have an application that includes a driver that does not (currently) work properly on tablets, so I would like to use this information to warn the user at install time.


Solution

  • It looks like GetSystemMetrics(SM_TABLETPC) is sufficient for my needs, but the WMI query in the comments above is certainly useful if more granular information is needed.