https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6dcc07c18d042c2651766…
commit 6dcc07c18d042c26517665042191db2fc3c080d5
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Fri Sep 9 23:51:51 2022 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Sep 9 23:51:51 2022 +0200
[NETSHELL] Fix Network Tray icon activity indication (#4669)
The network activity tray icon wasn't showing activity until the Properties
dialog was opened at least once.
This was due to the fact that the tray icon was initialized once with missing
initialization parameters for pContext (default state and Adapter index).
Fix this problem by adding the missing initialization.
CORE-4497, CORE-9017, CORE-15744
---
dll/shellext/netshell/lanstatusui.cpp | 8 ++++++--
dll/shellext/netshell/resource.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dll/shellext/netshell/lanstatusui.cpp
b/dll/shellext/netshell/lanstatusui.cpp
index 64f38ef4a0f..a6d3b96e744 100644
--- a/dll/shellext/netshell/lanstatusui.cpp
+++ b/dll/shellext/netshell/lanstatusui.cpp
@@ -9,6 +9,8 @@
#include <winsock.h>
+#define NETTIMERID 0xFABC
+
CLanStatus::CLanStatus() :
m_lpNetMan(NULL),
m_pHead(NULL)
@@ -116,7 +118,7 @@ UpdateLanStatusUiDlg(
}
VOID
-UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext)
+UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext)
{
MIB_IFROW IfEntry;
HICON hIcon, hOldIcon = NULL;
@@ -839,7 +841,7 @@ LANStatusDlg(
case WM_INITDIALOG:
pContext = (LANSTATUSUI_CONTEXT *)lParam;
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
- pContext->nIDEvent = SetTimer(hwndDlg, 0xFABC, 1000, NULL);
+ pContext->nIDEvent = SetTimer(hwndDlg, NETTIMERID, 1000, NULL);
return TRUE;
case WM_TIMER:
pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
@@ -946,6 +948,8 @@ CLanStatus::InitializeNetTaskbarNotifications()
ZeroMemory(pContext, sizeof(LANSTATUSUI_CONTEXT));
pContext->uID = Index;
pContext->pNet = pNetCon;
+ pContext->Status = -1;
+ pContext->dwAdapterIndex = Index;
pItem->uID = Index;
pItem->pNext = NULL;
pItem->pNet = pNetCon;
diff --git a/dll/shellext/netshell/resource.h b/dll/shellext/netshell/resource.h
index 2d4fb6dfa2a..1519c473099 100644
--- a/dll/shellext/netshell/resource.h
+++ b/dll/shellext/netshell/resource.h
@@ -125,3 +125,4 @@
#define IDS_WZD_DOMAIN_NAME 13457
#define IDR_NETSHELL 20000
+