Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Last Attacker

c:\console help.exe

This topic is 6229 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I was experimenting with the Wincon.h header (included in my project ofcource). And I managed to atleast change the titlebar of the Win32Console.
  
#include<windows.h>
#include<wincon.h>

int main()
{
     AllocConsole(); //Start console

     SetConsoleTitle("Hello!");
     FreeCosole();
     Return 0;
};
  
Thats the fearthest I came, if I tried to add the code to insert colored text, the compiler, compiled successfully but when the app. ran, windows came up with an "illegal error operation". I could''nt understand it. If anyone can propably help me, PLEASE do so! Thanks! ----------=Last Attacker=---------- ICQ: 120585863 E-mail: laextr@icqmail.com

Share this post


Link to post
Share on other sites
Advertisement
Did you remember to get the Console handle before trying to Set the text color?

HANDLE ConsoleHandle;
ConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(ConsoleHandle, FOREGROUND_GREEN);

Z.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!