Skip to content

Commit

Permalink
[WLANWIZ] Pick the 'Favorites' icon from shell32
Browse files Browse the repository at this point in the history
Saving 1.1 KB of storage, that's why.
  • Loading branch information
Vitaly Orekhov committed Sep 28, 2024
1 parent 523625c commit ac7a8cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion dll/shellext/wlanwiz/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,23 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
* The +20 offset originates from resource.h, the IDs are laid out in a way
* they can be safely batch processed in loops, as the range is fixed. */
if (wParam >= IDC_WLANWIZ_SCAN_NETWORKS && wParam <= IDC_WLANWIZ_ADVANCED_SETTINGS)
{
HICON hSidebarIcon = NULL;

wParam == IDC_WLANWIZ_PREFERRED_APS
? hSidebarIcon = LoadIconW(GetModuleHandleW(L"shell32.dll"), MAKEINTRESOURCE(44)) /* 'Favorites' icon */
: hSidebarIcon = LoadIconW(wlanwiz_hInstance, MAKEINTRESOURCEW(wParam + 20));

DrawIconEx(this->hThemeEB ? hDCBtn : pdis->hDC,
pdis->rcItem.left + 2,
pdis->rcItem.top + 2,
LoadIconW(wlanwiz_hInstance, MAKEINTRESOURCEW(wParam + 20)),
hSidebarIcon,
16,
16,
NULL,
NULL,
DI_NORMAL);
}

/* Step 3: Draw button text */
HFONT hfBtnCaption = NULL;
Expand Down
Binary file removed dll/shellext/wlanwiz/res/favorite.ico
Binary file not shown.
1 change: 0 additions & 1 deletion dll/shellext/wlanwiz/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/* Sidebar dialog controls icons */
#define IDI_WLANWIZ_SCAN_NETWORKS 431
#define IDI_WLANWIZ_INSTALL_WLAN 432
#define IDI_WLANWIZ_PREFERRED_APS 441
#define IDI_WLANWIZ_ADVANCED_SETTINGS 442

/* Sidebar dialog controls toolip strings */
Expand Down
1 change: 0 additions & 1 deletion dll/shellext/wlanwiz/wlanwiz.rc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ IDI_BSS_ADHOC ICON "res/bss_adhoc.ico"

IDI_WLANWIZ_SCAN_NETWORKS ICON "res/refresh.ico"
IDI_WLANWIZ_INSTALL_WLAN ICON "res/wlanwiz.ico"
IDI_WLANWIZ_PREFERRED_APS ICON "res/favorite.ico"
IDI_WLANWIZ_ADVANCED_SETTINGS ICON "res/advanced_settings.ico"

#include <reactos/manifest_hosted.rc>
Expand Down

0 comments on commit ac7a8cc

Please sign in to comment.