Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Title a console app? (http://www.go4expert.com/forums/title-console-app-t2636/)

Colin Mac 21Jan2007 21:25

Title a console app?
How do I title my console apps in C?

DaWei 22Jan2007 00:18

Re: Title a console app?
How you dink with a window obviously depends on the windowing system. It has nothing to do with the language. You don't give any platform information, which is not a great help to your potential respondents, as few of them are mind readers. If you haven't yet read the "Before you make a query" post, please do so. I can also recommend Eric Raymond's little dissertation.

Presuming recklessly that you are concerned with MS Windows, specifically XP, include windows.h and wincon.h (you do have the Platform SDK installed, right?). Then add code like this,

#include <stdio.h>
#include <windows.h>
#include <wincon.h>

int main()
        SetConsoleTitleA ("My Title");
        puts ("This window should have my title");
        getchar ();
        return 0;

The result will look like this:

Colin Mac 22Jan2007 00:54

Re: Title a console app?

All times are GMT +5.5. The time now is 22:52.