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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Get button color from theme

Get button color from theme

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 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.
  • C Offline
    C Offline
    cje
    wrote on last edited by
    #1

    I have just added a manifest to my project so that I can get the XP theme. I am having trouble getting the button colors so that my owner-drawn buttons can conform to the theme. I have tried GetThemeSysColor( hTheme, COLOR_BTNFACE ) but it doesn't return the correct value. I'm currently hard-coding (yuk) the RGB values for the button color in it's pressed and unpressed states but most certainly would like to be able to get the value programatically. any ideas? cje cje

    J 1 Reply Last reply
    0
    • C cje

      I have just added a manifest to my project so that I can get the XP theme. I am having trouble getting the button colors so that my owner-drawn buttons can conform to the theme. I have tried GetThemeSysColor( hTheme, COLOR_BTNFACE ) but it doesn't return the correct value. I'm currently hard-coding (yuk) the RGB values for the button color in it's pressed and unpressed states but most certainly would like to be able to get the value programatically. any ideas? cje cje

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      The proper identifier is TMT_BTNFACE, which has a different value than COLOR_BTNFACE. Also note that button faces in the XP themes may have a gradiant, not a single color. If you want the same look, check out DrawThemeBackground or related functions. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      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