mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[HOTPLUG] Add title bar icon (#4695)
- Add small icon to the title bar - Set large icon correctly CORE-15445
This commit is contained in:
parent
cd6c7272a4
commit
474f406496
1 changed files with 27 additions and 0 deletions
|
@ -17,6 +17,8 @@
|
|||
|
||||
typedef struct _HOTPLUG_DATA
|
||||
{
|
||||
HICON hIcon;
|
||||
HICON hIconSm;
|
||||
SP_CLASSIMAGELIST_DATA ImageListData;
|
||||
HMENU hPopupMenu;
|
||||
DWORD dwFlags;
|
||||
|
@ -372,6 +374,21 @@ SafeRemovalDlgProc(
|
|||
SetWindowTextW(hwndDlg, szWindowTitle);
|
||||
}
|
||||
|
||||
pHotplugData->hIcon = (HICON)LoadImageW(hApplet,
|
||||
MAKEINTRESOURCEW(IDI_HOTPLUG),
|
||||
IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXICON),
|
||||
GetSystemMetrics(SM_CYICON),
|
||||
LR_DEFAULTCOLOR);
|
||||
pHotplugData->hIconSm = (HICON)LoadImageW(hApplet,
|
||||
MAKEINTRESOURCEW(IDI_HOTPLUG),
|
||||
IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXSMICON),
|
||||
GetSystemMetrics(SM_CYSMICON),
|
||||
LR_DEFAULTCOLOR);
|
||||
SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)pHotplugData->hIcon);
|
||||
SendMessageW(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)pHotplugData->hIconSm);
|
||||
|
||||
pHotplugData->ImageListData.cbSize = sizeof(pHotplugData->ImageListData);
|
||||
SetupDiGetClassImageList(&pHotplugData->ImageListData);
|
||||
|
||||
|
@ -472,6 +489,16 @@ SafeRemovalDlgProc(
|
|||
|
||||
SetupDiDestroyClassImageList(&pHotplugData->ImageListData);
|
||||
|
||||
if (pHotplugData->hIconSm)
|
||||
{
|
||||
DestroyIcon(pHotplugData->hIconSm);
|
||||
}
|
||||
|
||||
if (pHotplugData->hIcon)
|
||||
{
|
||||
DestroyIcon(pHotplugData->hIcon);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, pHotplugData);
|
||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue