Accessing Windows 8/10 Volume OSD Colors - c++

Windows has this little overlay that pops up when you change the volume
I'm implementing a similar notification overlay and I'd like to theme it consistently with this existing overlay without hard-coding magic values. Is there a way to access the colors, font, font color and/or positioning associated with this?
The music information appears to come from the Groove Music application and I'm not sure if that is exposed for user applications to leverage, but the volume bar is a system-wide thing that I would hope I'm able to get some basic information about.
Neither GetSysColor nor GetThemeSysColor appear to have any colors that match.

That music overlay/controller is available to store applications so maybe if you port your application to UWP with the Desktop Bridge you might be allowed to use it.
It would not surprise me if the source of these colors are related to the undocumented GetImmersiveColorFromColorSetEx function in uxtheme.dll.
You can see a list of some of the color names here.

Related

C++ && QT Is there a way to create "warm screen" color using c++ and qt on Mac && Windows

Is there some way to change screen "saturation" ? Make screen in warm colors \ or make it in sepia using c++ && qt on win\mac ?
As a reference modern monitors have such a menu option on changing the screen color or you can also check the app for linux f.lux as a reference ...
The first thing that comes on my mind is to create some transparent " window on top " make a screenshot and play around with rgb ... but it will be not the best solution
There's no Qt API that will help you with that. On either platform you'll have to use native APIs to change the screen color reproduction curves and shift the color temperature to warmer tones. The situation on OS X would be more uniform in that the API to do that either exists on all hardware or on none. On Windows, things might be more complicated. Some undocumented vendor APIs probably exist, used by respective vendor control panels to alter the color temperature. There are also all ways you could hook yourself into the screen compositing pipeline, but this may require writing a driver. Unfortunately, I'm not too familiar with how easy it might be. It'll be probably either very simple or very complicated. There are some simple workarounds, like adding a translucent tinted window on top of everything, but those don't look good.
Neither C++ nor Qt facilitate such functionality. It seems for windows it is possible to modify brightness and contrast for the display, but that's about it, no saturation, no colorization.
The "make a screenshot and play around with rgb" will have abysmal performance and a number of other possible complications, such as event handling.
Now, if you want to apply a color filter to your Qt application, Qt has the QGraphicsEffect class, which automatically hooks up with the rendering system, caches the target to an image and applies to desired effect. I am not sure how well will that work for the "transparent window on top" idea.
It only has a few stock effects, but you can easily roll out your own. Then you can use QWidget::setGraphicsEffect(QGraphicsEffect * effect) to apply it to the desired widget or derived.

wxWidgets Overlay Text (C++)

I am trying to place some overlay text over a wxPanel.
I have several panels with completely different Content but I want to place this overlay text over all of these panels in the top right Corner of the panel.
I am restricted to wxWidgets 2.8.12..
Do you see any way to achieve this behaviour?
Edit:
Here a bit more detailed Version of what I am trying to do:
I have a Layout that consists of e.g. 5 containers and each container can contain a module. A module can be either wxPanels that contain Plain text or Input controls or for example a OpenGL canvas or an Image or something else.
Because I have much content and it does not fit on a single page I want to make the modules inside a Container exchangeable. It would be also nice if the user is able to perform this action only by using its keyboard. E.g. if he presses the key "3" the content of the third container has to be switched.
To handle these shortcuts isn't a problem. However I need to signalize to the user the identifier / hotkey of the containers.
I could do this by placing a additional headline above each container, but I want to waste as little space as possible on the gui.
I also could draw directly to the modules content, but I would have to do this for every module and every module is designed in a different way (images, multi column, opengl, ...) and maybe even by different persons.
So I am looking for a simple solution to indicate the number of these containers that does not consume that much space.
Thanks for your help
You can use a wxWindowDC to draw anywhere on the window, even on child windows. However anything you draw will be painted over whenever the windows or controls repaint themselves. You can draw your overlay in an UpdateUI event handler to minimize this. I have used this approach with success on Windows with wxWidgets 2.8.12. Not sure if it works with OpenGL though.

Limits SetSysColor to one application

I want to change the set of colors used in my software. My research led me to the SetSysColor() function. The problem with this function is that every software on the computer gets affected by the modification, not only the executable I want to modify.
Is there a way, or a alternative, to change the set of colors used by my application without having to redraw everything manually?
In some cases using custom colors may indeed be beneficial (highlighting, notifications, color-coding etc); just don't overdo. There are certain ways in WinAPI (usually accessible in MFC too - through events or direct WIndows message handlers) that let customize the appearance of your application. Look into the documentation for own-drawn controls, custom control colors, WIndows Class brushes, messages like WM_CTLCOLOR and WM_ERASEBKGND, You can also customize the looks of a window's non-client area (eg title-bar, borders etc), although this changes the appearance of your app a lot more drastically. See messages like NC_PAINT and NC_HITTEST.

Add drop shadow to ListView (Icon mode)?

If you look at the thumbnail images in Windows Explorer you'll notice that they have a drop shadow, is this effect associated with the ListView control or does Windows Explorer does some extra coding to accomplish this effect?
Edit:
So it turned out that Windows uses another control. So my question now is how can I add a drop shadow to the "normal" ListView.
For a standard list view, you may want to use a technique called custom draw (https://msdn.microsoft.com/en-us/library/windows/desktop/ff919569(v=vs.85).aspx).
Basically, you ask your list view not to draw its items, but instead send you some window messages for you to draw them yourself. This is a very flexible but also troublesome technique, because you need to handle many things (like whether an item is selected/disabled, font, color etc.)
The drop shadow you see in Windows Explorer is not publicly available for you to use. So you will have to custom-draw the items (NM_CUSTOMDRAW) by yourself.
Not sure if such effect is available in GDI/GDI+, but Direct2D does have one: https://learn.microsoft.com/en-us/windows/win32/direct2d/drop-shadow

How to change button color?

I am developing a GUI application using Embarcadero VCL c++ IDE for windows OS. As part of this project, I have to change color of button with respect to an external state.
I understood that windows32 API will not allow to change the color of button.
Could you please suggest me, how to change button color?
Do you wish to change the background-colour of the button, or the text-colour of it?
Since windows has used visual themes for some time now, if you have commctrl loaded and include a manifest file, the button will be drawn using the default (current) theme.
Options I can see include (a) custom-drawing the background (b) changing the text-colour in the normal draw process (c) drawing the button without a theme (i.e drawing a 'flat' button).
You could simply draw a bitmap-button, changing the bitmap depending on the state of the button. You could also use a single bitmap, tinting it using the HSL or HSV colour-space, depending on the state.
As for the flat type of button, I think you can probably change it's background-colour in much the same way as you can change the colour of the text - by intervening during the standard draw process and changing the colour from 3D_FACE (or whatever it is, I forget) to whatever you'd like.
If you look at the calculator included with windows XP, you can see an example of changing the text colour.
CodeProject.com likely has a stack of articles that would help in this endeavour. :)