"Go" MFC custom edit limit input hexadecimal content response copy paste full Select Cut function

Source: Internet
Author: User

CTRL key combination ASCII code

^z on behalf of CTRL + Z
ASCII value control character ASCII value control character ASCII value control character ASCII value control character
0 (XX) NULL 8 (^h) ^p (+) ^x
1 (^a) 9 (^i) ^q () ^y
2 (^b) ^j (0A) ^r (1A) ^z
3 (^c) ^k (0B) ^s (1B) ^[
4 (^d) ^l (0C) ^t (1C) ^\
5 (^e) (0D) ^m (^u) (1D) ^]
6 (^f) ^n (0E) ^v (1E) ^^
7 (^g) ^o (0F) ^w (1F) ^_

Limit the input content:

Response message OnChar

void Cenglishedit::onchar (UINT NChar, uint nrepcnt, uint nflags) {    //TODO:  Add the message handler code here and/or call the default value    if (

(Ch >= ' 0 ' && ch <= ' 9 ') | |
(Ch >= ' a ' && ch <= ' F ') | |
(Ch >= ' A ' && ch <= ' F ') | |
ch = = Vk_back | | ch = = Vk_delete| |
NChar = = 01 | | NChar = = 03 | | CTRL + A C
NChar = = 24 | | NChar = =//ctrl + x v

       )    {        Cedit::onchar (NChar, nrepcnt, nflags);    }    else    {        return;    }}

The red part of the code is the function of copying and pasting all-selected cut;

In practice, it is found that rewriting pretranslatemessage () can not realize the function of copy and paste cutting, and it is possible to implement the function of selecting all functions according to the top CTRL key combination ASCII code.

"Go" MFC custom edit limit input hexadecimal content response copy paste full Select Cut function

Related Article

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.