Skip to content

Commit ff8d4b4

Browse files
committed
Icons (Windows): handles the case when users never changes the default settings
1 parent 4fb7860 commit ff8d4b4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/detection/icons/icons_windows.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ const char* ffDetectIcons(FFIconsResult* result)
66
FF_AUTO_CLOSE_FD HANDLE hKey = NULL;
77
if(!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel", &hKey, NULL) &&
88
!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu", &hKey, NULL))
9-
return "ffRegOpenKeyForRead(Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\{NewStartPanel|ClassicStartMenu}) failed";
9+
{
10+
// If the key doesn't exist, it means that the user never changed the default settings.
11+
ffStrbufSetStatic(&result->icons2, "Recycle Bin");
12+
return NULL;
13+
}
1014

1115
// Whether these icons are hidden
1216
uint32_t ThisPC = 1, UsersFiles = 1, RemoteNetwork = 1, RecycleBin = 0 /* Shown by default */, ControlPanel = 1;

0 commit comments

Comments
 (0)