Add a variable of type int for your slider to get easy access to its value.
in header for you dialog
public:
int GetBrightness() const { return m_sliderValue; }
void SetBrightness(int brightness) { m_sliderValue = brightness; }
protected:
int m_sliderValue;
For simple tasks you don't need an event handler.
Notice that you will get something like
DDX_Slider(pDX, IDC_H_SLIDER_BAR, m_sliderValue);
in your DoDataExchange function. It will take care of transferring the controls value to your member variable.
For more reading you can check out UpdateData() in the SDK.
You will only need an event handler if you plan on having a preview of your brightness value.
Also, you want to set the range for your slider from your OnInitDialog() method.
m_HSliderBar.SetRange(0, 100);