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#
  4. Peeping Tom

Peeping Tom

Scheduled Pinned Locked Moved C#
helptutoriallounge
4 Posts 2 Posters 0 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.
  • I Offline
    I Offline
    IceWater42
    wrote on last edited by
    #1

    I would like to get access to the chat area of a commercial application so i can retrieve the text for analysis ... WITHOUT using the mouse. Currently, i am accessing the text, successfully, by smulating mouse-clicks in the commercial application's chat area, and using SendInput (-c) to put the data in the clipboard, once every 30 seconds. But that technique has two bad side effects ... it steals the cursor for a split second, and it uses the clipboard in a VERY non-standard way. I am hoping that there is a way for me to get the data by going directly into the chat control of the target window. I have the handle to the window but i am not very knowledgeable about the structure of windows and child controls of a window, so i don't know how to approach the problem this way. Please advise, or point me to an understandable explanation ... lol ... of how to do that. (I tried the MSDN libraries and i could not get a clue.) I am also open to any alternative ideas. Thank you very very much.

    L 1 Reply Last reply
    0
    • I IceWater42

      I would like to get access to the chat area of a commercial application so i can retrieve the text for analysis ... WITHOUT using the mouse. Currently, i am accessing the text, successfully, by smulating mouse-clicks in the commercial application's chat area, and using SendInput (-c) to put the data in the clipboard, once every 30 seconds. But that technique has two bad side effects ... it steals the cursor for a split second, and it uses the clipboard in a VERY non-standard way. I am hoping that there is a way for me to get the data by going directly into the chat control of the target window. I have the handle to the window but i am not very knowledgeable about the structure of windows and child controls of a window, so i don't know how to approach the problem this way. Please advise, or point me to an understandable explanation ... lol ... of how to do that. (I tried the MSDN libraries and i could not get a clue.) I am also open to any alternative ideas. Thank you very very much.

      L Offline
      L Offline
      Luis Alonso Ramos
      wrote on last edited by
      #2

      Ok, supposing you're trying to do this for a something legal, first you have to use Spy++ to find the text control in the window hierarchy. Then you could use EnumChildWindows as many times as required to get the Edit control (that's the way they are called in the Windows API :)) handle, and send it a WM_GETTEXT message. But since the other app probably isn't written in .NET, you're better off using the Win32 API. If it's a regular text box coontrol, it's actually rather easy. -- LuisR


      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

      The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

      I 1 Reply Last reply
      0
      • L Luis Alonso Ramos

        Ok, supposing you're trying to do this for a something legal, first you have to use Spy++ to find the text control in the window hierarchy. Then you could use EnumChildWindows as many times as required to get the Edit control (that's the way they are called in the Windows API :)) handle, and send it a WM_GETTEXT message. But since the other app probably isn't written in .NET, you're better off using the Win32 API. If it's a regular text box coontrol, it's actually rather easy. -- LuisR


        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

        The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005

        I Offline
        I Offline
        IceWater42
        wrote on last edited by
        #3

        Thanks, Luis You are right .. it was easy ... 2 statements ... after i spent 16 hours trying to get the compiler to accept my SendMessage statement ... ... but what the heck .. i learned a LOT about DLLs, SPY++, and overrides in the process :) Thanks, again, for your response.

        L 1 Reply Last reply
        0
        • I IceWater42

          Thanks, Luis You are right .. it was easy ... 2 statements ... after i spent 16 hours trying to get the compiler to accept my SendMessage statement ... ... but what the heck .. i learned a LOT about DLLs, SPY++, and overrides in the process :) Thanks, again, for your response.

          L Offline
          L Offline
          Luis Alonso Ramos
          wrote on last edited by
          #4

          I'm glad I could help! :) It feels nice when after a lot of hours you finally manage to do something and then think "next time it'll take me 5 minutes" :) The good thing is that you learned a lot. Altough with .NET some may say that Win32 is becoming obsolete for everything but some low-level tasks, I've found many times that good knowledge of it can save you even in the managed world!

          Luis Alonso Ramos Intelectix Chihuahua, Mexico

          Not much here: My CP Blog!

          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