模拟“删除”从上下文菜单中按键
我向 MFC CRichEditCtrl 添加了一个上下文菜单,它包含一个删除选项,该选项的作用是: ReplaceSel("",TRUE);
它似乎可以工作,但是当我查看撤消日志时,它不一样......我们最终会丢失字符序列的末尾。
有什么想法可以让我的代码与按 DELETE 时发生的情况相同吗?或者甚至重用默认功能?
I added a context menu to a MFC CRichEditCtrl, it includes a delete option which does:ReplaceSel("",TRUE);
It appears to work but when I look at the undo log, it's not the same... we end up with characters being lost at the end of the sequence.
Any ideas how I can make my code be the same as what happens when you press DELETE? Or even reuse that default functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SetFocus到编辑窗口,然后删除键的keybd_event?
或者查看按下 del 键时是否触发 WM_COMMAND 消息并发送相同的消息。您可以查看他们的资源(使用 ResHacker 等)并查看 DEL 键是否是现有 WM_COMMAND 消息的加速器,或者仅使用 SpyXX。
SetFocus to edit window, and then keybd_event of delete key?
Or see if a WM_COMMAND message is triggered when the del key is hit and send the same message. You could have a look at their resources (using ResHacker or the like) and see if the DEL key is an accelerator for an existing WM_COMMAND message, or just use SpyXX.