How can i programmatically manipulate the Windows 7 on-screen keyboard osk: Move, Resize, Remove Titlebar/Caption

你。 提交于 2019-12-23 12:53:39

问题


I'm working on a WPF app where i want to display the built-in windows 7 onscreen keyboard in a 'always there' manner. So i want to:

  1. Move it to a particular location

  2. Set it to a certain width and height

  3. Remove the caption/titlebar so the user can't move it around or close it

  4. Remove that abilty to resize it (or any other user adjustments for that matter).

I've tried all the typical API functions (MoveWindow, SetWindowPos, SetWindowLong, etc...) but it refuses to do anything. Code currently works with all other processes and apps (such as internet explorer and the command prompt); it's almost as if the api calls don't apply to the osk, or that it's 'locked'. What am i missing? Thanks in advance.


回答1:


I checked with Spy++ and the On-Screen Keyboard uses something called "DirectUIHWND". You may wish to look into DirectUIHWND APIs.

A possibly helpful link:

  • http://www.codeproject.com/KB/COM/cominterfacehookingpart.aspx

In addition, some people have warned that DirectUI is undocumented.



来源:https://stackoverflow.com/questions/5608393/how-can-i-programmatically-manipulate-the-windows-7-on-screen-keyboard-osk-move

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!