Fixed window width and height problem by using SM_CXPADDEDBORDER

But it would be nicer to define this somewhere by:
#ifndef SM_CXPADDEDBORDER
#define SM_CXPADDEDBORDER 92
#endif
This commit is contained in:
sicklittlemonkey 2014-07-24 21:00:28 +12:00
parent d5e2103d58
commit 0d7cbfd463

View File

@ -1954,10 +1954,10 @@ static void GetWidthHeight(int& nWidth, int& nHeight)
{
nWidth = g_nViewportCX + VIEWPORTX*2
+ BUTTONCX
+ GetSystemMetrics(SM_CXBORDER)*2
+ (GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(92)) * 2 // 92 = SM_CXPADDEDBORDER
+ MAGICX;
nHeight = g_nViewportCY + VIEWPORTY*2
+ GetSystemMetrics(SM_CYBORDER)
+ (GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(92)) * 2 // 92 = SM_CXPADDEDBORDER
+ GetSystemMetrics(SM_CYCAPTION)
+ MAGICY;
}