views:

24

answers:

1

Hello, I need to start a virtual keyboard (namely click-n-type) from my application to allow user input in the active field. When the user focuses on an edit box in my application's window, the virtual keyboard pops out to allow input.

However, I can't get this to work in one click. When I use the "start click-n-type.exe" the keyboard starts normally but the edit box looses focus. When I use "start /min click-n-type.exe", the edit box keeps the focus but the keyboard is minimized. Is there a way to have both the focus unchanged and virtual keyboard in its place?

A: 

Normally, I'd suggest having your application loaded as in process dll, but that might require a whole lot of reprogramming. Instead, this might help:

  • Always load your application, make it invisible
  • When the active field gets user input, change your form settings to borderless and always on top;
  • Your application should now be used. The other application is now the next in the Z-Order. Make sure you have its window handle;
  • When someone types something or clicks something on your virtual keyboard, switch focus (user won't notice, you're always on top) and use SendKeys;
  • Then switch focus back to your application.

There are other ways of writing such applications, which are smoother but require a strong understanding of the window messaging model and the how to load / unload dlls from other appllications.

Abel
This sounds like a lot of work. I don't want to write my own virtual keyboard, instead, I want to use click-n-type in my GUI application.