I tried InflateRect() and it messes up the horizontal and verticle scroll bars. It offsets the the same amount as the values entered for the InflateRect() function. After goofing around with the program some more I've had rather good success with the following:
Code:
case WM_SIZE:
{
RECT rc;
HWND hWndEdit;
// resize the edit control to match the client area
hWndEdit = (HWND)GetWindowLong (hWnd, WL_HWNDEDIT);
GetClientRect (hWnd, &rc);
MoveWindow (hWndEdit,
rc.left,
rc.top,
rc.right-rc.left,
rc.bottom-rc.top,
TRUE);
// set margins for left and top
SendMessage (hWndEdit, EM_GETRECT, 0, (LPARAM) (RECT FAR*) &rc);
rc.left = 8;
rc.top = 2;
rc.right -= rc.left;
rc.bottom -= rc.top;
SendMessage (hWndEdit, EM_SETRECT, 0, (LPARAM) (RECT FAR*) &rc);
}
break;
The only minor obsticle now is when word wrap is invoked. I placed the same code (EM_GETRECT, EM_SETRECT) in the word wrap module, but edit control doesn't reflect/show the changes unless I make the program Iconic or use the minimize/maximize functions for the program.