How to start a virtual keyboard without loosing focus in WinXP?

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?


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.

    链接地址: http://www.djcxy.com/p/39252.html

    上一篇: 如何将焦点设置为TabCtrl中的子对话框中的CEdit?

    下一篇: 如何启动一个虚拟键盘而不失去在WinXP的焦点?