kambamsu
kambamsu

Reputation: 571

Scrollbar movement SetScrollPos and SendMessage

I'm trying to move the scrollbar of a window programatically. I'm first sending a :

SetScrollPos(handle, 1, position, true);

and then followed by :

SendMessage(handle, 0x0115, wparam, new IntPtr(0));

The wparam is correct. When i inspect through spy++, the only difference between sending a scroll with the above code and actually scrolling is that in the actual scroll, the message nesting level is 1 but here it is zero. But that apart, all the other properties and same, the WM_VSCROLL, handle, position, wparam etc. But the programatic scroll doesn't move the bar. Any suggestions on what im doing wrong???

P.S: Trying to do this from a c# application THanks a ton!

EDIT: when i pass SB_BOTTOM to the wparam, it takes me correctly to the end of the scroll.

Upvotes: 1

Views: 3436

Answers (1)

arbiter
arbiter

Reputation: 9575

It is better to use SetScrollInfo function instead of manually sending messages.

Upvotes: 1

Related Questions