惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
O
OpenAI News
WordPress大学
WordPress大学
P
Proofpoint News Feed
J
Java Code Geeks
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Register - Security
The Register - Security
Engineering at Meta
Engineering at Meta
H
Help Net Security
人人都是产品经理
人人都是产品经理
Vercel News
Vercel News
N
Netflix TechBlog - Medium
F
Full Disclosure
U
Unit 42
Latest news
Latest news
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
InfoQ
L
LINUX DO - 最新话题
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
爱范儿
爱范儿
K
Kaspersky official blog
Google Online Security Blog
Google Online Security Blog
小众软件
小众软件
I
Intezer
V
V2EX
S
SegmentFault 最新的问题
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
Security Archives - TechRepublic
Security Archives - TechRepublic
Recent Announcements
Recent Announcements
C
Check Point Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Recorded Future
Recorded Future
博客园 - Franky
Project Zero
Project Zero
S
Securelist
Attack and Defense Labs
Attack and Defense Labs
Spread Privacy
Spread Privacy
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
S
Secure Thoughts
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed

博客园 - 想飞

区块链应用场景 系统微服务架构 shell sed命令 项目pom.xml第一行报错解决方案 Fabric事务机制 MSP成员服务管理 Dockerfile 说明 Docker-Compose 配置详解 Fabric 术语 Docker数据管理:Named volume Mac 查看Volumes Android中的JSON详细总结 经典黑客程序gh0st汇编改写 关于使用WM_COPYDATA进行进程之间交换数据的问题 关于金山开源界面BkWin不能使用DDX 的解决办法 使用#define定义引用的编译问题 WTL中CListViewCtrl中LVS_ICON和LVS_REPORT模式的不同 浏览器研究 图片合并工具V1.1
CListBox没产生LBN_SELCHANGE消息
想飞 · 2011-08-19 · via 博客园 - 想飞

WTL中,定义CListBox的消息接收。 

COMMAND_HANDLER_EX(IDB_HOME_DICT_KEY_LIST,LBN_SELCHANGE, OnListItemchanged)

死活都没有触发到 LBN_SELCHANGE 的消息。

开始以为是消息订阅的问题。

后来用接收所有消息的宏 

用COMMAND_ID_HANDLER_EX(IDB_HOME_DICT_KEY_LIST, OnListItemMsg) 

发现只看到有得到焦点和失去焦点的消息产生。

后查MSDN。

This notification message is not sent if the LB_SETCURSEL message changes the selection.

This notification message applies only to a list box that has the LBS_NOTIFY style.

For a multiple-selection list box, the LBN_SELCHANGE notification is sent whenever the user presses an arrow key, even if the selection does not change.  

原来需要设置style为 

LBS_NOTIFY

后来修改为: 

m_pKeyList = new CListBox;

m_pKeyList->Create(m_dlg->GetViewHWND(),

NULL,

NULL,

WS_VISIBLE | WS_CHILDWINDOW |  LBS_NOTIFY ,

0,IDB_HOME_DICT_KEY_LIST);

 终于能收到 

LBN_SELCHANGE。