program title

This is a discussion on program title within the Game Programming forums, part of the General Programming Boards category; How do you set the title name and icon. I use C++ with sdl an devC++....

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    8

    program title

    How do you set the title name and icon. I use C++ with sdl an devC++.

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    im guessing windows?
    and im guessing you wanna change the icon and title in the windows title bar?

    well, i haven't messed with the icons enough to say but its a little more complicated than changing the text.

    heres how to chang the window title anywhere in the program you have a handle

    #include <windows.h>

    char text[] = "oo Title Changed!! oo"

    SetWindowText(my_window_handle, text);

    function prototype:

    BOOL SetWindowText(
    HWND hWnd,
    LPCTSTR lpString
    );
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    If you have an icon as a resource:
    Code:
    SetClassLong(MainWindow, GCL_HICON, (LONG)LoadIcon(CurInst, MAKEINTRESOURCE(ProgramIcon)));
    ShowWindow(MainWindow, SW_HIDE);
    ShowWindow(MainWindow, SW_SHOW);
    MainWindow is the window, ProgramIcon is the ID of the icon and CurInst is the first HINSTANCE parameter in WinMain.
    The reason I hide then show the window again is that the icon will be misplaced otherwise...
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361

    Re: program title

    Originally posted by willgell
    How do you set the title name and icon. I use C++ with sdl an devC++.
    Look here:
    http://sdldoc.csn.ul.ie/sdlwmsetcaption.php
    Anytime you have a question about SDL browse that website first.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  2. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 11:58 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 08:51 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21