如何抓取控件的消息?

xjxy 2014-10-28 10:11:03
有一个treeview控件,想抓取类似TVM_SETITEM之类的消息,通过setwindowlong和callwindowproc试了一下,但是没有抓到任何消息,在其父窗口也没抓到类似消息,哪位大侠指点一下,多谢!
...全文
264 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jianghandaxue 2014-10-29
  • 打赏
  • 举报
回复
你要的控件消息无非就是鼠标点击的消息,这个控件相关的消息的,自己看看哦
赵4老师 2014-10-29
  • 打赏
  • 举报
回复
Setting a Breakpoint on a Message Received by a Windows Function You can set message breakpoints to stop the debugger when a particular WndProc function message is received. Note Message breakpoints work only on x86- or Pentium-based systems. To set a breakpoint on a message From the Edit menu, click Breakpoints. The Breakpoints dialog box appears. Click the Messages tab. In the Break At WndProc text box, type the name of the Windows function. If you are setting a breakpoint during a debug session, the list contains the exported functions in your project. In the Set One Breakpoint For Each Message To Watch list box, select the message. To set another breakpoint, press ENTER, and then repeat steps 3 and 4. The Breakpoints list displays the currently active breakpoints. Click OK to set the breakpoints. Note If you interrupt execution while Windows or other system code is running, the results can be unpredictable.
schlafenhamster 2014-10-28
  • 打赏
  • 举报
回复
用向导 响应 以上 消息。
shen_wei 2014-10-28
  • 打赏
  • 举报
回复
A tree control (CTreeCtrl) sends the following notification messages as WM_NOTIFY messages:

Notification message
 Description
 
TVN_BEGINDRAG
 Signals the start of a drag-and-drop operation
 
TVN_BEGINLABELEDIT
 Signals the start of in-place label editing
 
TVN_BEGINRDRAG
 Signals the start of a drag-and-drop operation, using the right mouse button
 
TVN_DELETEITEM
 Signals the deletion of a specific item
 
TVN_ENDLABELEDIT
 Signals the end of label editing
 
TVN_GETDISPINFO
 Requests information that the tree control requires to display an item
 
TVN_ITEMEXPANDED
 Signals that a parent item's list of child items was expanded or collapsed
 
TVN_ITEMEXPANDING
 Signals that a parent item's list of child items is about to be expanded or collapsed
 
TVN_KEYDOWN
 Signals a keyboard event
 
TVN_SELCHANGED
 Signals that the selection has changed from one item to another
 
TVN_SELCHANGING
 Signals that the selection is about to be changed from one item to another
 
TVN_SETDISPINFO
 Notification to update the information maintained for an item
 
笨笨仔 2014-10-28
  • 打赏
  • 举报
回复
使用API函数试试

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧