Hello to All,
I want to be able to programatically control the Windows OnScreen keyboard.
I found the following code online which seemed to be the answer.
it said...
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', 'hvkFirstForm'), WM_CSKEYBOARD, 1, 0);
// to close keyboard
PostMessage(FindWindow('TFirstForm', 'hvkFirstForm'), WM_CSKEYBOARD, 2, 0);
// to fade keyboard
PostMessage(FindWindow('TFirstForm', 'hvkFirstForm'), WM_CSKEYBOARD, 3, 0);
// to toggle (show/hide) keyboard
PostMessage(FindWindow('TFirstForm', 'hvkFirstForm'), WM_CSKEYBOARD, 4, 0);
// to move keyboard (Left, Top - new position)
PostMessage(FindWindow('TFirstForm', 'hvkFirstForm'), WM_CSKEYBOARDMOVE, Left, Top);
I declared
Const
WM_CSKEYBOARD = WM_USER + 192;
WM_CSKEYBOARDMOVE = WM_USER + 193;
in the implimentation part of my unit
and
put
PostMessage(FindWindow('TFirstForm', 'hvkFirstForm'), WM_CSKEYBOARD, 1, 0);
in a buttons onclick event.
It compiles and runs Ok but nothing happens when the button is clicked.
What am I failing to do please?
Thanks
Blod