0

I need to know what the actual color of the Windows SYSLINK controls is, because I need to draw some other elements that should have exactly that same color.

enter image description here

For the moment I use GetSysColor(COLOR_HOTLIGHT) which is the correct color, but is this also correct for themed applications (apparently it is at least under Windows 10)?. The MS documentation is not clear about that.

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
  • 1
    Surely this is part of the theme API, search for parts and states. OK, I think you are looking for TEXT_HYPERLINKTEXT. – David Heffernan Mar 08 '18 at 17:31
  • 3
    you can use code like this `if (HTHEME hTheme = OpenThemeData(0, VSCLASS_TEXTSTYLE)) { COLORREF cc; GetThemeColor(hTheme, TEXT_HYPERLINKTEXT, TS_HYPERLINK_NORMAL, TMT_TEXTCOLOR, &cc); CloseThemeData(hTheme); }` – RbMm Mar 08 '18 at 18:01
  • @DavidHeffernan I always wondered why Microsoft made this so painful. Unfortunately I cannot use Delphe, the whole project is in C++/MFC. – Jabberwocky Mar 09 '18 at 07:13
  • @michael Hmm, not sure why I thought Delphi was relevant here, sorry!!!! – David Heffernan Mar 09 '18 at 07:18
  • @RbMm if you make your comment an answer, you'll have my upvote. May I ask where you found this kind of information? The Microsoft documentation for visual styles is very poor IMO. – Jabberwocky Mar 09 '18 at 08:15
  • 1
    @MichaelWalz - not hard understand `GetThemeColor` get this. and here exist reference to parts. also look in `vsstyle.h` for [`HYPERLINKTEXTSTATES`](https://github.com/wine-mirror/wine/blob/master/include/vsstyle.h#L1369) . for last parameter we need [`Property Identifiers`](https://msdn.microsoft.com/en-us/library/windows/desktop/bb773213(v=vs.85).aspx) `TMT_COLOR` type. for this type i select `TMT_TEXTCOLOR` - *The color of the text associated with this part and state.* – RbMm Mar 09 '18 at 08:50
  • i got next results : `TS_HYPERLINK_NORMAL=cc6600 TS_HYPERLINK_PRESSED=ff9933 TS_HYPERLINK_HOT=ff9933 TS_HYPERLINK_DISABLED=9c857e` – RbMm Mar 09 '18 at 08:51

0 Answers0