0

Is there an API that can control the opening and closing of the tablet mode?

I can determine the current tablet mode status by monitoring the registry's SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell property value, but even if the code changes this value, you can't actually turn off/on the Windows tablet mode.

In the WPF project, I want to close/open the tablet mode when I enter the app. I tried to directly modify the value in the registry, but it did not show the effect on the OS.

Registry.SetValue("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ImmersiveShell","TabletMode", 0);                   
SendMessageTimeout(new IntPtr(HWND_BROADCAST), WM_SETTINGCHANGE, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL,1000, out result1);
Jan Sršeň
  • 1,045
  • 3
  • 23
  • 46
  • https://stackoverflow.com/a/44498124/11916240 This Could help you with your query. – Sannith Shetty Aug 12 '19 at 06:37
  • Tablet mode is system wide rather than app specific. Is your purpose to show an on screen keyboard? I've built my own control in the past for that sort of requirement. You could show Tabtip or osk but they didn't suit our requirement. – Andy Aug 12 '19 at 08:52
  • @SannithShetty Thank you very much, but since the autohotkey script can be implemented, should there still be a way to find the windows api ,is there any other way? – Serafina_Bean Aug 13 '19 at 09:22
  • @Andy I want to enter the app to close the Tablet Mode by code. – Serafina_Bean Aug 13 '19 at 09:25

0 Answers0