防止双击MFC对话框按钮
问题说明
我正在MFC C 中开发Autocad/Bricscad对话框.知道我发现了一个更大的问题.有一个对话框为特殊"图形对象设置元数据.我使用此对话框(循环)更新每个特殊"图形对象的数据.因此,如果您有十个特殊"图形对象,则同一对话框将打开十次(成功).现在我有一个问题,用户有时会双击确定"按钮.但是,如果双击速度足够快,则该对话框下一个实例的确定"按钮将自动单击.我尝试了很多(例如,如果单击该按钮则禁用该按钮),但是没有任何解决方法.也许你们当中有人有个好主意.
i'm developing Autocad/Bricscad-Dialogs in MFC C . Know i detected a bigger problem. There is a dialog which sets metadata for 'special' drawing objects. I update the data of every 'special' drawing object with this dialog (in a loop). So if you have ten 'special' drawing objects, the same dialog will open ten times (successively). Now i have the problem that the user sometimes make a double click on the "OK"-Button. But if this double click is fast enough, the "OK"-Button of the next instance of this dialog will clicked automatically. I tried a lot (for example disabling the button if it was clicked) but nothing solved my problem. Maybe someone of you have a good idea.
最诚挚的问候, 西蒙
正确答案
打开新对话框时,您可以在进入常规消息循环之前刷新鼠标单击消息的消息队列,例如:
When you open a new dialog you can flush the message queue of mouse click messages before going into your normal message loop, e.g.:
MSG msg;
while (PeekMessage(&msg, hWndDlg, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE));
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcghcgh
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20