如何在 MFC 中获取焦点消息?

发布于 2024-12-29 11:41:10 字数 85 浏览 7 评论 0原文

我有一个带有一些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

左岸枫 2025-01-05 11:41:10

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) via WM_NOTIFY messages.

So you can process WM_NOTIFY messages from your list control in your dialog class. Use the Properties window to create an OnChildNotify handler function and write a switch statement that handles the notification message(s) of interest.

The possible notification messages are listed here in the Windows SDK documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文