mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:53:07 +00:00
[CPL] Properly set display icons of control panel applets (#1129)
CORE-15445
This commit is contained in:
parent
f222e89d86
commit
bd55105c8a
18 changed files with 338 additions and 36 deletions
|
@ -165,6 +165,22 @@ InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, PGLOBAL_DATA
|
||||||
psp->lParam = (LPARAM)pGlobalData;
|
psp->lParam = (LPARAM)pGlobalData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_CPLACCESS));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* First Applet */
|
/* First Applet */
|
||||||
|
|
||||||
|
@ -191,14 +207,15 @@ SystemApplet(VOID)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hCPLWindow;
|
psh.hwndParent = hCPLWindow;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLACCESS));
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLACCESS);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = psp;
|
psh.ppsp = psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psp[0], IDD_PROPPAGEKEYBOARD, KeyboardPageProc, pGlobalData);
|
InitPropSheetPage(&psp[0], IDD_PROPPAGEKEYBOARD, KeyboardPageProc, pGlobalData);
|
||||||
InitPropSheetPage(&psp[1], IDD_PROPPAGESOUND, SoundPageProc, pGlobalData);
|
InitPropSheetPage(&psp[1], IDD_PROPPAGESOUND, SoundPageProc, pGlobalData);
|
||||||
|
|
|
@ -381,6 +381,23 @@ FinishDlgProc(HWND hwndDlg,
|
||||||
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_APPINETICO));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
LONG CALLBACK
|
LONG CALLBACK
|
||||||
ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
|
ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
|
||||||
{
|
{
|
||||||
|
@ -447,13 +464,15 @@ ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
|
||||||
|
|
||||||
/* Create the property sheet */
|
/* Create the property sheet */
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK;
|
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_APPINETICO);
|
||||||
psh.hwndParent = NULL;
|
psh.hwndParent = NULL;
|
||||||
psh.nPages = nPages;
|
psh.nPages = nPages;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = ahpsp;
|
psh.phpage = ahpsp;
|
||||||
psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_SHORTCUT);
|
psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_SHORTCUT);
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
/* Display the wizard */
|
/* Display the wizard */
|
||||||
PropertySheet(&psh);
|
PropertySheet(&psh);
|
||||||
|
|
|
@ -133,6 +133,23 @@ Done:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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(IDC_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* First Applet */
|
/* First Applet */
|
||||||
static LONG
|
static LONG
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -218,7 +235,7 @@ InitApplet(HANDLE hSectionOrWnd)
|
||||||
/* Initialize the property sheet structure */
|
/* Initialize the property sheet structure */
|
||||||
ZeroMemory(&psh, sizeof(psh));
|
ZeroMemory(&psh, sizeof(psh));
|
||||||
psh.dwSize = sizeof(psh);
|
psh.dwSize = sizeof(psh);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | /* PSH_USEHICON */ PSH_USEICONID | PSH_NOAPPLYNOW;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | /* PSH_USEHICON */ PSH_USEICONID | PSH_NOAPPLYNOW | PSH_USECALLBACK;
|
||||||
|
|
||||||
if (ConInfo->ConsoleTitle[0] != UNICODE_NULL)
|
if (ConInfo->ConsoleTitle[0] != UNICODE_NULL)
|
||||||
{
|
{
|
||||||
|
@ -249,6 +266,7 @@ InitApplet(HANDLE hSectionOrWnd)
|
||||||
psh.nPages = ARRAYSIZE(psp);
|
psh.nPages = ARRAYSIZE(psp);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = psp;
|
psh.ppsp = psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psp[i++], IDD_PROPPAGEOPTIONS, OptionsProc);
|
InitPropSheetPage(&psp[i++], IDD_PROPPAGEOPTIONS, OptionsProc);
|
||||||
InitPropSheetPage(&psp[i++], IDD_PROPPAGEFONT , FontProc );
|
InitPropSheetPage(&psp[i++], IDD_PROPPAGEFONT , FontProc );
|
||||||
|
|
|
@ -118,6 +118,23 @@ static const struct
|
||||||
{ IDD_SETTINGS, SettingsPageProc, SettingsPageCallbackProc, L"Settings" },
|
{ IDD_SETTINGS, SettingsPageProc, SettingsPageCallbackProc, L"Settings" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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(IDC_DESK_ICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Display Applet */
|
/* Display Applet */
|
||||||
static LONG APIENTRY
|
static LONG APIENTRY
|
||||||
DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
@ -180,14 +197,15 @@ DisplayApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE;
|
psh.dwFlags = PSH_USECALLBACK | PSH_PROPTITLE | PSH_USEICONID;
|
||||||
psh.hwndParent = hCPLWindow;
|
psh.hwndParent = hCPLWindow;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_DESK_ICON));
|
psh.pszIcon = MAKEINTRESOURCEW(IDC_DESK_ICON);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = 0;
|
psh.nPages = 0;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
/* Allow shell extensions to replace the background page */
|
/* Allow shell extensions to replace the background page */
|
||||||
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Desk"), MAX_DESK_PAGES - psh.nPages);
|
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Desk"), MAX_DESK_PAGES - psh.nPages);
|
||||||
|
|
|
@ -776,6 +776,23 @@ ProgressPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
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_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
HardwareWizardInit(HWND hwnd)
|
HardwareWizardInit(HWND hwnd)
|
||||||
{
|
{
|
||||||
|
@ -888,14 +905,16 @@ HardwareWizardInit(HWND hwnd)
|
||||||
|
|
||||||
/* Create the property sheet */
|
/* Create the property sheet */
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
|
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLICON);
|
||||||
psh.hwndParent = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.nPages = nPages;
|
psh.nPages = nPages;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = ahpsp;
|
psh.phpage = ahpsp;
|
||||||
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
|
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
|
||||||
psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
|
psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
/* Create title font */
|
/* Create title font */
|
||||||
hTitleFont = CreateTitleFont();
|
hTitleFont = CreateTitleFont();
|
||||||
|
|
|
@ -77,14 +77,18 @@ HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
|
||||||
*/
|
*/
|
||||||
static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
|
static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
|
||||||
{
|
{
|
||||||
|
// NOTE: This callback is needed to set large icon correctly.
|
||||||
|
HICON hIcon;
|
||||||
TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
|
TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case PSCB_INITIALIZED:
|
case PSCB_INITIALIZED:
|
||||||
SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM) LoadIconW(hcpl, MAKEINTRESOURCEW(ICO_MAIN)));
|
{
|
||||||
|
hIcon = LoadIconW(hcpl, MAKEINTRESOURCEW(ICO_MAIN));
|
||||||
|
SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,22 @@ InitPropSheetPage(PROPSHEETPAGEW *page, WORD idDlg, DLGPROC DlgProc)
|
||||||
page->pfnDlgProc = DlgProc;
|
page->pfnDlgProc = DlgProc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_CPLSYSTEM));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* First Applet */
|
/* First Applet */
|
||||||
static LONG CALLBACK
|
static LONG CALLBACK
|
||||||
|
@ -52,15 +68,15 @@ SystemApplet(VOID)
|
||||||
ZeroMemory(&header, sizeof(header));
|
ZeroMemory(&header, sizeof(header));
|
||||||
|
|
||||||
header.dwSize = sizeof(header);
|
header.dwSize = sizeof(header);
|
||||||
header.dwFlags = PSH_PROPSHEETPAGE;
|
header.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
header.hwndParent = hCPLWindow;
|
header.hwndParent = hCPLWindow;
|
||||||
header.hInstance = hApplet;
|
header.hInstance = hApplet;
|
||||||
header.hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_CPLSYSTEM));
|
header.pszIcon = MAKEINTRESOURCEW(IDI_CPLSYSTEM);
|
||||||
header.pszCaption = szCaption;
|
header.pszCaption = szCaption;
|
||||||
header.nPages = ARRAYSIZE(page);
|
header.nPages = ARRAYSIZE(page);
|
||||||
header.nStartPage = 0;
|
header.nStartPage = 0;
|
||||||
header.ppsp = page;
|
header.ppsp = page;
|
||||||
header.pfnCallback = NULL;
|
header.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
/* Settings */
|
/* Settings */
|
||||||
InitPropSheetPage(&page[0], IDD_PROPPAGESETTINGS, SettingsPageProc);
|
InitPropSheetPage(&page[0], IDD_PROPPAGESETTINGS, SettingsPageProc);
|
||||||
|
|
|
@ -1324,6 +1324,22 @@ InitPropSheetPage(
|
||||||
psp->lParam = (LPARAM)pGlobalData;
|
psp->lParam = (LPARAM)pGlobalData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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(IDC_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
INT_PTR
|
INT_PTR
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -1339,14 +1355,15 @@ CustomizeLocalePropertySheet(
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USECALLBACK;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hwndDlg;
|
psh.hwndParent = hwndDlg;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
|
psh.pszIcon = MAKEINTRESOURCE(IDC_CPLICON);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = (sizeof(PsPage) / sizeof(PROPSHEETPAGE)) - 1;
|
psh.nPages = (sizeof(PsPage) / sizeof(PROPSHEETPAGE)) - 1;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = PsPage;
|
psh.ppsp = PsPage;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&PsPage[0], IDD_NUMBERSPAGE, NumbersPageProc, pGlobalData);
|
InitPropSheetPage(&PsPage[0], IDD_NUMBERSPAGE, NumbersPageProc, pGlobalData);
|
||||||
InitPropSheetPage(&PsPage[1], IDD_CURRENCYPAGE, CurrencyPageProc, pGlobalData);
|
InitPropSheetPage(&PsPage[1], IDD_CURRENCYPAGE, CurrencyPageProc, pGlobalData);
|
||||||
|
|
|
@ -149,6 +149,23 @@ ParseSetupInf(VOID)
|
||||||
SetupCloseInfFile(hSetupInf);
|
SetupCloseInfFile(hSetupInf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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(IDC_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static LONG APIENTRY
|
static LONG APIENTRY
|
||||||
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -174,14 +191,15 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hCPLWindow;
|
psh.hwndParent = hCPLWindow;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
|
psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = 0; //sizeof(psp) / sizeof(PROPSHEETPAGE);
|
psh.nPages = 0; //sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = psp;
|
psh.ppsp = psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitIntlPropSheetPage(&psp[0], IDD_GENERALPAGE, GeneralPageProc, (LPARAM)pGlobalData);
|
InitIntlPropSheetPage(&psp[0], IDD_GENERALPAGE, GeneralPageProc, (LPARAM)pGlobalData);
|
||||||
psh.nPages++;
|
psh.nPages++;
|
||||||
|
|
|
@ -282,6 +282,22 @@ KeybHardwareProc(IN HWND hwndDlg,
|
||||||
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(IDC_CPLICON_2));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
LONG APIENTRY
|
LONG APIENTRY
|
||||||
KeyboardApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
KeyboardApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
@ -301,13 +317,14 @@ KeyboardApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
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 = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_2));
|
psh.pszIcon = MAKEINTRESOURCE(IDC_CPLICON_2);
|
||||||
psh.pszCaption = szCaption;
|
psh.pszCaption = szCaption;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
/* Load additional pages provided by shell extensions */
|
/* Load additional pages provided by shell extensions */
|
||||||
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Keyboard"), MAX_CPL_PAGES - psh.nPages);
|
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Keyboard"), MAX_CPL_PAGES - psh.nPages);
|
||||||
|
|
|
@ -1794,6 +1794,23 @@ WheelProc(IN HWND hwndDlg,
|
||||||
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(IDC_CPLICON_1));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct
|
static const struct
|
||||||
{
|
{
|
||||||
WORD idDlg;
|
WORD idDlg;
|
||||||
|
@ -1827,13 +1844,14 @@ MouseApplet(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
|
||||||
|
|
||||||
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 = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1));
|
psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
/* Load additional pages provided by shell extensions */
|
/* Load additional pages provided by shell extensions */
|
||||||
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Mouse"), MAX_CPL_PAGES - psh.nPages);
|
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\Mouse"), MAX_CPL_PAGES - psh.nPages);
|
||||||
|
|
|
@ -689,6 +689,23 @@ HardwareDlgProc(HWND hwndDlg,
|
||||||
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_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
LONG APIENTRY
|
LONG APIENTRY
|
||||||
MmSysApplet(HWND hwnd,
|
MmSysApplet(HWND hwnd,
|
||||||
UINT uMsg,
|
UINT uMsg,
|
||||||
|
@ -706,15 +723,15 @@ MmSysApplet(HWND hwnd,
|
||||||
LoadString(hApplet, IDS_CPLNAME, Caption, _countof(Caption));
|
LoadString(hApplet, IDS_CPLNAME, Caption, _countof(Caption));
|
||||||
|
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet,
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLICON);
|
||||||
MAKEINTRESOURCE(IDI_CPLICON));
|
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = psp;
|
psh.ppsp = psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psp[0], IDD_VOLUME,VolumeDlgProc);
|
InitPropSheetPage(&psp[0], IDD_VOLUME,VolumeDlgProc);
|
||||||
InitPropSheetPage(&psp[1], IDD_SOUNDS,SoundsDlgProc);
|
InitPropSheetPage(&psp[1], IDD_SOUNDS,SoundsDlgProc);
|
||||||
|
|
|
@ -4,6 +4,23 @@
|
||||||
|
|
||||||
HINSTANCE hApplet = 0;
|
HINSTANCE hApplet = 0;
|
||||||
|
|
||||||
|
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_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
LONG CALLBACK AppletInit(HWND hWnd)
|
LONG CALLBACK AppletInit(HWND hWnd)
|
||||||
{
|
{
|
||||||
PROPSHEETPAGEW psp;
|
PROPSHEETPAGEW psp;
|
||||||
|
@ -21,14 +38,15 @@ LONG CALLBACK AppletInit(HWND hWnd)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hWnd;
|
psh.hwndParent = hWnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLICON));
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLICON);
|
||||||
psh.pszCaption = szCaption;
|
psh.pszCaption = szCaption;
|
||||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = &psp;
|
psh.ppsp = &psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
return (LONG)(PropertySheet(&psh) != -1);
|
return (LONG)(PropertySheet(&psh) != -1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,22 @@ InitPropSheetPage(PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc)
|
||||||
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(IDC_CPLICON_1));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* First Applet */
|
/* First Applet */
|
||||||
static LONG APIENTRY
|
static LONG APIENTRY
|
||||||
|
@ -88,14 +104,15 @@ Applet1(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
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 = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1));
|
psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON_1);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = 0;
|
psh.nPages = 0;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psh, IDD_PROPPAGEPOWERSCHEMES, PowerSchemesDlgProc);
|
InitPropSheetPage(&psh, IDD_PROPPAGEPOWERSCHEMES, PowerSchemesDlgProc);
|
||||||
if (GetPwrCapabilities(&spc))
|
if (GetPwrCapabilities(&spc))
|
||||||
|
|
|
@ -121,6 +121,23 @@ Fail:
|
||||||
return hMod;
|
return hMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_CPLSYSTEM));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* First Applet */
|
/* First Applet */
|
||||||
LONG CALLBACK
|
LONG CALLBACK
|
||||||
SystemApplet(VOID)
|
SystemApplet(VOID)
|
||||||
|
@ -137,15 +154,15 @@ SystemApplet(VOID)
|
||||||
|
|
||||||
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 = hCPLWindow;
|
psh.hwndParent = hCPLWindow;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLSYSTEM);
|
||||||
psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
|
psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
|
||||||
psh.nPages = 0;
|
psh.nPages = 0;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.phpage = hpsp;
|
psh.phpage = hpsp;
|
||||||
psh.pfnCallback = NULL;
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, GeneralPageProc);
|
InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, GeneralPageProc);
|
||||||
hNetIdDll = AddNetIdPage(&psh);
|
hNetIdDll = AddNetIdPage(&psh);
|
||||||
|
|
|
@ -67,6 +67,22 @@ InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
|
||||||
psp->pfnDlgProc = DlgProc;
|
psp->pfnDlgProc = DlgProc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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(IDC_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static LONG APIENTRY
|
static LONG APIENTRY
|
||||||
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
@ -87,14 +103,15 @@ Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADERW);
|
psh.dwSize = sizeof(PROPSHEETHEADERW);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCEW(IDC_CPLICON));
|
psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGEW);
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGEW);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = psp;
|
psh.ppsp = psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psp[0], IDD_DATETIMEPAGE, DateTimePageProc);
|
InitPropSheetPage(&psp[0], IDD_DATETIMEPAGE, DateTimePageProc);
|
||||||
InitPropSheetPage(&psp[1], IDD_TIMEZONEPAGE, TimeZonePageProc);
|
InitPropSheetPage(&psp[1], IDD_TIMEZONEPAGE, TimeZonePageProc);
|
||||||
|
|
|
@ -38,6 +38,22 @@ InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
|
||||||
psp->pfnDlgProc = DlgProc;
|
psp->pfnDlgProc = DlgProc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_USRMGR_ICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Display Applet */
|
/* Display Applet */
|
||||||
static LONG APIENTRY
|
static LONG APIENTRY
|
||||||
|
@ -55,14 +71,15 @@ UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hwnd;
|
psh.hwndParent = hwnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_USRMGR_ICON));
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_USRMGR_ICON);
|
||||||
psh.pszCaption = Caption;
|
psh.pszCaption = Caption;
|
||||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = psp;
|
psh.ppsp = psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
InitPropSheetPage(&psp[0], IDD_USERS, UsersPageProc);
|
InitPropSheetPage(&psp[0], IDD_USERS, UsersPageProc);
|
||||||
InitPropSheetPage(&psp[1], IDD_GROUPS, GroupsPageProc);
|
InitPropSheetPage(&psp[1], IDD_GROUPS, GroupsPageProc);
|
||||||
|
|
|
@ -4,6 +4,23 @@
|
||||||
|
|
||||||
HINSTANCE hApplet = 0;
|
HINSTANCE hApplet = 0;
|
||||||
|
|
||||||
|
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_CPLICON));
|
||||||
|
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
LONG CALLBACK AppletInit(HWND hWnd)
|
LONG CALLBACK AppletInit(HWND hWnd)
|
||||||
{
|
{
|
||||||
PROPSHEETPAGEW psp;
|
PROPSHEETPAGEW psp;
|
||||||
|
@ -21,14 +38,15 @@ LONG CALLBACK AppletInit(HWND hWnd)
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
|
||||||
psh.hwndParent = hWnd;
|
psh.hwndParent = hWnd;
|
||||||
psh.hInstance = hApplet;
|
psh.hInstance = hApplet;
|
||||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLICON));
|
psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLICON);
|
||||||
psh.pszCaption = szCaption;
|
psh.pszCaption = szCaption;
|
||||||
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = &psp;
|
psh.ppsp = &psp;
|
||||||
|
psh.pfnCallback = PropSheetProc;
|
||||||
|
|
||||||
return (LONG)(PropertySheet(&psh) != -1);
|
return (LONG)(PropertySheet(&psh) != -1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue