retreiving console window text

This is a discussion on retreiving console window text within the Windows Programming forums, part of the Platform Specific Boards category; I currenly have a console chat client. Is there anyway i can make a program that recieves window messages sent ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    24

    retreiving console window text

    I currenly have a console chat client.

    Is there anyway i can make a program that recieves window messages sent from the console window each time text is displayed.

    Then each time my program recieves a message, it would retrieve the text that was sent to the console window, then store it into a char array, or would i have to recieve all of the text each time, then seperate it.

    just any idea on the function names would be helpful

    Thanks

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Something like redirecting stdin/stdout with anonymous pipes may be of some interest to you.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Anal comment spacer DominicTrix's Avatar
    Join Date
    Apr 2002
    Posts
    120
    Not sure this would work - but it worked for a richedit control I was wanting to do the same thing to (I think).

    You need to set up a hook in a dll that will intercept all the messages going to the console window (you'll need to get the HWND of the window). If you can figure out what the message is that snds the new text to the console you can simply forward it to your app. In my case the message was WM_REPLACESEL.

    Hope thats of some use.
    "The most important thing about acting is honesty. If you can fake that you've got it made" - George Burns

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 07:14 AM
  3. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  4. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21