In general, in my application, I use a service that hangs a permanent icon in the status bar. I need to determine whether the user's theme is light or dark, in order to display the corresponding icon in the tray. With the help of search engines I did not find anything like this.

How can I do that?

Thanks in advance to everyone.

    1 answer 1

    Try GetCurrentThemeName (msdn.microsoft.com/en-us/library/windows/desktop/bb773365(v=vs.85).aspx). I have not tried it myself, but surely some names will contain dark or bright.

    In general, it is better not to mess with. Use transparent pixels in the icon. Or GetSysColor (BACKGROUND_COLOR) (something like that). Themes are windows version-specific, the concept of a theme is blurry (you can take a theme and change a couple of colors), etc. etc.

    But just in case, what else, it seems to me, can be useful on this topic:

    I found a registry key: HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Themes which contains an entry. For example, for the Nature Theme, it gets the value: "C: \ Windows \ resources \ Themes \ nature.theme". It’s not a problem.

    ( https://stackoverflow.com/questions/6631796/how-to-get-the-windows-7-theme-name )

    and http://www.codeproject.com/Articles/18603/Advanced-UxTheme-wrapper

    • one
      The tags are android. - falstaf 2:49 pm
    • Maybe we don’t know something ... :) and inside there is a Windows ... - KoVadim
    • I apologize, did not notice - Michael M