CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Title Bar Color

  1. #1
    Join Date
    Jun 2005
    Posts
    160

    Title Bar Color

    Can any one tell me how to change the title bar color??????????

  2. #2
    Join Date
    May 2005
    Posts
    4,954

    Re: Title Bar Color

    if you want to change the title bar of all the windows in the system you should use the ::SetSysColors(..) api with COLOR_ACTIVECAPTION parameter and the desired color
    here is the link
    http://msdn.microsoft.com/library/de...tsyscolors.asp

    if you want to change color caption only for your window then you have to intercept the WM_NCPAINT and in there paint the title bar yourself..

    if i helped dont forget to rate :-)
    Cheers

  3. #3
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: Title Bar Color

    This article http://www.codeproject.com/gdi/customcaption.asp

    shows how to change colours / caption styles although it may be slightly outdated for XP
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  4. #4
    Join Date
    Jun 2005
    Posts
    160

    Re: Title Bar Color

    I tried with COLOR_ACTIVECAPTION option. it is not working. please give me some more details

  5. #5
    Join Date
    May 2005
    Posts
    4,954

    Re: Title Bar Color

    its sure working mate
    Code:
    COLORREF NewColor = RGB(255, 0, 0);  
    int  flag = COLOR_ACTIVECAPTION; 
    ::SetSysColors(1, &flag, &NewColor);
    if i helped dont forget to rate :-)
    Cheers

  6. #6
    Join Date
    Jun 2005
    Posts
    160

    Re: Title Bar Color

    Now it is working. thanks for golanshahar and all the replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured