The code below would work. And please explain yourself.
RECT rc1, rc2;
int barWidth, titlebarHeight;
wchar_t a[10];
GetClientRect(hWnd, &rc1);
GetWindowRect(hWnd, &rc2);
barWidth=((rc2.right-rc2.left)-(rc1.right-rc1.left))/2;
titlebarHeight=(rc2.bottom-rc2.top)-(rc1.bottom-rc1.top)-bar_width-GetSystemMetrics(SM_CYMENU);
wsprintf(a, L"%d", titlebarHeight);
MessageBox(hWnd, a, L"Whatever", MB_OK);