MFC-based keypad
----
This program was started with a book titled Expert Clinic visual c ++ development Q & A 300 Q &. At that time, I didn't know that the source code was available on the Internet. I didn't search for the source code. I thought it was quite interesting, so I knocked it down. It is made of MFC. If you are interested, you can modify and mess with it as long as you like it.
----
Task Description
----
Click the keyboard in the input method to bring up a soft keyboard. Use MFC to implement such a soft keyboard.
After implementation:
----
Task implementation
----
The soft keyboard is actually a dialog box program. It looks like a keyboard in the past, and the effects are drawn. The soft keyboard mainly simulates the handling process of the keyboard buttons. For more information about Keyboard Message Processing, see Chapter 6th "windows programming" v5cn keyboard, which provides a lot of knowledge about keyboard button processing.
The ide I use (integrated development environment) is vs2010, which creates a dialog box-based MFC program.
The general idea is as follows. For detailed implementation, see the source code:
Abstract The Information Structure of the output key.
Draw the entire keyboard.
Call pretranslatemessage before the translatemessage function in the message loop, record and associate the handle of the activation window before the soft keyboard, so that the soft keyboard can send keyboard messages to the program. This is the key of this program, how to make the keyboard to serve other programs.
Respond to the mouse click to determine which key is clicked and send the corresponding Keyboard Message.
Source code of the MFC-based keypad