Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1082525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:18:46+00:00 2026-05-16T22:18:46+00:00

I have created a treeview at runtime in MFC application , I have added

  • 0

I have created a treeview at runtime in MFC application , I have added few nodes to it now i want to do some stuff on click of nodes so how i can get click event of treeview ?

My code looks like this :

CTreeCtrl *m_ctlTreeview;
m_ctlTreeview = new CTreeCtrl ;
m_ctlTreeview->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP |
                 TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT |
         TVS_SINGLEEXPAND | TVS_SHOWSELALWAYS |  
         TVS_TRACKSELECT,
                 CRect(25, 60, 385, 260), this, 0x1221);


hparentitem = m_ctlTreeview->InsertItem("Parent",TVI_ROOT);
m_ctlTreeview->InsertItem("Child", hparentitem);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:18:47+00:00Added an answer on May 16, 2026 at 10:18 pm

    One option is to add a handler for the notification messages for that child window ID (0x1221 in your example) to the parent class at design time using ON_NOTIFY in the message map as usual. If there are no messages, the handler won’t be triggered.

    Alternatively, you could add a generic WM_NOTIFY handler to the message map of the parent window with ON_MESSAGE, and then check to see if the message comes from your new tree control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Masterpage that has Treeview. You can select some nodes there. Based
I have created a few small flash widgets that stream .mp3 audio from an
I have created a webservice in .net 2.0, C#. I need to log some
I have created a Treeview and used a stack panel to include a checkbox,
I have a TreeView control that I have created in XAML in a WPF
I have created a menu using a treeview to launch forms when the user
I have created a custom Treeview control and am trying to access the HierarchicalDataTemplate
In some page, my side menu is created dynamically like this. <div id=tree class=treeview>
I have created 2 image resources and I want to dynamically refer to them
I have collapsable/expandable tree created in jQuery. After loading the tree: $(#tree).treeview({ collapsed: true,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.