[CPL][SHELL32] Add icons to input, joy, sysdm, folder options (#1138)

CORE-15445
This commit is contained in:
Katayama Hirofumi MZ 2018-12-16 08:40:47 +09:00 committed by GitHub
parent 44bb99cc8e
commit 235042a16c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 8 deletions

View file

@ -47,7 +47,7 @@ PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
{ {
case PSCB_INITIALIZED: case PSCB_INITIALIZED:
{ {
hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM)); hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_KEY_SHORT_ICO));
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon); SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
break; break;
} }
@ -71,7 +71,7 @@ SystemApplet(VOID)
header.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; header.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
header.hwndParent = hCPLWindow; header.hwndParent = hCPLWindow;
header.hInstance = hApplet; header.hInstance = hApplet;
header.pszIcon = MAKEINTRESOURCEW(IDI_CPLSYSTEM); header.pszIcon = MAKEINTRESOURCEW(IDI_KEY_SHORT_ICO);
header.pszCaption = szCaption; header.pszCaption = szCaption;
header.nPages = ARRAYSIZE(page); header.nPages = ARRAYSIZE(page);
header.nStartPage = 0; header.nStartPage = 0;

View file

@ -198,12 +198,20 @@ AddPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK INT_PTR CALLBACK
MainPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) MainPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
static HICON s_hIcon = NULL, s_hIconSm = NULL;
UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(lParam);
switch (uMsg) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
AddColumns(GetDlgItem(hwndDlg,IDC_CONTROLLER_LIST)); AddColumns(GetDlgItem(hwndDlg,IDC_CONTROLLER_LIST));
s_hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM));
s_hIconSm = (HICON)LoadImageW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM),
IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), 0);
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)s_hIcon);
SendMessageW(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)s_hIconSm);
break; break;
case WM_COMMAND: case WM_COMMAND:
@ -224,6 +232,8 @@ MainPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
break; break;
case IDOK: case IDOK:
DestroyIcon(s_hIcon);
DestroyIcon(s_hIconSm);
EndDialog(hwndDlg,LOWORD(wParam)); EndDialog(hwndDlg,LOWORD(wParam));
break; break;
} }
@ -236,6 +246,8 @@ MainPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case SC_CLOSE: case SC_CLOSE:
DestroyIcon(s_hIcon);
DestroyIcon(s_hIconSm);
EndDialog(hwndDlg,LOWORD(wParam)); EndDialog(hwndDlg,LOWORD(wParam));
break; break;

View file

@ -407,6 +407,22 @@ HardwareProfilePropertiesDlgProc(
return FALSE; return FALSE;
} }
static int CALLBACK
PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
{
// NOTE: This callback is needed to set large icon correctly.
HICON hIcon;
switch (uMsg)
{
case PSCB_INITIALIZED:
{
hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_HARDPROF));
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
break;
}
}
return 0;
}
static static
VOID VOID
@ -433,15 +449,15 @@ HardwareProfileProperties(
ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPTITLE; psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
psh.hwndParent = hwndDlg; psh.hwndParent = hwndDlg;
psh.hInstance = hApplet; psh.hInstance = hApplet;
psh.hIcon = NULL; psh.pszIcon = MAKEINTRESOURCEW(IDI_HARDPROF);
psh.pszCaption = pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex].szFriendlyName; psh.pszCaption = pProfileData->pProfiles[pProfileData->dwSelectedProfileIndex].szFriendlyName;
psh.nPages = 1; psh.nPages = 1;
psh.nStartPage = 0; psh.nStartPage = 0;
psh.phpage = &hpsp; psh.phpage = &hpsp;
psh.pfnCallback = NULL; psh.pfnCallback = PropSheetProc;
PropertySheet(&psh); PropertySheet(&psh);
} }

View file

@ -130,7 +130,7 @@ PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
{ {
case PSCB_INITIALIZED: case PSCB_INITIALIZED:
{ {
hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM)); hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_USERPROF));
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon); SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
break; break;
} }
@ -157,7 +157,7 @@ SystemApplet(VOID)
psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK; psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
psh.hwndParent = hCPLWindow; psh.hwndParent = hCPLWindow;
psh.hInstance = hApplet; psh.hInstance = hApplet;
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLSYSTEM); psh.pszIcon = MAKEINTRESOURCEW(IDI_USERPROF);
psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME); psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
psh.nPages = 0; psh.nPages = 0;
psh.nStartPage = 0; psh.nStartPage = 0;

View file

@ -205,6 +205,23 @@ public:
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj); EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj);
static int CALLBACK
PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
{
// NOTE: This callback is needed to set large icon correctly.
HICON hIcon;
switch (uMsg)
{
case PSCB_INITIALIZED:
{
hIcon = LoadIconW(shell32_hInstance, MAKEINTRESOURCEW(IDI_SHELL_FOLDER_OPTIONS));
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
break;
}
}
return 0;
}
static VOID static VOID
ShowFolderOptionsDialog(HWND hWnd, HINSTANCE hInst) ShowFolderOptionsDialog(HWND hWnd, HINSTANCE hInst)
{ {
@ -242,11 +259,13 @@ ShowFolderOptionsDialog(HWND hWnd, HINSTANCE hInst)
memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW)); memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW));
pinfo.dwSize = sizeof(PROPSHEETHEADERW); pinfo.dwSize = sizeof(PROPSHEETHEADERW);
pinfo.dwFlags = PSH_NOCONTEXTHELP; pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_USEICONID | PSH_USECALLBACK;
pinfo.hwndParent = stub; pinfo.hwndParent = stub;
pinfo.nPages = num_pages; pinfo.nPages = num_pages;
pinfo.phpage = hppages; pinfo.phpage = hppages;
pinfo.pszIcon = MAKEINTRESOURCEW(IDI_SHELL_FOLDER_OPTIONS);
pinfo.pszCaption = szOptions; pinfo.pszCaption = szOptions;
pinfo.pfnCallback = PropSheetProc;
PropertySheetW(&pinfo); PropertySheetW(&pinfo);