mirror of
https://github.com/henrypp/simplewall.git
synced 2026-10-22 02:52:54 -05:00
upd _r_sys_loadicon
This commit is contained in:
3 files changed
+49
-15
No files matched your search
+14
-5
@@ -1852,14 +1852,23 @@ INT_PTR CALLBACK DlgProc (_In_ HWND hwnd, _In_ UINT msg, _In_ WPARAM wparam, _In
|
||||
|
||||
case RM_TASKBARCREATED:
|
||||
{
|
||||
LONG dpi_value;
|
||||
LPCWSTR icon_id;
|
||||
HICON hicon;
|
||||
|
||||
dpi_value = _r_dc_getsystemdpi ();
|
||||
icon_id = MAKEINTRESOURCE (_wfp_isfiltersinstalled () ? IDI_ACTIVE : IDI_INACTIVE);
|
||||
LONG dpi_value;
|
||||
|
||||
hicon = _r_loadicon (_r_sys_getimagebase (), icon_id, _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value), TRUE);
|
||||
LONG icon_small_x;
|
||||
LONG icon_small_y;
|
||||
|
||||
UINT icon_id;
|
||||
|
||||
dpi_value = _r_dc_getsystemdpi ();
|
||||
|
||||
icon_small_x = _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value);
|
||||
icon_small_y = _r_dc_getsystemmetrics (SM_CYSMICON, dpi_value);
|
||||
|
||||
icon_id = _wfp_isfiltersinstalled () ? IDI_ACTIVE : IDI_INACTIVE;
|
||||
|
||||
hicon = _r_sys_loadicon (_r_sys_getimagebase (), MAKEINTRESOURCE (icon_id), icon_small_x, icon_small_y, TRUE);
|
||||
|
||||
// refresh tray icon
|
||||
_r_tray_create (hwnd, &GUID_TrayIcon, WM_TRAYICON, hicon, _r_app_getname (), FALSE);
|
||||
|
||||
+13
-4
@@ -1202,13 +1202,22 @@ VOID _app_message_initialize (_In_ HWND hwnd)
|
||||
{
|
||||
HICON hicon;
|
||||
HMENU hmenu;
|
||||
LPCWSTR icon_id;
|
||||
|
||||
LONG dpi_value;
|
||||
|
||||
dpi_value = _r_dc_getsystemdpi ();
|
||||
icon_id = MAKEINTRESOURCE (_wfp_isfiltersinstalled () ? IDI_ACTIVE : IDI_INACTIVE);
|
||||
LONG icon_small_x;
|
||||
LONG icon_small_y;
|
||||
|
||||
hicon = _r_loadicon (_r_sys_getimagebase (), icon_id, _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value), TRUE);
|
||||
UINT icon_id;
|
||||
|
||||
dpi_value = _r_dc_getsystemdpi ();
|
||||
|
||||
icon_small_x = _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value);
|
||||
icon_small_y = _r_dc_getsystemmetrics (SM_CYSMICON, dpi_value);
|
||||
|
||||
icon_id = _wfp_isfiltersinstalled () ? IDI_ACTIVE : IDI_INACTIVE;
|
||||
|
||||
hicon = _r_sys_loadicon (_r_sys_getimagebase (), MAKEINTRESOURCE (icon_id), icon_small_x, icon_small_y, TRUE);
|
||||
|
||||
_r_tray_create (hwnd, &GUID_TrayIcon, WM_TRAYICON, hicon, _r_app_getname (), FALSE);
|
||||
|
||||
|
||||
+22
-6
@@ -516,27 +516,43 @@ HFONT _app_notifyfontinit (_Inout_ PLOGFONT logfont, _In_ LONG dpi_value, _In_ L
|
||||
|
||||
VOID _app_notifyfontset (_In_ HWND hwnd)
|
||||
{
|
||||
NONCLIENTMETRICS ncm = {0};
|
||||
|
||||
LONG dpi_value;
|
||||
|
||||
INT title_font_height = 12;
|
||||
INT text_font_height = 9;
|
||||
LONG icon_small_x;
|
||||
LONG icon_small_y;
|
||||
|
||||
NONCLIENTMETRICS ncm = {0};
|
||||
ncm.cbSize = sizeof (ncm);
|
||||
LONG icon_large_x;
|
||||
LONG icon_large_y;
|
||||
|
||||
INT title_font_height;
|
||||
INT text_font_height;
|
||||
|
||||
dpi_value = _r_dc_getwindowdpi (hwnd);
|
||||
|
||||
icon_small_x = _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value);
|
||||
icon_small_y = _r_dc_getsystemmetrics (SM_CYSMICON, dpi_value);
|
||||
|
||||
icon_large_x = _r_dc_getsystemmetrics (SM_CXICON, dpi_value);
|
||||
icon_large_y = _r_dc_getsystemmetrics (SM_CYICON, dpi_value);
|
||||
|
||||
_r_wnd_seticon (hwnd,
|
||||
_r_loadicon (NULL, MAKEINTRESOURCE (SIH_EXCLAMATION), _r_dc_getsystemmetrics (SM_CXSMICON, dpi_value), TRUE),
|
||||
_r_loadicon (NULL, MAKEINTRESOURCE (SIH_EXCLAMATION), _r_dc_getsystemmetrics (SM_CXICON, dpi_value), TRUE)
|
||||
_r_sys_loadicon (NULL, MAKEINTRESOURCE (SIH_EXCLAMATION), icon_small_x, icon_small_y, TRUE),
|
||||
_r_sys_loadicon (NULL, MAKEINTRESOURCE (SIH_EXCLAMATION), icon_large_x, icon_large_y, TRUE)
|
||||
);
|
||||
|
||||
ncm.cbSize = sizeof (ncm);
|
||||
|
||||
if (SystemParametersInfo (SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0))
|
||||
{
|
||||
SAFE_DELETE_OBJECT (hfont_title);
|
||||
SAFE_DELETE_OBJECT (hfont_link);
|
||||
SAFE_DELETE_OBJECT (hfont_text);
|
||||
|
||||
title_font_height = 12;
|
||||
text_font_height = 9;
|
||||
|
||||
hfont_title = _app_notifyfontinit (&ncm.lfCaptionFont, dpi_value, title_font_height, FW_NORMAL, FALSE);
|
||||
hfont_link = _app_notifyfontinit (&ncm.lfMessageFont, dpi_value, text_font_height, FW_NORMAL, TRUE);
|
||||
hfont_text = _app_notifyfontinit (&ncm.lfMessageFont, dpi_value, text_font_height, FW_NORMAL, FALSE);
|
||||
|
||||
Reference in new issue
Block a user