is there a function that can return the number of lines that a windows console is using?
a C/C++ or a windows function?
is there a function that can return the number of lines that a windows console is using?
a C/C++ or a windows function?
Monday - what a way to spend a seventh of your life
No offence, but you need to learn a bit, I would be happy to teach you. C/c++ is a LANGUAGE, its not an API. Theres no "C++ Functions". And also you're not being clear about what your saying. If I get it correctly, you should be recording how many lines your printing, tho I see no practical use for this.
SPH
you could write a algorithm that
gets the hieght of the screen (in inches),
get the point size of the font,
multiply the point size by 72,
devide the height by the answere to bove instruction,
devide that number by 72.
That is probaly not the fastest or anything but should work.
ummm acturally there are C++ functions. All of them are listed in the ANSI standard(or whatever the eqivilent for C++ is ANSI is for C but since C++ is a extention of C the ANSI standard functions are still present).
Something like GetConsoleScreenBufferInfo() ?
C++ functions are those defined in the ANSI C ++ standard, the windows programming board is for windows specific - not just winapi. As the console is for windows and i need to use a function probably defined in the windows.h header - i posted it to the specific board.
>>see no practical use - thats because i didnt say why i wanted to use it.
why do i multiply it be 72?
--thanks to isometric and sorenson.
Last edited by iain; 01-18-2002 at 01:18 PM.
Monday - what a way to spend a seventh of your life
The reason for multiplying by 72 is that originally a point(for a font) was 1 72ndth of a inch. Although while recently reaserching I found a better way of doing it. GetSystemMetrics funtion, its discribed in more detail on page 82 -93 (including example code) of the bibe, The Windows programming one that is ((Programming Windows 5th edition by Charles petzold). or you should be able to look it up on MSDN tho I havent tried that.
thanks very much ismoetric - the project i am working on with this will benefit all the regular members of the board!
Monday - what a way to spend a seventh of your life