'Determining the scrollbar movement in MFC

In my application, I use two scrollbars and handle the movement of the slider in them using the function:

afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);

But this function should be responsible for responding to the movement of both sliders. How can I find out which of these two sliders has been moved?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source