Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
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.
29280 Discussions

Setting location of Console & clearing contents?

rkaehler
Beginner
408 Views

Is there a programatic way to set the initial location of a console window created using AllocConsole() (or move it after creation)?

Also, is there a way to clear the console buffer?

TIA

0 Kudos
1 Reply
anthonyrichards
New Contributor III
408 Views
Quoting - rkaehler

Is there a programatic way to set the initial location of a console window created using AllocConsole() (or move it after creation)?

Also, is there a way to clear the console buffer?

TIA

Look in the language help index and you will find loads of Windows API console functions.

To move the console window, use SetConsoleWindowInfo to place the console window where you want it. It needs a console screen buffer handle as an argument.

To wipe the console window, create another console screen buffer using CreateConsoleScreenBuffer, save its handle.
Switch to the new (empty) buffer using SetConsoleActiveScreenBuffer.
Delete buffers that are no longer required using the CloseHandle function.

0 Kudos
Reply