Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Get text from tree control

Get text from tree control

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
5 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ravi Shankar
    wrote on last edited by
    #1

    Hi I have a application running which got tree control in it(say Windows explorer). I get the handle of the tree control through another program (my program) and then try to get the tree control items string. But I always get null, but even though I can do other operation like delete a particular item from it. (both the program are in different process). Cant I get the string for a third party application running in a different process? I know I can get string from the edit control, but I could not get from a tree control. Regards Ravi

    M 1 Reply Last reply
    0
    • R Ravi Shankar

      Hi I have a application running which got tree control in it(say Windows explorer). I get the handle of the tree control through another program (my program) and then try to get the tree control items string. But I always get null, but even though I can do other operation like delete a particular item from it. (both the program are in different process). Cant I get the string for a third party application running in a different process? I know I can get string from the edit control, but I could not get from a tree control. Regards Ravi

      M Offline
      M Offline
      Mike Dunn
      wrote on last edited by
      #2

      I assume you have a char buffer and you're putting its address in a TVITEM struct, and passing that struct in a TVM_GETITEM message? That won't work because the process with the tree can't access the memory in your process. You're lucky the other process isn't GPFing, actually.

      R 1 Reply Last reply
      0
      • M Mike Dunn

        I assume you have a char buffer and you're putting its address in a TVITEM struct, and passing that struct in a TVM_GETITEM message? That won't work because the process with the tree can't access the memory in your process. You're lucky the other process isn't GPFing, actually.

        R Offline
        R Offline
        Ravi Shankar
        wrote on last edited by
        #3

        Yes, I did the same. But I could get the edit box text, how? Also Is there a way to get the tree control item and its strings? regards Ravi

        M 1 Reply Last reply
        0
        • R Ravi Shankar

          Yes, I did the same. But I could get the edit box text, how? Also Is there a way to get the tree control item and its strings? regards Ravi

          M Offline
          M Offline
          Mike Dunn
          wrote on last edited by
          #4

          Becuase you get an edit box's text with GetWidowText(), which is designed to work between different processes.

          R 1 Reply Last reply
          0
          • M Mike Dunn

            Becuase you get an edit box's text with GetWidowText(), which is designed to work between different processes.

            R Offline
            R Offline
            Ravi Shankar
            wrote on last edited by
            #5

            Thanks Mike for your answers! But I dont understand they gave the capability to GetWindowText but not to treecontrol! If they gave they should have given to all or just none! Oh boy, I want to get the strings from the control!!! any help is appricated! regards Ravi

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups