Changeset 432 for trunk/DirectShowSpy/AboutDialog.h
- Timestamp:
- May 15, 2015, 12:47:44 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DirectShowSpy/AboutDialog.h
r376 r432 16 16 #pragma once 17 17 18 #include <atlsecurity.h> 18 19 #include <atlctrls.h> 19 20 #include <atlctrlx.h> … … 46 47 public: 47 48 // CAboutDialog 48 static CFontHandle CreateTitleFont() throw()49 static CFontHandle CreateTitleFont() 49 50 { 50 51 CLogFont LogFont; … … 57 58 return Font.Detach(); 58 59 } 59 static CFontHandle CreateDisclaimerFont() throw()60 static CFontHandle CreateDisclaimerFont() 60 61 { 61 62 CLogFont LogFont; … … 67 68 return Font.Detach(); 68 69 } 69 CAboutDialog() throw()70 CAboutDialog() 70 71 { 71 72 _Z4_THIS(); 72 73 } 73 ~CAboutDialog() throw()74 ~CAboutDialog() 74 75 { 75 76 _Z4_THIS(); 77 } 78 static BOOL IsAdministrator() 79 { 80 bool bIsMember = FALSE; 81 return CAccessToken().CheckTokenMembership(Sids::Admins(), &bIsMember) && bIsMember; 82 } 83 static VOID UpdateCaption(CWindow Window) 84 { 85 CString sCaption; 86 _W(Window.GetWindowText(sCaption)); 87 CRoArrayT<CString> SpecifierArray; 88 #if defined(_WIN64) 89 SpecifierArray.Add(_T("64-bit")); 90 #else 91 if(SafeIsWow64Process()) 92 SpecifierArray.Add(_T("32-bit")); 93 #endif // defined(_WIN64) 94 if(IsWindowsVistaOrGreater() && IsAdministrator()) 95 SpecifierArray.Add(_T("Administrator")); 96 if(!SpecifierArray.IsEmpty()) 97 sCaption = AtlFormatString(_T("%s (%s)"), sCaption, _StringHelper::Join(SpecifierArray, _T(", "))); 98 #if _TRACE 99 sCaption.Append(_T(" // ")); 100 #if _DEVELOPMENT 101 sCaption.Append(_T("Dev ")); 102 #endif // _DEVELOPMENT 103 sCaption.Append(_VersionInfoHelper::GetVersionString(_VersionInfoHelper::GetFileVersion(_VersionInfoHelper::GetModulePath()))); 104 #endif // _TRACE 105 Window.SetWindowText(sCaption); 76 106 } 77 107 … … 122 152 _W(m_EmailHyperStatic.SubclassWindow(GetDlgItem(IDC_ABOUT_EMAIL))); 123 153 #pragma endregion 124 #pragma region Caption 125 { 126 #if _TRACE || defined(_WIN64) 127 CString sCaption; 128 _W(GetWindowText(sCaption)); 129 sCaption.Append(_T(" // ")); 130 #if _DEVELOPMENT 131 sCaption.Append(_T("Dev ")); 132 #endif // _DEVELOPMENT 133 sCaption.Append(_VersionInfoHelper::GetVersionString(_VersionInfoHelper::GetFileVersion(_VersionInfoHelper::GetModulePath()))); 134 #if defined(_WIN64) 135 sCaption.Append(_T(" (x64)")); 136 #endif // defined(_WIN64) 137 _W(SetWindowText(sCaption)); 138 #endif // _TRACE || defined(_WIN64) 139 } 140 #pragma endregion 154 UpdateCaption(*this); 141 155 #pragma region Window Position and Focus 142 156 _W(CenterWindow(GetParent())); … … 145 159 return FALSE; 146 160 } 147 LRESULT OnDestroy() throw()161 LRESULT OnDestroy() 148 162 { 149 163 _W(m_TitleFont.DeleteObject()); … … 151 165 return 0; 152 166 } 153 LRESULT OnCommand(UINT, INT nIdentifier, HWND) throw()167 LRESULT OnCommand(UINT, INT nIdentifier, HWND) 154 168 { 155 169 _W(EndDialog(nIdentifier));
Note: See TracChangeset
for help on using the changeset viewer.