Your question has a couple of things that concern me... first you want draw your own border and then adjust the client rectangle. This really isn't possible as the client rectangle is determined when the window moves. Once determined a completely different paint message is responsible for drawing all non-client content. Thus you can do what you suggest; however, it will break your current border painting.
It would be FAR eaiser to move all your controls from your form into a new Panel control and place it on the form. Now you can position this panel as if you where adjusting the client area.
If you must proceed with your original thought to modify the window client area you would do the following:
private void AdjustClientRect(ref RECT rcClient)
{
rcClient.Left += 10;
rcClient.Top += 10;
rcClient.Right -= 10;
rcClient.Bottom -= 10;
}
struct RECT { public int Left, Top, Right, Bottom; }
struct NCCALCSIZE_PARAMS
{
public RECT rcNewWindow;
public RECT rcOldWindow;
public RECT rcClient;
IntPtr lppos;
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
const int WM_NCCALCSIZE = 0x0083;
if (m.Msg == WM_NCCALCSIZE)
{
if (m.WParam != IntPtr.Zero)
{
NCCALCSIZE_PARAMS rcsize = (NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(NCCALCSIZE_PARAMS));
AdjustClientRect(ref rcsize.rcNewWindow);
Marshal.StructureToPtr(rcsize, m.LParam, false);
}
else
{
RECT rcsize = (RECT)Marshal.PtrToStructure(m.LParam, typeof(RECT));
AdjustClientRect(ref rcsize);
Marshal.StructureToPtr(rcsize, m.LParam, false);
}
m.Result = new IntPtr(1);
return;
}
}