Skip to content

Commit

Permalink
[REACTOS] Revert commit 32bdd85 (incorrectly formatted)
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymaster committed Nov 20, 2023
1 parent 32bdd85 commit 4add3fd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions base/applications/rapps/appview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,13 +1289,14 @@ CAppsListView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
/* Load icon from registry */
HICON hIcon = NULL;
CStringW szIconPath;
int IconIndex;
if (AppInfo->RetrieveIcon(szIconPath))
{
IconIndex = PathParseIconLocationW(szIconPath.GetBuffer());
szIconPath.ReleaseBuffer();
PathParseIconLocationW((LPWSTR)szIconPath.GetString());

ExtractIconExW(szIconPath.GetString(), IconIndex, &hIcon, NULL, 1);
/* Load only the 1st icon from the application executable,
* because all apps provide the executables which have the main icon
* as 1st in the index , so we don't need other icons here */
hIcon = ExtractIconW(hInst, szIconPath.GetString(), 0);
}

/* Use the default icon if none were found in the file, or if it is not supported (returned 1) */
Expand All @@ -1305,7 +1306,7 @@ CAppsListView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN));
}

IconIndex = ImageList_AddIcon(m_hImageListView, hIcon);
int IconIndex = ImageList_AddIcon(m_hImageListView, hIcon);
DestroyIcon(hIcon);

int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
Expand Down

0 comments on commit 4add3fd

Please sign in to comment.