// Initialization code AUX_DATA::AUX_DATA() { // Cache various target platform version information DWORD dwVersion = ::GetVersion(); bWin95 = (dwVersion & 0x80000000) != 0; // Cached system metrics (updated in CWnd::OnWinIniChange) UpdateSysMetrics(); // Cached system values (updated in CWnd::OnSysColorChange) hbrBtnFace = NULL; UpdateSysColors(); // Standard cursors hcurWait = ::LoadCursor(NULL, IDC_WAIT); hcurArrow = ::LoadCursor(NULL, IDC_ARROW); ASSERT(hcurWait != NULL); ASSERT(hcurArrow != NULL); hcurHelp = NULL; // loaded on demand // cxBorder2 and cyBorder are 2x borders for Win4 cxBorder2 = CX_BORDER*2; cyBorder2 = CY_BORDER*2; // allocated on demand hbmMenuDot = NULL; hcurHelp = NULL; }
// Initialization code GLOBAL_DATA::GLOBAL_DATA() { // Cache various target platform version information DWORD dwVersion = ::GetVersion(); nWinVer = (LOBYTE(dwVersion) << 8) + HIBYTE(dwVersion); bWin32s = (dwVersion & 0x80000000) != 0; bWin4 = (BYTE)dwVersion >= 4; bNotWin4 = 1 - bWin4; // for convenience #ifndef _MAC bSmCaption = bWin4; #else bSmCaption = TRUE; #endif bWin31 = bWin32s && !bWin4; // Windows 95 reports Win32s // Cached system metrics (updated in CWnd::OnWinIniChange) UpdateSysMetrics(); // Border attributes hbrLtGray = ::CreateSolidBrush(RGB(192, 192, 192)); hbrDkGray = ::CreateSolidBrush(RGB(128, 128, 128)); ASSERT(hbrLtGray != NULL); ASSERT(hbrDkGray != NULL); // Cached system values (updated in CWnd::OnSysColorChange) hbrBtnFace = NULL; hbrBtnShadow = NULL; hbrBtnHilite = NULL; hbrWindowFrame = NULL; hpenBtnShadow = NULL; hpenBtnHilite = NULL; hpenBtnText = NULL; UpdateSysColors(); // cxBorder2 and cyBorder are 2x borders for Win4 cxBorder2 = bWin4 ? CX_BORDER*2 : CX_BORDER; cyBorder2 = bWin4 ? CY_BORDER*2 : CY_BORDER; // allocated on demand hStatusFont = NULL; hToolTipsFont = NULL; }
// Initialization code void AFX_GLOBAL_DATA::Initialize() { if (m_bInitialized) { return; } OSVERSIONINFOEX osvi = { sizeof(osvi), HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7) }; // The condition mask specifies to test for the OS major/minor versions using greater than or equal. DWORDLONG const dwlConditionMask = VerSetConditionMask(VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL), VER_MINORVERSION, VER_GREATER_EQUAL); bIsWindows7 = VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask); bIsRemoteSession = GetSystemMetrics(SM_REMOTESESSION); UpdateSysColors(); UpdateFonts(); OnSettingChange(); EnableAccessibilitySupport(); }
// Initialization code AUX_DATA::AUX_DATA() { // Cache various target platform version information DWORD dwVersion = ::GetVersion(); nWinVer = (LOBYTE(dwVersion) << 8) + HIBYTE(dwVersion); bWin95 = (dwVersion & 0x80000000) != 0; bWin4 = (BYTE)dwVersion >= 4; bNotWin4 = 1 - bWin4; // for convenience bSmCaption = bWin4; bMarked4 = FALSE; // determine various metrics based on EXE subsystem version mark if (bWin4) bMarked4 = (GetProcessVersion(0) >= 0x00040000); // Cached system metrics (updated in CWnd::OnWinIniChange) UpdateSysMetrics(); // Cached system values (updated in CWnd::OnSysColorChange) hbrBtnFace = NULL; UpdateSysColors(); // Standard cursors hcurWait = ::LoadCursor(NULL, IDC_WAIT); hcurArrow = ::LoadCursor(NULL, IDC_ARROW); ASSERT(hcurWait != NULL); ASSERT(hcurArrow != NULL); hcurHelp = NULL; // loaded on demand // cxBorder2 and cyBorder are 2x borders for Win4 cxBorder2 = bWin4 ? CX_BORDER*2 : CX_BORDER; cyBorder2 = bWin4 ? CY_BORDER*2 : CY_BORDER; // allocated on demand hbmMenuDot = NULL; hcurHelp = NULL; }