Title a console app?

Discussion in 'C' started by Colin Mac, Jan 21, 2007.

  1. Colin Mac

    Colin Mac New Member

    Joined:
    Jan 21, 2007
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    How do I title my console apps in C?
     
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    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,
    Code:
    #include <stdio.h>
    #include <windows.h>
    #include <wincon.h>
    
    int main()
    {
    	[B]SetConsoleTitleA ("My Title");[/B]
    	puts ("This window should have my title");
    	getchar ();
    	return 0;
    }
    
    The result will look like this:
    [​IMG]
     
  3. Colin Mac

    Colin Mac New Member

    Joined:
    Jan 21, 2007
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice