get the console cursor position, not set it

This is a discussion on get the console cursor position, not set it within the C++ Programming forums, part of the General Programming Boards category; does any body know of a windows API function that gets the cursor console position, not set it? to set ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    get the console cursor position, not set it

    does any body know of a windows API function that gets the cursor console position, not set it?

    to set it i use:
    Code:
    void gotoxy(int x, int y)
    {
        coord.X = (short)x;
        coord.Y = (short)y;
        SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
    }
    is there a way to GET where it currently is?

    and please don't tell me to read the faq.

  2. #2
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    Munich, Germany
    Posts
    224
    see the faq....

    nay ... just kidding... here's what you need


    BOOL GetConsoleScreenBufferInfo (
    HANDLE hConsoleOutput, // handle to screen buffer
    PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo //screen buffer information
    );

    typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
    COORD dwSize;
    COORD dwCursorPosition; // <-- here's what you want
    WORD wAttributes;
    SMALL_RECT srWindow;
    COORD dwMaximumWindowSize; } CONSOLE_SCREEN_BUFFER_INFO ;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. optimising program
    By SONU in forum C Programming
    Replies: 1
    Last Post: 05-18-2008, 10:28 AM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 01:39 PM
  3. Full Screen Console
    By St0rmTroop3er in forum C++ Programming
    Replies: 1
    Last Post: 09-26-2005, 09:59 PM
  4. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  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