你可以响应CTreeCtrl的TVN_SELCHANGING消息:下面是从MSDN中摘出来的。
TVN_SELCHANGING
pnmtv = (LPNMTREEVIEW) lParam Notifies a tree view control's parent window that the selection is about to change from one item to another. This notification message is sent in the form of a WM_NOTIFY message. Returns TRUE to prevent the selection from changing.
pnmtv
Address of an NMTREEVIEW structure. The itemOld and itemNew members contain valid information about the currently selected item and the newly selected item. The action member indicates whether a mouse or keyboard action is causing the selection to change. For a list of possible values, see the description of the TVN_SELCHANGED notification message.
TVN_SELCHANGING
pnmtv = (LPNMTREEVIEW) lParam Notifies a tree view control's parent window that the selection is about to change from one item to another. This notification message is sent in the form of a WM_NOTIFY message. Returns TRUE to prevent the selection from changing.
pnmtv
Address of an NMTREEVIEW structure. The itemOld and itemNew members contain valid information about the currently selected item and the newly selected item. The action member indicates whether a mouse or keyboard action is causing the selection to change. For a list of possible values, see the description of the TVN_SELCHANGED notification message.
解决方案 »
- 用api如何写查找/替换框部分的代码
- MFC 学习
- 请教高手:如何用VC实现文件传输(上传和下载)中的断点续传的功能?
- 分割窗口~~~~~~~~~~
- 怎么使程序一开始就最大化?
- cHtmlEditView中使用clipboard的问题,在线死等
- 一个文件里面共有那么多文件,我想把这东西在VC打开运行一下,但这么多文件好象要全部打开才可以运行呀
- 为什么外网访问不了内网机子?
- 请问:OnLButtonDown(UINT nFlags,CPoint point)中的point坐标为何不能转换成逻辑坐标?
- 如何用VC的MFC编写NT的服务(Service)程序?
- 谁能告诉我:没有学位证书影响大吗?
- 怎样更改缺省project的设置啊?
NMHDR hdr;
UINT action;
TVITEM itemOld;//就是这个
TVITEM itemNew;
POINT ptDrag;
} NMTREEVIEW, FAR *LPNMTREEVIEW;