如何在 MFC 中获取焦点消息?
我有一个带有一些 CListCtrl 的对话框。我希望当我点击其中之一时,收到killfocus或setfocus消息。
我怎样才能得到它?
I have a dialog box with some CListCtrl. I want that when I click on one of them, receive killfocus or setfocus message.
How I can get it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CListCtrl
类 包装 Win32 ListView 控件。该控件通过WM_NOTIFY 与其父控件(您的对话框)进行通信
消息。因此,您可以在对话框类中处理来自列表控件的
WM_NOTIFY
消息。使用“属性”窗口创建OnChildNotify
处理函数 并编写一个switch
语句来处理感兴趣的通知消息。Windows SDK 文档此处列出了可能的通知消息。
The
CListCtrl
class wraps the Win32 ListView control. That control communicates with its parent (your dialog) viaWM_NOTIFY
messages.So you can process
WM_NOTIFY
messages from your list control in your dialog class. Use the Properties window to create anOnChildNotify
handler function and write aswitch
statement that handles the notification message(s) of interest.The possible notification messages are listed here in the Windows SDK documentation.