What should I use to change the display's gamma? I tried looking on google, but I don't see anywhere how to do it. Can you give me a link, or an example of changing the value? I need it to be able to change it when I want and faster, I could go each time in "Display Color Calibration" and change it from there, but that takes time, and I can't add a key shortcut to certain values.
Just as a note, I want to change gamma, not brightness.

I tried looking at "Windows Graphics Device Interface" and "Microsoft Direct3D 9’s" but without an example to understand, I got lost in the parameters types they ask. I would like to make it kinda like the slider from "Display Color Calibration" (Calibrate Display Color, as you find it in search box), the difference will be that I will add a function so you can add some default key shortcuts to certain gamma values.
I'm used to code in Java, but there is no way to change gamma using that.

But you do know that this is the C/C++ board and Java would be off topic?

However, all you have to do is converting the Algorithm to Java (should be no problem), check how to call Windows API functions from Java, and create the GUI according to your requirements. The GUI from that article is an example. Even a C++ developer using that code would create his own GUI controls and windows instead of using those from the example.

So, I did a few tests with that formula for set gamma, and I found out that the range 0.0-2.0 isn't actually good. I gave values between 0.0-0.2 and nothing happened, then I tried some values between 0.3-4.0 and it was working. So there are values OVER 2.0 that are working and the values under 0.3 aren't working at all.
Can it be that the formula isn't actually correct or that the range he gave is wrong? Or maybe he thought that those values are what users may want?

Note also that the default value for Windows is 2.2. Anything far away from that will display weird.

Very low values will simply result in most - if not all - table values to be set to zero. Similar for very high values which will result in 0xFFFF. That means that there is a range of useful Gamma values while all others will be clipped (note the max() and min() calls in the formula).

The wheel scrolling has to be performed by the window which content should be scrolled by handling the WM_MOUSEWHEEL message | Microsoft Docs[^]. If that window is CWnd based, just override the OnMouseWheel() function.

I can not give more information because you did not give any information about your window. With frame based MFC applications, that are usually the CView derived classes.

i have written the below code for my each child frame. this class is derived from the CScrollView. my mouse wheel is working fine for each individual window class. but i am trying to implement same support from my main window class.but mouse wheel is not working. could you please give me your valuable inputs.

My intention is instead of writing mouse wheel code for all the child class. if i implement mouse wheel function for my main frame. i would have been worth to all child classes.

It is still unclear for which window you want to handle the scrolling.

If it is working in the views, all should be fine. Because the views show the content which might be scrolled.

The frame windows are parents of the views providing the frame and the caption bar. They did not know about the content of the client area (the view) and can therefore not know how to scroll the content.

Your test does not show what you think. It shows the values that you set in pData before the call to GetData, which does not change it. You need to reread the documentation, and understand the difference between a pointer and a reference.