But since I wanted to find out also how to embed the nasty elusive built-in On-Screen Keyboard (OSK) of Windows which yesterday gave me a lot of frustration as surprisingly it is harder to control than said Free Virtual Keyboard, gleaming new codes from Vilhelm I decided to renew my failed attempts on how it can be done. Sometimes though when I do try to control things I do not need yet like this one, in the midst of it I wish I should have simply banged my head on the table; for again it seems I am unnecessarily stressing myself on something I myself do not need nor use (yet).
Anyhow, while finding ways like this sometimes makes my blood pressure go up due to frustrations, in the end when I find a way, I felt a bit of contentment as that is another understanding (to an extent) of these somewhat elusive WinAPIs. I have yet fully understood these things and just relies on my observations and trials and errors; but I think I am slowly getting there.
After adopting some technique and codes used by Vilhelm I am able to successfully embed OSK within our form under XP OS. However, trying the same codes inside Windows 7 renews my frustration as said OS does not respect the settings I have done earlier.
Finally, here are the codes that work on both XP and Windows 7 (32-bit, I do not have 64-bit to test it to):
- on XP, it can be resized on-the-ply; on Window 7 it is fixed size
- on XP version of OSK, there is no word suggestion; while on Windows 7 there is
If you noticed on the final SetWindowPos, I added 10. That is because Windows 7 has thicker border than XP and that is used to counter or compensate for the thickness difference. You can perform an OS() function to determine whether that extra 10 can be added or not.
Hope this and Vilhelm's will help you on your on screen keyboard needs. Cheers!