I make the margin using this function...
Code:
SendMessage(hEdit, EM_SETMARGINS, EC_LEFTMARGIN, 40 );
I paint it by calling this in the subclassed rich edit control
Code:
case WM_PAINT:
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
rect.top = 0;
rect.bottom = 70;
rect.right = 40;
rect.left = 0;
hdc = BeginPaint( hwnd, &ps );
DrawText( hdc, lineNumber, 1, &rect, DT_LEFT );
EndPaint( hwnd, &ps );
break;
I don't understand what WM_NCCALCSIZE does. Do I need it to calculate the size of my margin? Or do I need it to calculate the position of the text to draw?