programatically control the Windows OnScreen keyboard.

Please discuss general Delphi programming topics here.

programatically control the Windows OnScreen keyboard.

Postby Blod » October 12th, 2010, 8:41 pm

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
Blod
Junior Member
Junior Member
 
Posts: 33
Joined: June 5th, 2008, 12:54 pm

Re: programatically control the Windows OnScreen keyboard.

Postby Kambiz » October 12th, 2010, 10:13 pm

The code you are using, is for controlling Hot Virtual Keyboard and doesn't work for Windows on Screen Keyboard.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: programatically control the Windows OnScreen keyboard.

Postby Blod » October 13th, 2010, 7:53 am

Thanks,
I didn't realise that.

Blod
Blod
Junior Member
Junior Member
 
Posts: 33
Joined: June 5th, 2008, 12:54 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron