mirror of
https://github.com/reactos/reactos.git
synced 2025-07-26 22:53:52 +00:00
- Add getting icon metrics
- Change icons sizes at change of system settings svn path=/trunk/; revision=36697
This commit is contained in:
parent
5a9f88c144
commit
c196de6a7f
1 changed files with 43 additions and 14 deletions
|
@ -12,6 +12,8 @@ HINSTANCE hInst = 0;
|
||||||
|
|
||||||
HWND hMainWnd; /* Main Window */
|
HWND hMainWnd; /* Main Window */
|
||||||
HWND hTabWnd; /* Tab Control Window */
|
HWND hTabWnd; /* Tab Control Window */
|
||||||
|
UINT uXIcon = 0, uYIcon = 0; /* Icon sizes */
|
||||||
|
HICON hDialogIcon = NULL;
|
||||||
|
|
||||||
void MsConfig_OnTabWndSelChange(void);
|
void MsConfig_OnTabWndSelChange(void);
|
||||||
|
|
||||||
|
@ -94,7 +96,7 @@ void MsConfig_OnTabWndSelChange(void)
|
||||||
ShowWindow(hFreeLdrPage, SW_HIDE);
|
ShowWindow(hFreeLdrPage, SW_HIDE);
|
||||||
ShowWindow(hServicesPage, SW_HIDE);
|
ShowWindow(hServicesPage, SW_HIDE);
|
||||||
BringWindowToTop(hSystemPage);
|
BringWindowToTop(hSystemPage);
|
||||||
break;
|
break;
|
||||||
case 2: //Freeldr
|
case 2: //Freeldr
|
||||||
ShowWindow(hGeneralPage, SW_HIDE);
|
ShowWindow(hGeneralPage, SW_HIDE);
|
||||||
ShowWindow(hSystemPage, SW_HIDE);
|
ShowWindow(hSystemPage, SW_HIDE);
|
||||||
|
@ -135,30 +137,57 @@ void MsConfig_OnTabWndSelChange(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static
|
||||||
|
VOID
|
||||||
|
SetDialogIcon(HWND hDlg)
|
||||||
|
{
|
||||||
|
if (hDialogIcon) DestroyIcon(hDialogIcon);
|
||||||
|
|
||||||
|
hDialogIcon = LoadImage(GetModuleHandle(NULL),
|
||||||
|
MAKEINTRESOURCE(IDI_APPICON),
|
||||||
|
IMAGE_ICON,
|
||||||
|
uXIcon,
|
||||||
|
uYIcon,
|
||||||
|
0);
|
||||||
|
SendMessage(hDlg,
|
||||||
|
WM_SETICON,
|
||||||
|
ICON_SMALL,
|
||||||
|
(LPARAM)hDialogIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Message handler for dialog box. */
|
/* Message handler for dialog box. */
|
||||||
INT_PTR CALLBACK
|
INT_PTR CALLBACK
|
||||||
MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
int idctrl;
|
int idctrl;
|
||||||
LPNMHDR pnmh;
|
LPNMHDR pnmh;
|
||||||
static HICON hIcon;
|
UINT uXIconNew, uYIconNew;
|
||||||
|
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
hMainWnd = hDlg;
|
hMainWnd = hDlg;
|
||||||
hIcon = LoadImage(GetModuleHandle(NULL),
|
|
||||||
MAKEINTRESOURCE(IDI_APPICON),
|
uXIcon = GetSystemMetrics(SM_CXSMICON);
|
||||||
IMAGE_ICON,
|
uYIcon = GetSystemMetrics(SM_CYSMICON);
|
||||||
16,
|
|
||||||
16,
|
SetDialogIcon(hDlg);
|
||||||
0);
|
|
||||||
SendMessage(hDlg,
|
|
||||||
WM_SETICON,
|
|
||||||
ICON_SMALL,
|
|
||||||
(LPARAM)hIcon);
|
|
||||||
return OnCreate(hDlg);
|
return OnCreate(hDlg);
|
||||||
|
|
||||||
|
case WM_SETTINGCHANGE:
|
||||||
|
uXIconNew = GetSystemMetrics(SM_CXSMICON);
|
||||||
|
uYIconNew = GetSystemMetrics(SM_CYSMICON);
|
||||||
|
|
||||||
|
if ((uXIcon != uXIconNew) || (uYIcon != uYIconNew))
|
||||||
|
{
|
||||||
|
uXIcon = uXIconNew;
|
||||||
|
uYIcon = uYIconNew;
|
||||||
|
SetDialogIcon(hDlg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
|
||||||
if (LOWORD(wParam) == IDOK)
|
if (LOWORD(wParam) == IDOK)
|
||||||
|
@ -196,8 +225,8 @@ MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
DestroyWindow(hFreeLdrPage);
|
DestroyWindow(hFreeLdrPage);
|
||||||
if (hSystemPage)
|
if (hSystemPage)
|
||||||
DestroyWindow(hSystemPage);
|
DestroyWindow(hSystemPage);
|
||||||
if (hIcon)
|
if (hDialogIcon)
|
||||||
DestroyIcon(hIcon);
|
DestroyIcon(hDialogIcon);
|
||||||
return DefWindowProc(hDlg, message, wParam, lParam);
|
return DefWindowProc(hDlg, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue