mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-02-07 16:31:00 +00:00
Fix for window border when building with VS2012 & VS2013, using GetSystemMetrics(SM_CXPADDINGBORDER)
This commit is contained in:
parent
8a616f9380
commit
e3508c29aa
@ -2168,14 +2168,16 @@ static void SetupTooltipControls(void)
|
||||
SendMessage(tooltipwindow, TTM_ADDTOOL, 0, (LPARAM)&toolinfo);
|
||||
}
|
||||
|
||||
// SM_CXPADDEDBORDER is not supported on 2000 & XP, but GetSystemMetrics() returns 0 for unknown values, so this use of SM_CXPADDEDBORDER works on 2000 & XP too:
|
||||
// http://msdn.microsoft.com/en-nz/library/windows/desktop/ms724385(v=vs.85).aspx
|
||||
static void GetWidthHeight(int& nWidth, int& nHeight)
|
||||
{
|
||||
nWidth = g_nViewportCX + VIEWPORTX*2
|
||||
+ BUTTONCX
|
||||
+ (GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(92)) * 2 // 92 = SM_CXPADDEDBORDER
|
||||
+ (GetSystemMetrics(SM_CXBORDER) + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
|
||||
+ MAGICX;
|
||||
nHeight = g_nViewportCY + VIEWPORTY*2
|
||||
+ (GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(92)) * 2 // 92 = SM_CXPADDEDBORDER
|
||||
+ (GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
|
||||
+ GetSystemMetrics(SM_CYCAPTION)
|
||||
+ MAGICY;
|
||||
}
|
||||
|
@ -38,4 +38,10 @@
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
// SM_CXPADDEDBORDER is not supported on 2000 & XP:
|
||||
// http://msdn.microsoft.com/en-nz/library/windows/desktop/ms724385(v=vs.85).aspx
|
||||
#ifndef SM_CXPADDEDBORDER
|
||||
#define SM_CXPADDEDBORDER 92
|
||||
#endif
|
||||
|
||||
#define USE_SPEECH_API
|
||||
|
Loading…
x
Reference in New Issue
Block a user