locked
About Windows 10 Tablet Mode API RRS feed

  • Question

  • Windows 10 Tablet Mode feature is added to New O/S Windows 10.

    I have questions about this feature.

    1. Can we control this feature by using some API ?

    2. Can we get the tablet mode enable/disable event by using API?

    For example, can we get the tablet mode enable/disable event in UI programming such as .Net, Win32 and UWP?

    When I click on the feature, current invoked UI is automatically expanded and fit to full screen size.

    I want to know if we can get the tablet mode on/off event in code side when we enable or disable the tablet mode feature.

    Wednesday, May 20, 2015 10:43 AM

All replies

  • I have the same issue. Our Win32 desktop application was working fine in any version before Windows 10. But in Windows 10 preview, when the tablet mode is turned on, the GUI's behavior became strange and hard to use. So i'm guessing I may need to do some handling when it's changed to Tablet Mode. It's pretty important that we can know the enable/disable event of Tablet Mode by using API in Windows 10.

    Thanks a lot!

    Wednesday, June 3, 2015 3:24 PM
  • Windows 10 Tablet Mode feature is added to New O/S Windows 10.

    I have questions about this feature.

    1. Can we control this feature by using some API ?

    2. Can we get the tablet mode enable/disable event by using API?

    For example, can we get the tablet mode enable/disable event in UI programming such as .Net, Win32 and UWP?

    When I click on the feature, current invoked UI is automatically expanded and fit to full screen size.

    I want to know if we can get the tablet mode on/off event in code side when we enable or disable the tablet mode feature.

    Friday, June 5, 2015 2:52 AM
  • Is there any update?
    Wednesday, June 10, 2015 11:55 AM
  • I have an unofficial solution for my own working. The following key will change during the mode change:

    [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell]
    "TabletMode"=dword:00000000

    When the Tablet Mode is enabled, it changed to 1.

    Monday, June 15, 2015 8:47 AM
  • Right. Additionally, your windows will get a WM_SETTINGCHANGE message with "UserInteractionMode" as the lParam.

    The problem is, that registry key doesn't actually change when the message is sent, and so you end up not knowing if you just switched to or from tablet mode.

    That and reading the registry yourself here doesn't feel like the "right" way to determine this.
    Monday, June 15, 2015 2:55 PM
  • So currently, is there a reliable way to determine this?
    Monday, June 15, 2015 3:48 PM
  • I have tested with RegNotifyChangeKeyValue and it worked correctly.
    Since "UserInteractionMode" can only be found in "__x_ABI_CWindows_CUI_CViewManagement_CIUIViewSettingsVtbl" get_UserInteractionMode in windows.ui.viewmanagement.h, I don't know how to using it in our legacy native program. If any one can help will be nice.


    • Edited by blackgat Tuesday, June 16, 2015 3:55 AM
    Tuesday, June 16, 2015 3:53 AM
  • I have tested with RegNotifyChangeKeyValue and it worked correctly.
    Since "UserInteractionMode" can only be found in "__x_ABI_CWindows_CUI_CViewManagement_CIUIViewSettingsVtbl" get_UserInteractionMode in windows.ui.viewmanagement.h, I don't know how to using it in our legacy native program. If any one can help will be nice.



    By using following code block in UWP C++ project, I can get correct UserInteractionMode
    UIViewSettings^ viewSettings = UIViewSettings::GetForCurrentView();
    if (viewSettings->UserInteractionMode == UserInteractionMode::Mouse)
    {
        // Desktop mode
    }
    else
    {
        // Tablet Mode
    }
    
    But I still trying to recieve "WM_SETTINGCHANGE" in this UWP program. Is some one can help provide code sample for me to recieve this message in UWP C++ program?
    Tuesday, June 16, 2015 11:56 AM
  • Finally I found the Microsoft UWP sample at https://github.com/Microsoft/Windows-universal-samples
    You can found "UserInteractionMode" sample in it.
    It is same as previouse sample code that I used in UWP.

    Wednesday, June 17, 2015 6:07 AM
  • Thank for your answer.

    I found Continuum as follows.

    UWP anc classic app can check tablet mode.

    https://msdn.microsoft.com/en-us/library/windows/hardware/dn917883(v=vs.85).aspx

    Wednesday, July 1, 2015 11:20 AM
  • This information is helped.
    But in my case I need to using VC 2005 for develop. I don't think it worked for this develop environment.
    Is someone can guide me to resolve it by using VC 2005?

    Tuesday, July 14, 2015 7:53 AM
  • This information is helped.
    But in my case I need to using VC 2005 for develop. I don't think it worked for this develop environment.
    Is someone can guide me to resolve it by using VC 2005?

    I think the only way is upgrade your visual studio
    Tuesday, May 9, 2017 2:21 AM