erm - coord struct - returning values

This is a discussion on erm - coord struct - returning values within the Windows Programming forums, part of the Platform Specific Boards category; ok, im trying to get the number of lines that a windows console is using. Im using the coord struct ...

  1. #1
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    erm - coord struct - returning values

    ok, im trying to get the number of lines that a windows console is using.

    Im using the coord struct which is part of the getsystemmetrics struct defined in windows.h

    the co-ord contains x and y and i want the value returned in y
    only im not really clear on how to get it

    msdn is as useful as a dead chimp at a tea party and my windows book doesnt deal with it.

    any ideas
    Monday - what a way to spend a seventh of your life

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    Code:
    #include <windows.h>
    #include <stdio.h>
    
    int main(void)
    {
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    
        GetConsoleScreenBufferInfo(hConsole, &csbi);
    
        printf("Horixontal Lines: %d\nVertical Lines:%d,  csbi.srWindow.Right, csbi.srWindow.Bottom);
    
        return 0;
    }
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 12-03-2008, 02:10 AM
  2. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 09:42 AM
  3. Function validation.
    By Fhl in forum C Programming
    Replies: 10
    Last Post: 02-22-2006, 07:18 AM
  4. Get all values from a struct
    By Muphin in forum C++ Programming
    Replies: 10
    Last Post: 08-05-2005, 08:47 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM

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