You
can use Window Messages to manipulate the on-screen keyboard.
Like this:
WM_CSKEYBOARD = WM_USER + 192;
WM_CSKEYBOARDMOVE = WM_USER + 193;
// to show keyboard
PostMessage(FindWindow('TFirstForm', 'CKeyboardFirstForm'),
WM_CSKEYBOARD, 1, 0);
// to close keyboard
PostMessage(FindWindow('TFirstForm', 'CKeyboardFirstForm'),
WM_CSKEYBOARD, 2, 0);
// to fade keyboard
PostMessage(FindWindow('TFirstForm', 'CKeyboardFirstForm'),
WM_CSKEYBOARD, 3, 0);
// to toggle (show/hide) keyboard
PostMessage(FindWindow('TFirstForm', 'CKeyboardFirstForm'),
WM_CSKEYBOARD, 4, 0);
// to move keyboard (Left, Top - new position)
PostMessage(FindWindow('TFirstForm', 'CKeyboardFirstForm'),
WM_CSKEYBOARDMOVE, Left, Top);
For Visual Basic, it looks like this:
Private Const WM_CSKEYBOARD = WM_USER + 192
Private Const WM_CSKEYBOARDMOVE = WM_USER + 193
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
'Code to show keyboard
Dim hWnd As Long
hWnd = FindWindow("TFirstForm", "CKeyboardFirstForm")
PostMessage hWnd, WM_CSKEYBOARD, 1, 0
'Code to close keyboard
Dim hWnd As Long
hWnd = FindWindow("TFirstForm", "CKeyboardFirstForm")
PostMessage hWnd, WM_CSKEYBOARD, 2, 0
'Code to move keyboard
Dim hWnd As Long
hWnd = FindWindow("TFirstForm", "CKeyboardFirstForm")
PostMessage hWnd, WM_CSKEYBOARDMOVE, 0, 0
Here is the code in C#
public const Int32 WM_USER = 1024;
public const Int32 WM_CSKEYBOARD = WM_USER + 192;
public const Int32 WM_CSKEYBOARDMOVE = WM_USER + 193;
[DllImport("user32.dll", EntryPoint = "FindWindow")]
private static extern Int32 FindWindow(string _ClassName, string
_WindowName);
[DllImport("User32.DLL")]
public static extern Boolean PostMessage(Int32 hWnd, Int32 Msg,
Int32 wParam, Int32 lParam);
Int32 hWnd = FindWindow("TFirstForm", "CKeyboardFirstForm");
PostMessage(hWnd, WM_CSKEYBOARD, 1, 0 ); // Show
PostMessage(hWnd, WM_CSKEYBOARD, 2, 0); // Hide
PostMessage(hWnd, WM_CSKEYBOARDMOVE, 0, 0); // Move to 0, 0
If you are writing kiosk software using HTML, you can manipulate
the on-screen keyboard with via an ActiveX component.
1. Download the file with ActiveX components and examples located
at
http://www.comfort-software.com/download/keyboardx.zip.
2. Install ActiveX with using the following command: "regsvr32
cskeyboard.ocx" (or run the registerocx.cmd file).
3. See examples from hidekb.html, hidekeyboard.html, showkb.html
and showkeyboard.html
For example, you want the keyboard to be shown on a
single html page and not the whole site/kiosk. In this case, use
the code from the "showkb.html" file for a single page and the code
from "hidekb.html" for other pages.





