How do I programatically change the Virtual Keyboard size in Windows 10?

Marcus Sonestedt 1 Reputation point
2021-02-11T09:09:53.55+00:00

Hi!

The touch keyboard does, by default, occupy half the screen.

While can be made "windowed" by the user by configuring it so, we'd like to change this by default (as an option) when our application is installed on the computer we ship with our hardware device.

We've done a fair bit of investigation but can't find how to change this in the registry or via some API.

This is the brief report from that developer:

  • There exists a “public” registry API at key HKEY_CURRENT_USER\SOFTWARE\Microsoft\TabletTip but this does not include settings for the keyboard layout.
  • I used "process monitor" to analyze registry changes and found out that the relevant settings are stored in a "private hive" registry.
  • A "private hive" is a "registry in a binary file", usually stored in user's appsettings folder.
  • The exact filepath to the required file must be known or determined.
  • I tried to find the virtual keyboard binary file on my machine but couldn't find it.
  • Even when it can be found the filepath it is very likely different on other machines or may change later by an app update.
  • Additionally the actual registry structure of the private hive may contain universal identifiers.
  • How to inspect a "private hive"? Open regedit and load the file via the menubar option (see first link below).
  • As I couldn't find the actual file in a reasonable amount of time I stopped investigation here. Bringing automatic configuration to installer via a one-line invocation is hard & overall it's probably risky to operate on Windows internals.

We'd be happy to solve this in any way, registry change, command-line yool, powershell script or some C# / C++ code are all fine, including invocation from an elevated (admin) context.

Let me know if you need more information, if there is a better place to ask about this, or more appropriate tags to use?

Windows development | Windows API - Win32
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Drake Wu - MSFT 996 Reputation points
    2021-02-12T06:21:09.11+00:00

    Hi, @Marcus Sonestedt
    First of all, for the non-windowed Virtual Keyboard, you may not be able to change its size, because it is determined by the installed keyboard layout. In this case, you should reposition your controls to prevent them from being covered by the virtual keyboard. Check the following article: How can I reposition my controls so they aren’t covered by the touch keyboard?
    For setting the virtual Keyboard "windowed", this should be selected by the user, and this option will be saved and used next time you open it again.


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.