diff --git a/dll/shellext/wlanwiz/draw.cpp b/dll/shellext/wlanwiz/draw.cpp index 54e136461b263..1d7791c92040e 100644 --- a/dll/shellext/wlanwiz/draw.cpp +++ b/dll/shellext/wlanwiz/draw.cpp @@ -212,7 +212,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b if (wlanNetwork.bSecurityEnabled) { DrawIconEx(pdis->hDC, - 4, + 52, pdis->rcItem.top + 36, LoadIconW(GetModuleHandleW(L"shell32.dll"), MAKEINTRESOURCEW(48)), /* lock icon */ 16, @@ -223,7 +223,7 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b } crItemText = SetTextColor(pdis->hDC, GetSysColor(pdis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT)); - TextOutW(pdis->hDC, 4, pdis->rcItem.top + 4, cswWindowText, cswWindowText.GetLength()); /* SSID */ + TextOutW(pdis->hDC, 52, pdis->rcItem.top + 4, cswWindowText, cswWindowText.GetLength()); /* SSID */ this->lfCaption.lfWeight = FW_NORMAL; SelectObject(pdis->hDC, hOld); @@ -232,13 +232,14 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b /* Is network password-protected? */ ATL::CStringW cswNetworkSecurity = L""; + if (wlanNetwork.dot11BssType == dot11_BSS_type_infrastructure) cswNetworkSecurity.LoadStringW(wlanNetwork.bSecurityEnabled ? IDS_WLANWIZ_ENCRYPTED_AP : IDS_WLANWIZ_UNENCRYPTED_AP); else if (wlanNetwork.dot11BssType == dot11_BSS_type_independent) cswNetworkSecurity.LoadStringW(wlanNetwork.bSecurityEnabled ? IDS_WLANWIZ_ENCRYPTED_IBSS : IDS_WLANWIZ_UNENCRYPTED_IBSS); TextOutW(pdis->hDC, - wlanNetwork.bSecurityEnabled ? 24 : 16, + wlanNetwork.bSecurityEnabled ? 72 : 64, pdis->rcItem.top + 38, cswNetworkSecurity, cswNetworkSecurity.GetLength()); @@ -260,16 +261,40 @@ LRESULT CWlanWizard::OnDrawItem(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b else if (uRSSI >= 96) iRSSIResIcon = IDI_WLANICON_100; + HICON hicnRes = LoadIconW(wlanwiz_hInstance, MAKEINTRESOURCEW(iRSSIResIcon)); + DrawIconEx(pdis->hDC, pdis->rcItem.right - 36, pdis->rcItem.top + 24, - LoadIconW(wlanwiz_hInstance, MAKEINTRESOURCEW(iRSSIResIcon)), + hicnRes, 32, 32, NULL, NULL, DI_NORMAL); + DestroyIcon(hicnRes); + + int iBSSIcon = IDI_BSS_INFRA; + + if (wlanNetwork.dot11BssType == dot11_BSS_type_independent) + iBSSIcon = IDI_BSS_ADHOC; + + /* LoadImageW refuses to load 48px icon properly */ + hicnRes = static_cast(LoadImageW(wlanwiz_hInstance, MAKEINTRESOURCEW(iBSSIcon), IMAGE_ICON, 48, 48, LR_LOADTRANSPARENT)); + + DrawIconEx(pdis->hDC, + pdis->rcItem.left + 2, + pdis->rcItem.top + 3, + hicnRes, + 48, + 48, + NULL, + NULL, + DI_NORMAL); + + DestroyIcon(hicnRes); + /* Shrink focus rectangle for listbox items */ pdis->rcItem.left += 1; pdis->rcItem.top += 1; diff --git a/dll/shellext/wlanwiz/res/bss_adhoc.ico b/dll/shellext/wlanwiz/res/bss_adhoc.ico new file mode 100644 index 0000000000000..d74c165b01dce Binary files /dev/null and b/dll/shellext/wlanwiz/res/bss_adhoc.ico differ diff --git a/dll/shellext/wlanwiz/res/bss_infra.ico b/dll/shellext/wlanwiz/res/bss_infra.ico new file mode 100644 index 0000000000000..23a02219fe4c1 Binary files /dev/null and b/dll/shellext/wlanwiz/res/bss_infra.ico differ diff --git a/dll/shellext/wlanwiz/resource.h b/dll/shellext/wlanwiz/resource.h index d828fe422cafb..0a6c5c0ce2729 100644 --- a/dll/shellext/wlanwiz/resource.h +++ b/dll/shellext/wlanwiz/resource.h @@ -18,6 +18,9 @@ #define IDI_AP_CONNECTING 110 #define IDI_AP_DHCP_FAILED 111 +#define IDI_BSS_INFRA 112 +#define IDI_BSS_ADHOC 113 + /* Dialog resources */ #define IDD_WLANWIZ_DIALOG 400 #define IDD_WLANWIZ_CHOOSE_NET_TITLE 401 diff --git a/dll/shellext/wlanwiz/wlanwiz.rc b/dll/shellext/wlanwiz/wlanwiz.rc index 743cae6a66aa3..ee7a638d3508c 100644 --- a/dll/shellext/wlanwiz/wlanwiz.rc +++ b/dll/shellext/wlanwiz/wlanwiz.rc @@ -25,6 +25,9 @@ IDI_AP_UNAVAILABLE ICON "res/ap_unavail.ico" IDI_AP_CONNECTING ICON "res/ap_conn.ico" IDI_AP_DHCP_FAILED ICON "res/dhcp_fail.ico" +IDI_BSS_INFRA ICON "res/bss_infra.ico" +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"