-
February 14th, 2012, 09:57 AM
#1
"Windows Explorer"
If I use "Windows Explorer" style in MFC application how work with events in CTreeView. For example with OnExpand. Because in MESSAGEMAP it is needed to write name of CTreeView, but name i can't find. How get it?
-
February 14th, 2012, 10:27 AM
#2
Re: "Windows Explorer"
What "name of CTreeView" do you mean?
What IDE are you using?
In what class are you trying to implement message handler?
Victor Nijegorodov
-
February 14th, 2012, 10:31 AM
#3
Re: "Windows Explorer"
Just click on the Class View tab in Visual Studio, select the CTreeView derived class, right click and select properties, click on the messages button and add you handler. (This is for 2008. Other versions may be different).
-
February 14th, 2012, 10:38 AM
#4
Re: "Windows Explorer"
What "name of CTreeView" do you mean?
For example, in
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_TREE1, OnItemExpandingTree1)
"IDC_TREE1"...
What IDE are you using?
VS2008
In what class are you trying to implement message handler?
In CMainFrame class...
-
February 14th, 2012, 10:41 AM
#5
Re: "Windows Explorer"
Originally Posted by AKE
What "name of CTreeView" do you mean?
For example, in
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_TREE1, OnItemExpandingTree1)
"IDC_TREE1"...
What IDE are you using?
VS2008
In what class are you trying to implement message handler?
In CMainFrame class...
Wouldn't that be better handled in the TreeView class?
-
February 14th, 2012, 10:41 AM
#6
Re: "Windows Explorer"
GCDEF, there is OnExpanding absent...
-
February 14th, 2012, 10:44 AM
#7
Re: "Windows Explorer"
Originally Posted by AKE
What "name of CTreeView" do you mean?
For example, in
ON_NOTIFY(TVN_ITEMEXPANDING, IDC_TREE1, OnItemExpandingTree1)
"IDC_TREE1"...
It is NOT a name, it is a control ID
And in CTreeView derived class this macro is not used. Instead the
Code:
ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemExpandingTree1)
should be used.
Originally Posted by AKE
What IDE are you using?
VS2008
Well, GCDEF already explained how to add message handler in 2008.
Originally Posted by AKE
In what class are you trying to implement message handler?
In CMainFrame class...
Bad idea! Why in CMainFrame?
It should be in a CTreeView derived class!
Victor Nijegorodov
-
February 14th, 2012, 10:47 AM
#8
Re: "Windows Explorer"
Originally Posted by AKE
GCDEF, there is OnExpanding absent...
I see TVN_ITEMEXPANDING
-
February 14th, 2012, 10:51 AM
#9
Re: "Windows Explorer"
Originally Posted by GCDEF
I see TVN_ITEMEXPANDING
... and I also use it since more than a decade...
Victor Nijegorodov
-
February 14th, 2012, 10:56 AM
#10
Re: "Windows Explorer"
VictorN, thanks I will make such... Now I try use it...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|