MSDN WM_VSCROLL .
Just intercept this message through your windowproc, use GetScrollPos to get where one control is at and use SetScrollPos to set the second scrollbar.
Code:
case WM_VSCROLL: {
int nScrlPos;
/*
Get Scroll Bar Position
lParam is the Handle of the control sending the position
*/
nScrlPos = GetScrollPos(lParam, SB_VERT);
/*
Set the sister control scroll bar to the same position
Remember, the positions are relative, the heights are
not the same, the scroll bars will not look as if they are
scrolling in sync
g_hEditCtrl2 is the handle of the second edit control
*/
SetScrollPos(g_hEditCtrl2, SB_VERT, nScrlPos, TRUE);
/*
The link above links to the GetScrollPos and SetScrollPos
so you can get more in depth info
*/
break;
}
As for your second question, check out this: EM_SETREADONLY
Hope that helps...