Scroll two windows together WIN32
-
My application is having one Main window. Which has two child windows. I am showing the child windows side by side.Once if we scroll any of the child windows scrollbar. Both should scroll together. Please let me know if you have any idea. Thanks in advance
-
My application is having one Main window. Which has two child windows. I am showing the child windows side by side.Once if we scroll any of the child windows scrollbar. Both should scroll together. Please let me know if you have any idea. Thanks in advance
Whenever a scroll operation happens in a child window, the window will receive a
WM_HSCROLL
orWM_VSCROLL
message depending on what scroll operation is done. To make the other child window also do the similar scroll operation you could propogate the same scroll message to the other child window from theWM_HSCROLL
orWM_VSCROLL
handler usingPostMessage
.«_Superman_»
I love work. It gives me something to do between weekends. -
Whenever a scroll operation happens in a child window, the window will receive a
WM_HSCROLL
orWM_VSCROLL
message depending on what scroll operation is done. To make the other child window also do the similar scroll operation you could propogate the same scroll message to the other child window from theWM_HSCROLL
orWM_VSCROLL
handler usingPostMessage
.«_Superman_»
I love work. It gives me something to do between weekends. -
My application is having one Main window. Which has two child windows. I am showing the child windows side by side.Once if we scroll any of the child windows scrollbar. Both should scroll together. Please let me know if you have any idea. Thanks in advance
-
The trouble with forwarding messages to another window is what happens (as in the questioners case) if that window has the same behaviour? Each window will send WM_*SCROLL back and forth until someone gets bored. Cheers, Ash
The
lParam
for these messages are there to handle this situation.«_Superman_»
I love work. It gives me something to do between weekends. -
The
lParam
for these messages are there to handle this situation.«_Superman_»
I love work. It gives me something to do between weekends. -
Whenever a scroll operation happens in a child window, the window will receive a
WM_HSCROLL
orWM_VSCROLL
message depending on what scroll operation is done. To make the other child window also do the similar scroll operation you could propogate the same scroll message to the other child window from theWM_HSCROLL
orWM_VSCROLL
handler usingPostMessage
.«_Superman_»
I love work. It gives me something to do between weekends.Thanks.. It was really helpfull