4

I'm trying to find a method to detect if Windows 10 is in tablet mode or not. Please note, this is not about querying whether the user has a Tablet PC or not - that can be solved with GetSystemMetrics(SM_CONVERTIBLESLATEMODE). In my case the above function always returns 0 - whether Win10 is in tablet mode or not.

This thread without an epilogue seems to suggest that there is no WinAPI call that could detect Tablet mode. I hope that isn't the case, since there are different WM messages posted by the OS if it's in tablet mode or not. In tablet mode WM_SHOWWINDOW isn't sent which means I need to address the launching of the application differently if Windows 10 is in tablet mode.

I could just move the code that is currently triggered after receiving the WM_SHOWWINDOW message somewhere else (just after ShowWindow is called), but then I get a WM_DPICHANGED message with null parameters.

4

1 回答 1

2

您可以使用 UIViewSettings.UserInteractionMode @Raymond 指出。

请参阅“平板电脑模式”“如何检测我的电脑是否处于平板电脑模式?

于 2019-03-19T05:27:40.857 回答