#### Archived

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

# c:\console help.exe

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

## 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 #include 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 on other sites
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 on other sites
Ofcoarce!

You see, I used an int for the handle instead of a HANDLE type!
Thats propably why the thing never worked!

Thanks

----------=Last Attacker=----------

ICQ: 120585863
E-mail: laextr@icqmail.com

• ### Forum Statistics

• Total Topics
628677
• Total Posts
2984180

• 13
• 12
• 9
• 10
• 10