Getting characters FROM screen

This is a discussion on Getting characters FROM screen within the C++ Programming forums, part of the General Programming Boards category; Say my data on the screen is like so: abc def geh How can I read in the entire screen ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    417

    Getting characters FROM screen

    Say my data on the screen is like so:

    abc
    def
    geh

    How can I read in the entire screen into a matrix? I'm trying to write a function that finds the last non-space character written to the screen, either as input or output... so if the d was typed in or if it was printfed, it wouldn't make a difference.

    Does anyone know how to do so?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    What OS?
    Is this for I/O or your program or another program?

    gg

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    its a Win32 Console Application, compiled with Microsoft Visual C++ 6.0

    I want to read in the data displayed on the screen, and I'm not using really weird commands to have multiple consoles.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    Do you want to "read in the data displayed on the screen" of your program, or another program that is executed?

    If you want to read the data of your program on the screen, you will have to use the WIN32 Console API's
    If you want to monitor the I/O of another application, you will have to spawn that application yourself and redirect it's standard input, standard output, and standard error. This technique is detailed in this article.

    gg

  5. #5
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    I looked at the help file, but I don't know how to use those

  6. #6
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    What problem are you trying to solve? Perhaps there is another way to solve the problem.

    gg

  7. #7
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Win32 is a graphical system and therefore the display on the screen is not an arrangement of ASCII characters. What is drawn on the screen is usually done by you in the first place, often on a WM_PAINT message. So you should know what's been placed on the screen and where based on the fact that you drew it. The screen itself doesn't know any more than colors on each pixel. I hope that helps to explain it a bit.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  8. #8
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    Only a portion of the WIN32 API has to do with writting GUI applications.
    ...
    The WIN32 Console API's may not be able to do what you want after all. You may have to use the second technique I posted earlier if you want access to everthing that is put on the screen.

    gg

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    Is there any way to make an underline, make it bold, or italic, then, if it isn't true ASCII?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Counting the characters from each word from a text file
    By flipguy_ph in forum C Programming
    Replies: 6
    Last Post: 04-27-2009, 05:56 PM
  2. Linux Problem Screen Resoultion
    By Matus in forum Tech Board
    Replies: 1
    Last Post: 01-29-2009, 03:39 PM
  3. [C] GDI: how to erase material drawn at an entire screen DC
    By pc2-brazil in forum Windows Programming
    Replies: 3
    Last Post: 01-24-2009, 06:24 PM
  4. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  5. printing non-ASCII characters (in unicode)
    By dbaryl in forum C Programming
    Replies: 1
    Last Post: 10-25-2002, 01:00 PM

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