Results 1 to 8 of 8

Thread: Get the highlight color of OS-styled ListView header in Windows 10 Explorer

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2014
    Posts
    94

    Get the highlight color of OS-styled ListView header in Windows 10 Explorer

    Is there a way to retrieve the color used to highlight the hot column header under the mouse pointer in Windows 10 Explorer?
    Name:  2020-05-18_10h21_34.png
Views: 631
Size:  2.7 KB
    I tried to use the VisualStyleRenderer class for that but no luck:
    Code:
    Dim renderer As New VisualStyleRenderer(VisualStyleElement.Header.Item.Hot)
    Dim hotColor As Color = renderer.GetColor(ColorProperty.FillColor)
    The best result closest to the required color was ColorProperty.EdgeHighlightColor, but it is not exactly what I am looking for. The current highlight color is [R=217, G=235, B=249] in Windows 10 v1909, ColorProperty.EdgeHighlightColor returns [R=244, G=247, B=252].
    I know I can draw the hot column header on a temporary bitmap and then try to retrieve the hot color using the GetPixel() method, but I think this is not a reliable way. Microsoft may change the hot background to a gradient or something like that in the future, but what I need is the solid color used to fill the hot column header.
    Last edited by wisekat; May 18th, 2020 at 02:57 AM. Reason: Added RGB color values

Tags for this Thread

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