tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Problem using GetLargestConsoleWindowSize


From: Carlos Montiers
Subject: [Tinycc-devel] Problem using GetLargestConsoleWindowSize
Date: Sat, 14 Dec 2013 23:23:25 -0300

Hello. Using the last version of tiny c I try use the function GetLargestConsoleWindowSize, but I get ERROR_INVALID_HANDLE

the program print:
C:\tcc>test.exe
Error:6
coords.X:-4340 coords.Y:30654

the same code using gcc:
C:\tcc>gcc test.c -o test.exe

C:\tcc>test.exe
coords.X:170 coords.Y:59

that is right.

Please, someone can helpme with the solution. I want use for this code tiny c and not gcc.


This is the code:

#include <windows.h>
#include <stdio.h>

int main()
{
    HANDLE hOut;
    COORD coords;
    hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    if (INVALID_HANDLE_VALUE == hOut) {
        printf("STD_OUTPUT_HANDLE is INVALID_HANDLE_VALUE\n");
    }
   
    coords = GetLargestConsoleWindowSize(hOut);
   
    if (coords.X <= 0 || coords.Y <= 0) {
        printf("Error:%d\n", GetLastError());
    }

    printf("coords.X:%d coords.Y:%d\n", coords.X, coords.Y);
   
    getchar();
   
    return 0;
   
}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]