windowswinformsc++-clilegacy-code

In Windows 10, how can I avoid having the touch keyboard covering up inputs?


We are maintaining a legacy application that was written in a combination of C, C++, and C++/CLI that is deployed at tablet PC running Windows 10. Re-writing the application is not an option, but the users are complaining about the touch keyboard covering up inputs. What technique, if any, can I use to avoid inputs being covered by the touch keyboard?


Solution

  • You cannot control where the keyboard is, you can only adapt your application so the keyboard does not cover important parts. Applications with one large surface (listview, document etc.) generally scroll themselves so the caret/selection is visible. Some other windows resize themselves instead (the standard open/save dialog) so that the most important control is visible.

    If you create a COM class that implements IFrameworkInputPaneHandler then you can subscribe to keyboard changes by registering yourself with IFrameworkInputPane::AdviseWithHWND. You can find a example of this on Raymond Chens blog.