Comfort Software :: Forums :: Development
<< Previous thread | Next thread >>   

How to activate different keyboards

Author Post
Thu Jan 24 2008, 04:54am

Joined: Wed Sep 19 2007, 03:42pm
Posts: 521
You can specify different types of on-screen keyboards to be displayed.

To do this, change (from your program) the KeyboardName parameter in the registry at HKEY_CURRENT_USER\Software\ComfortSoftware\CKeyboard.

You have to do it before showing the on-screen keyboard with Windows Messages (see

[ Edited Mon May 26 2008, 09:37am ]

Have a nice day
Back to top
Mon Mar 23 2009, 03:39pm
Registered Member #250
Joined: Tue Feb 03 2009, 04:30pm
Posts: 4
I tried to open the NumPad programatically by changing the registry.But its not working. I wanted to open an alphaneumeric keyboard for text box and NumPad for numeric controls. Please let me know if I can do this by any other way.
Thanks in advance.
Back to top
Wed Apr 01 2009, 07:09am

Joined: Wed Sep 19 2007, 03:42pm
Posts: 521

char  KeyboardName[80];

   KeyboardName = "Standard";
// Fill the COPYDATA structure
   MyCDS.dwData = 1;          // function identifier
   MyCDS.cbData = sizeof( KeyboardName );  // size of data
   MyCDS.lpData = &KeyboardName;           // data structure
// Call function, passing data in &MyCDS
   HWND hwDispatch = FindWindow( "TFirstForm", "CKeyboardFirstForm" );
   if( hwDispatch != NULL )
      SendMessage( hwDispatch,
                   (WPARAM)(HWND) NULL,
                   (LPARAM) (LPVOID) &MyCDS );

[ Edited Tue Apr 14 2009, 01:48am ]

Have a nice day
Back to top
Thu Apr 15 2010, 07:22pm
Registered Member #140
Joined: Sat Jul 05 2008, 05:07pm
Posts: 1
I also had a problem using the registry to load different kb set for the floating kb . I wanted to load different kb before the user click the floating kb button but it did not work, it seems that it is not reading the kb setting on every click (bug?).

so I used the post msg approach and it is working ok now

I am evaluating On-Screen Keyboard V4.0 with vb6
the code converted to vb:

dwData As Long
cbData As Long
lpData As Long
End Type

Private Const WM_COPYDATA = &H4A

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)

Public Function VKBLoadKeyboard(ByVal xi_KeyboardName As String) As Boolean

Dim KeyboardName(1 To 255) As Byte
Dim hwnd As Long
Dim sString As String

sString = Trim$(xi_KeyboardName)
If sString = "" Then Exit Function
Call CopyMemory(KeyboardName(1), ByVal sString, Len(sString))

' Fill the COPYDATA structure
MyCDS.dwData = 1 ' function identifier
MyCDS.cbData = Len(sString) + 1 ' size of data
MyCDS.lpData = VarPtr(KeyboardName(1)) ' data structure
' Call function, passing data in &MyCDS
hwnd = FindWindow("TFirstForm", "CKeyboardFirstForm")
If (hwnd <> 0) Then
Call SendMessage(hwnd, WM_COPYDATA, 0, MyCDS)
End If

End Function
Back to top
Thu Mar 06 2014, 04:33pm
Registered Member #1387
Joined: Thu Mar 06 2014, 03:35pm
Posts: 1

My question here may be related to a different scenario of using different keyboards within a Windows Forms (C#) application. I have three different screens need to display keyboards and each screen will need to display a different size and different position of the keyboard. I was able to create the keyboards of my need through using the Keyboard Options menu and save them to three separate ".ini" files through Options Advance selection. I was able to load the ini file corresponding to each of the screens in my application at runtime by using command line "CKeyboard.exe /restore ..." and close the keyboard by "CKeyboard.exe /hidekeyboard". Both commands did the job. But there was a pain in loading and displaying the keyboard when using "CKeyboard.exe /restore..." because there were a couple of flickers (visual effect doesn't look good) everytime and the company QA wouldn't pass it. I am using Comfort On-screen Keyboard software 7.1 and it has been registered. My questions are
1) Am I doing correctly to switch different keyboards by using the /restore option?
2) Is there any suggestion to get rid of the flickers?

Back to top
Tue Mar 11 2014, 09:46am

Joined: Wed Sep 19 2007, 03:42pm
Posts: 521
Command /restore reload all options. It's long operation.

I can recommend you to change the keyboard with a command from this list:

And move the keyboard with Windows Message WM_CSKEYBOARDMOVE:

Have a nice day
Back to top
Moderators: Comfort

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System