[ZIPFLDR] Set large icon correctly (#4708)

Now it's correctly displayed in Alt+Tab window selection.
This commit is contained in:
Thamatip Chitpong 2022-09-19 05:56:35 +07:00 committed by GitHub
parent 305aae75f5
commit 7244a4a2f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -331,10 +331,23 @@ public:
};
/* NOTE: This callback is needed to set large icon correctly. */
static INT CALLBACK s_PropSheetCallbackProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
{
if (uMsg == PSCB_INITIALIZED)
{
HICON hIcon = LoadIconW(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCEW(IDI_ZIPFLDR));
CWindow dlg(hwndDlg);
dlg.SetIcon(hIcon, TRUE);
}
return 0;
}
void runWizard()
{
PROPSHEETHEADERW psh = { sizeof(psh), 0 };
psh.dwFlags = PSH_WIZARD97 | PSH_HEADER | PSH_USEICONID;
psh.dwFlags = PSH_WIZARD97 | PSH_HEADER | PSH_USEICONID | PSH_USECALLBACK;
psh.hInstance = _AtlBaseModule.GetResourceInstance();
CExtractSettingsPage extractPage(this, &m_Password);
@ -350,6 +363,7 @@ public:
psh.pszIcon = MAKEINTRESOURCE(IDI_ZIPFLDR);
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
psh.pfnCallback = s_PropSheetCallbackProc;
PropertySheetW(&psh);
}