Пример #1
0
        private void _CorrectKbIdsIfNeeded()
        {
            var kbIds = mConfig.AppSettings.Settings[KB_IDS_TO_INSTALL].Value;

            if (kbIds == WINDOWS_8_DEFENDER_KB_ID && UacHelper.IsRunningOnWindows7())
            {
                _SetSetting(KB_IDS_TO_INSTALL, WINDOWS_7_DEFENDER_KB_ID);
            }
        }
Пример #2
0
        private static Color _GetWindowsThemeBackgroundColor()
        {
            if (UacHelper.IsRunningOnWindows7())
            {
                return(Color.FromArgb(255, 35, 38, 39));
            }

            var colorSet    = GetImmersiveUserColorSetPreference(false, false);
            var elementName = Marshal.StringToHGlobalUni("ImmersiveStartBackground");

            Marshal.FreeCoTaskMem(elementName);

            var type       = GetImmersiveColorTypeFromName(elementName);
            var colorDword = GetImmersiveColorFromColorSetEx((uint)colorSet, type, false, 0);

            var colorBytes = new byte[4];

            colorBytes[0] = (byte)((0xFF000000 & colorDword) >> 24); // A
            colorBytes[1] = (byte)((0x00FF0000 & colorDword) >> 16); // B
            colorBytes[2] = (byte)((0x0000FF00 & colorDword) >> 8);  // G
            colorBytes[3] = (byte)((0x000000FF & colorDword) >> 0);  // R

            return(Color.FromArgb(colorBytes[0], colorBytes[3], colorBytes[2], colorBytes[1]));
        }
Пример #3
0
 private string _GetWindowsDefenderKbId()
 {
     return(UacHelper.IsRunningOnWindows7()
         ? WINDOWS_7_DEFENDER_KB_ID
         : WINDOWS_8_DEFENDER_KB_ID); // use windows 8 kb-id as a default value even if it is not a windows 8 os.
 }