Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

console text

Intel_C_Intel
Employee
571 Views
When you write reams of text to a console is there a way in which text that has rolled off the window can be retrieved ? It must be possible to endow the console window with scroll bars so that you can review whatever text was written to it no matter how many screens ago.

Hope you can help,
Gerry T.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
571 Views
Not that I know of. You can enlarge the console window to include scroll bars - on Windows NT/2000, you can configure the window to have as many lines as you want, but on Windows 9x, 50 is the maximum.

Steve
0 Kudos
Intel_C_Intel
Employee
571 Views
Yes the CVF docs state that:
On a Windows NT or Windows 2000 system, the number of character lines is substantially larger than on Windows 98, Windows Me, and Windows 95 systems.

However, I haven't been able to find out how much larger nor how to set the number of lines. If you can find out I'd appreciate it as this would answer my question.

Thanks,
Gerry T.
0 Kudos
Intel_C_Intel
Employee
571 Views
I found a clue in the CVF confunc sample. Essentially having AllocConsole(d), do
...
fhandle = GetStdHandle(STD_OUTPUT_HANDLE)
wsize.x = 80 ! must be >= currently set console window line length
wsize.y = 5000 ! must be >= currently set console window no of lines
! get a console buffer bigger than the console window which will give
! scroll bars on the console window to scroll through the console buffer
statConsole = SetConsoleScreenBufferSize(fhandle, wsize)

I post this on the off chance that it might be useful to someone else.

Two things:
1. what's the upper limit on wsize.x/y?
2. What's the difference between the 'handle' provided by GetStdHandle and by FindWindow? They are numerically different and seem to serve different purposes.

Ciao,
Gerry T.
0 Kudos
Reply