[win] fix icon background in OpenWith menu for Win10

This commit is contained in:
SimplestStudio
2024-10-22 13:13:12 +03:00
parent 91e56ae9e9
commit 1c5e7b6998
4 changed files with 7 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -31,6 +31,7 @@
#define IDI_ICON31 131
#define IDI_ICON32 132
#define IDI_ICON33 133
#define IDI_ICON34 134
#define IDS_DOCX 1000
#define IDS_XLSX 1001

View File

@ -34,6 +34,7 @@ IDI_ICON30 ICON DISCARDABLE "./res/icons/fb2.ico"
IDI_ICON31 ICON DISCARDABLE "./res/icons/dotx.ico"
IDI_ICON32 ICON DISCARDABLE "./res/icons/oxps.ico"
IDI_ICON33 ICON DISCARDABLE "./res/icons/xlsb.ico"
IDI_ICON34 ICON DISCARDABLE "./res/icons/menu.ico"
#include <windows.h>
#include "src/version.h"

View File

@ -2169,6 +2169,7 @@ var
ext, progId1, progId2: string;
argsArray: TArrayOfString;
cleanExts, extensionInfo: TArrayOfString;
version: TWindowsVersion;
prefix, str: string;
begin
isFullAssociation := CheckCommandlineParam('/FULLASSOCIATION');
@ -2176,6 +2177,7 @@ begin
initExtensions();
end;
GetWindowsVersionEx(version);
for i := 0 to GetArrayLength(AudioExts) - 1 do
begin
Explode(argsArray, ExtensionRegistryInfo[i],':');
@ -2188,6 +2190,9 @@ begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0], 'AppUserModelID', ExpandConstant('{#APP_USER_MODEL_ID}'));
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0] + '\DefaultIcon', '', ExpandConstant('{app}\{#iconsExe},' + argsArray[2]));
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0] + '\shell\open\command', '', ExpandConstant('"{app}\{#iconsExe}" "%1"'));
if (version.Major = 10) and (version.Minor = 0) and (version.Build < 22000) then begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'Software\Classes\' + argsArray[0] + '\Application', 'ApplicationIcon', ExpandConstant('{app}\{#iconsExe},33'));
end;
//end;
ext := LowerCase(AudioExts[i]);