Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

How do I create a console window with a scrollbar in Win32/SDK?

I have a Win-32 GUI application which uses a console window to display output of "printf" type functions.  I created the console window using AllocConsole(), and redirected the stream stdout to the console STDOUT.  However the console window does not appear with scroll bar so I cannot scroll up to see all of my output sent to the console
window.  Any suggestions on how to create console window with scrollbars?  

Thanks,
daniel


--
Daniel G. Chandran              Phone: (609) 386-8600  Ext: 127
Panasonic AVC American Labs.        Fax: (609) 386-4999
95D Conneticut Drive                e-mail: daniel@research.panasonic.com
Burlington, NJ 08016
0
danchandran
Asked:
danchandran
1 Solution
 
y96andhaCommented:
Use the SetConsoleScreenBufferSize function to change the buffer size. By doing this, you can specify how many scrollback lines you want. The following code sample sets the buffer size to 500 lines.

COORD co;
co.X = 80;
co.Y = 500;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), co);

0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now