Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to get window color?

how to get window color?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCProgrammer
    wrote on last edited by
    #1

    hi all, i want to get window color that is appear on window border,start menu and taskbar. how can i do this? thanks in advance.

    L 1 Reply Last reply
    0
    • V VCProgrammer

      hi all, i want to get window color that is appear on window border,start menu and taskbar. how can i do this? thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      See the GetSysColor function[^].

      One of these days I'm going to think of a really clever signature.

      V 1 Reply Last reply
      0
      • L Lost User

        See the GetSysColor function[^].

        One of these days I'm going to think of a really clever signature.

        V Offline
        V Offline
        VCProgrammer
        wrote on last edited by
        #3

        yes i already use this . i am using windows 7, and set Leaf color here "Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance" but using GetSysColor this color cant get even i chk this for all values. please help me which value is use to get this color? thanks.

        J 1 Reply Last reply
        0
        • V VCProgrammer

          yes i already use this . i am using windows 7, and set Leaf color here "Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance" but using GetSysColor this color cant get even i chk this for all values. please help me which value is use to get this color? thanks.

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #4

          With enabled themes you can use GetThemeColor[^]. See also the CP article Add XP Visual Style Support to OWNERDRAW Controls[^]. It may contain useful information (the demo application is based on the no longer available ThemeExplorer from Microsoft which shows the colors for the various GUI elements).

          V 1 Reply Last reply
          0
          • J Jochen Arndt

            With enabled themes you can use GetThemeColor[^]. See also the CP article Add XP Visual Style Support to OWNERDRAW Controls[^]. It may contain useful information (the demo application is based on the no longer available ThemeExplorer from Microsoft which shows the colors for the various GUI elements).

            V Offline
            V Offline
            VCProgrammer
            wrote on last edited by
            #5

            //i am use GetThemeColor like this.

            // Getting the text color used for taskbar captions.
            HTHEME hTheme = ::OpenThemeData(NULL, VSCLASS_TASKBAND);
            ATLASSERT(hTheme);

            COLORREF clrText = 0;
            if(hTheme)
            {
            	const HRESULT hr = ::GetThemeColor(hTheme, TDP\_GROUPCOUNT, 0, 
            									   TMT\_BORDERCOLOR, &clrText);		
            
            
            	ATLASSERT(SUCCEEDED(hr));
            
            	::CloseThemeData(hTheme);
            }
            
            // Classic visual scheme.
            ::FillRect(pDC->m\_hDC, &banner\_rect, ::GetSysColorBrush(CTLCOLOR\_DLG));
            
            // Themed visual scheme. Draw transparently.
            ::DrawThemeParentBackground(obj\_RecProfDlg->GetSafeHwnd(), pDC->m\_hDC, &banner\_rect);
            

            but its not useful so please help me ,what values i can use GetThemeColor thanks.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups