MFC-based keypad

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.