473,395 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

HELP: Controlling Console Output

Hello

I am a new C++ programmer and am working with the Visual C++ studio.
I am attempting to create a simple console application for myself but I fin
that neither of the introductory C++ books I own tell me how to clear the console
screen or change the font color. Is there some way to do this that could b
understood by a novice programmer?

Here are the three things I would like to do:
[1] Control the size of the console screen when the program is first
executed (it always opens up as a small window but I want it to open t
a full screen.
[2] Clear the scree
[3] Change the font color

I will appreciate any help! Thanks

Nov 17 '05 #1
1 2115
>I am a new C++ programmer and am working with the Visual C++ studio.
I am attempting to create a simple console application for myself but I find
that neither of the introductory C++ books I own tell me how to clear the console
screen or change the font color.
They won't tell you because there's no universal way of doing it.

For a MS Windows console application you can use:
Here are the three things I would like to do:
[1] Control the size of the console screen when the program is first
executed (it always opens up as a small window but I want it to open to
a full screen.)
Try SetConsoleScreenBufferSize.
[2] Clear the screen
Have a look at Knowledge Base article 99261 "HOWTO: Performing Clear
Screen (CLS) in a Console Application".
[3] Change the font color


Try SetConsoleTextAttribute.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Andrey Mosienko | last post by:
We are using PostgreSQL about two years beginning from version 7.0. I have one question about starting postmaster: Is there way to detach it from the controlling terminal under FreeBSD? My...
1
by: Doug Perkes | last post by:
I have a legacy console application that I need to control with a c# desktop application. The main functionality i need is the following: Send strings Read strings at specific locations Send...
0
by: F.C. | last post by:
Hello, :) I'm currently writing a frontend for a console application using VB .net. I'm using the traditional Process creation to launch it and redirect input and output to my windows...
6
by: Paulers | last post by:
Hello, I am trying to manipulate a console based application from another application for example I need to launch the console application, provide it input and take the output from the console...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.