当前位置:网站首页>[work with notes] MFC solves the problem that pressing ESC and enter will automatically exit
[work with notes] MFC solves the problem that pressing ESC and enter will automatically exit
2022-06-13 02:05:00 【lovemengx】
What most people do on the Internet is to block key messages , What is actually right is :
1. Reload in the dialog header file OnOK()( Carriage return will trigger ) and OnCancel()(ESC Will trigger ) function .
// XXXXXXXDlg.h
class CXXXXXXXDlg : public CDialogEx
{
......
private:
virtual void OnOK() {};
virtual void OnCancel() {};
......
};2. Overloaded windows will not close , The reason is because it was intercepted , Increase required WM_CLOSE() Message response .
// XXXXXXXDlg.cpp
void CXXXXXXXDlg::OnClose()
{
// TODO: Add message handler code and / Or call the default value
EndDialog(IDCANCEL);
CDialogEx::OnClose();
} Reference article :https://blog.csdn.net/bbdxf/article/details/7395201
MFC Solve carriage return and ESC The issue of closure , heavy load OnOk(),OnCancel() Function _ Stupid D Happiness - Back garden -CSDN Blog
边栏推荐
- 分享三个关于CMDB的小故事
- Viewing the ambition of Xiaodu technology from intelligent giant screen TV v86
- Devaxpress Chinese description --tcxpropertiesstore (property store recovery control)
- Anti crawling strategy (IP proxy, setting random sleep time, bilbili video information crawling, obtaining real URLs, processing special characters, processing timestamp, and multithreading)
- Sensor: sht30 temperature and humidity sensor testing ambient temperature and humidity experiment (code attached at the bottom)
- synchronized下的 i+=2 和 i++ i++执行结果居然不一样
- Detailed explanation of maxpooling corresponding to conv1d, conv2d and conv3d machines of tensorflow2
- STM32 timer interrupt learning notes
- Why is "iFLYTEK Super Brain 2030 plan" more worthy of expectation than "pure" virtual human
- 指针链表的实现
猜你喜欢

Qt实现思维导图功能(二)

Decoding iFLYTEK open platform 2.0 is a fertile land for developers and a source of industrial innovation

Parameter measurement method of brushless motor

分享三个关于CMDB的小故事

DFS and BFS to solve Treasure Island exploration

What is solid angle

Devaxpress Chinese description --tcxpropertiesstore (property store recovery control)

Devaxpress Chinese description -- tdxgallerycontrol object (gallery component)

Opencv camera calibration (1): internal and external parameters, distortion coefficient calibration and 3D point to 2D image projection
![[the third day of actual combat of smart lock project based on stm32f401ret6 in 10 days] communication foundation and understanding serial port](/img/82/ed215078da0325b3adf95dcd6ffe30.jpg)
[the third day of actual combat of smart lock project based on stm32f401ret6 in 10 days] communication foundation and understanding serial port
随机推荐
Delphi 10.4.2 release instructions and installation methods of three patches
[learning notes] xr872 GUI littlevgl 8.0 migration (display part)
Can't use typedef yet? C language typedef detailed usage summary, a solution to your confusion. (learning note 2 -- typedef setting alias)
移动IPv6光猫登录的一般ip地址账号与密码,移动光猫变桥接模式
Devaxpress Chinese description --tcximagelist (enhanced image list control)
Learning notes 51 single chip microcomputer keyboard (non coding keyboard and coding keyboard, scanning mode of non coding keyboard, independent keyboard, matrix keyboard)
万字讲清 synchronized 和 ReentrantLock 实现并发中的锁
华为设备配置私网IP路由FRR
传感器:MQ-5燃气模块测量燃气值(底部附代码)
C language conditional compilation routine
Ctrip reshapes new Ctrip
Detailed explanation of deep learning parameter adjustment skills
Delphi7 compressed pictures (BMP, JPG, PNG)
What is Google plus large text ads? How to use it?
PyFlink实现自定义SourceFunction
华为设备配置CE双归属
【Unity】打包WebGL项目遇到的问题及解决记录
Stm32 3*3 matrix key (register version)
[arithmetic, relation, logic, bit, compound assignment, self increasing, self decreasing and other] operators (learning note 4 -- C language operators)
Ten thousand words make it clear that synchronized and reentrantlock implement locks in concurrency