ReactOS 0.4.17-dev-806-gffa4164
lanstatusui.cpp File Reference
#include "precomp.h"
#include <winsock.h>
Include dependency graph for lanstatusui.cpp:

Go to the source code of this file.

Macros

#define NETTIMERID   0xFABC
 
#define NETTIMERINTERVAL   1000
 
#define WPARAM_MAGIC   MAKELONG(MAKEWORD('L', 'S'), MAKEWORD('T', 'I'))
 

Functions

static void EnumNotificationIconWindows (WNDENUMPROC Func, LPARAM lParam=0)
 
VOID UpdateLanStatusUiDlg (HWND hwndDlg, MIB_IFROW *IfEntry, LANSTATUSUI_CONTEXT *pContext)
 
static VOID UpdateNotificationIcon (LANSTATUSUI_CONTEXT &ctx, UINT IconRes=0)
 
static VOID UpdateLanStatus (HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
 
VOID InitializeLANStatusUiDlg (HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
 
static VOID InsertColumnToListView (HWND hDlgCtrl, UINT ResId, UINT SubItem, UINT Size)
 
static VOID AddIPAddressToListView (HWND hDlgCtrl, PIP_ADDR_STRING pAddr, INT Index)
 
static INT InsertItemToListView (HWND hDlgCtrl, UINT ResId)
 
static BOOL tmToStr (IN struct tm *pTM, OUT LPWSTR szBuffer, IN UINT nBufferSize)
 
INT_PTR CALLBACK LANStatusUiDetailsDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK LANStatusUiAdvancedDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID DisableNetworkAdapter (INetConnection *pNet, LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
 
INT_PTR CALLBACK LANStatusUiDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID InitializePropertyDialog (LANSTATUSUI_CONTEXT *pContext, NETCON_PROPERTIES *pProperties)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
VOID ShowStatusPropertyDialog (LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
 
VOID ShowNetworkIconContextMenu (_In_ HWND hwndOwner, _In_ LANSTATUSUI_CONTEXT *pContext)
 
HRESULT RepairConnection (INetConnection *pNet, HWND hwndOwner)
 
static void ConfigureNotificationIconTimer (LANSTATUSUI_CONTEXT &ctx)
 
INT_PTR CALLBACK LANStatusDlg (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL CALLBACK RefreshNetTaskbarNotificationIconEnumProc (HWND hWnd, LPARAM lParam)
 
void RefreshNetTaskbarNotificationIcon ()
 

Macro Definition Documentation

◆ NETTIMERID

#define NETTIMERID   0xFABC

Definition at line 12 of file lanstatusui.cpp.

◆ NETTIMERINTERVAL

#define NETTIMERINTERVAL   1000

Definition at line 13 of file lanstatusui.cpp.

◆ WPARAM_MAGIC

#define WPARAM_MAGIC   MAKELONG(MAKEWORD('L', 'S'), MAKEWORD('T', 'I'))

Definition at line 14 of file lanstatusui.cpp.

Function Documentation

◆ AddIPAddressToListView()

static VOID AddIPAddressToListView ( HWND  hDlgCtrl,
PIP_ADDR_STRING  pAddr,
INT  Index 
)
static

Definition at line 326 of file lanstatusui.cpp.

330{
331 LVITEMW li;
333 WCHAR szBuffer[100];
334 UINT SubIndex;
335
336 ZeroMemory(&li, sizeof(LVITEMW));
337 li.mask = LVIF_TEXT;
338 li.iItem = Index;
339 pCur = pAddr;
340 SubIndex = 0;
341
342 do
343 {
344 if (SubIndex)
345 {
346 ZeroMemory(&li, sizeof(LVITEMW));
347 li.mask = LVIF_TEXT;
348 li.iItem = Index;
349 li.iSubItem = 0;
350 li.pszText = (LPWSTR)L"";
351 li.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li);
352 }
353
354 if (MultiByteToWideChar(CP_ACP, 0, pCur->IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
355 {
356 li.pszText = szBuffer;
357 li.iSubItem = 1;
358 li.iItem = Index++;
359 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
360 }
361 SubIndex++;
362 pCur = pCur->Next;
363 } while (pCur && pCur->IpAddress.String[0]);
364}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
#define L(x)
Definition: resources.c:13
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
SINGLE_LIST_ENTRY * pCur
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235
unsigned int UINT
Definition: sysinfo.c:13
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
short WCHAR
Definition: pedump.c:58
#define LVM_SETITEMW
Definition: commctrl.h:2402
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVM_INSERTITEMW
Definition: commctrl.h:2409
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:641
uint16_t * LPWSTR
Definition: typedefs.h:56
_In_ WDFCOLLECTION _In_ ULONG Index
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by LANStatusUiDetailsDlg().

◆ ConfigureNotificationIconTimer()

static void ConfigureNotificationIconTimer ( LANSTATUSUI_CONTEXT ctx)
static

Definition at line 968 of file lanstatusui.cpp.

969{
970 BOOL Enable = TRUE;
971 NETCON_PROPERTIES *pNCP;
972 if (SUCCEEDED(ctx.pNet->GetProperties(&pNCP)))
973 {
976 }
977
978 if (Enable)
979 {
980 ctx.nIDEvent = SetTimer(ctx.hwndStatusDlg, NETTIMERID, NETTIMERINTERVAL, NULL);
981 }
982 else if (ctx.nIDEvent)
983 {
984 KillTimer(ctx.hwndStatusDlg, ctx.nIDEvent);
985 ctx.nIDEvent = 0;
986 }
988}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define NETTIMERID
Definition: lanstatusui.cpp:12
static VOID UpdateNotificationIcon(LANSTATUSUI_CONTEXT &ctx, UINT IconRes=0)
#define NETTIMERINTERVAL
Definition: lanstatusui.cpp:13
@ NCCF_SHOW_ICON
Definition: netcon.h:20
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by LANStatusDlg().

◆ DisableNetworkAdapter()

VOID DisableNetworkAdapter ( INetConnection pNet,
LANSTATUSUI_CONTEXT pContext,
HWND  hwndDlg 
)

Definition at line 643 of file lanstatusui.cpp.

644{
645 HRESULT hr = pNet->Disconnect();
647 return;
648
650
652 ZeroMemory(&nid, sizeof(nid));
653 nid.cbSize = sizeof(nid);
654 nid.uID = pContext->uID;
655 nid.hWnd = pContext->hwndDlg;
656 nid.uFlags = NIF_STATE;
657 nid.dwState = NIS_HIDDEN;
658 nid.dwStateMask = NIS_HIDDEN;
659
661}
HRESULT hr
Definition: delayimp.cpp:582
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
HRESULT Disconnect()
NOTIFYICONDATA nid
Definition: magnifier.c:44
#define PSBTN_CANCEL
Definition: prsht.h:151
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define NIM_MODIFY
Definition: shellapi.h:95
DWORD dwStateMask
Definition: shellapi.h:239
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
Definition: systray.cpp:128
HWND WINAPI GetParent(_In_ HWND)

Referenced by LANStatusUiDlg().

◆ EnumNotificationIconWindows()

static void EnumNotificationIconWindows ( WNDENUMPROC  Func,
LPARAM  lParam = 0 
)
static

Definition at line 17 of file lanstatusui.cpp.

20{
21 // The current design unfortunately uses one window per icon (that is what NOTIFYICONDATA::uID is for),
22 // WNDENUMPROC is responsible for making sure they are dealing with the correct window.
23 HWND hPrev = NULL, hWnd;
24 for (; (hWnd = FindWindowExW(NULL, hPrev, NULL, TRAYICONWINDOWCAPTIONW)) != NULL; hPrev = hWnd)
25 {
26 if (!Func(hWnd, lParam))
27 break;
28 }
29}
HWND hWnd
Definition: settings.c:17
LPARAM lParam
Definition: combotst.c:139
#define TRAYICONWINDOWCAPTIONW
Definition: resource.h:4
void(* Func)(int)
HWND WINAPI FindWindowExW(_In_opt_ HWND, _In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR)

Referenced by RefreshNetTaskbarNotificationIcon().

◆ InitializeLANStatusUiDlg()

VOID InitializeLANStatusUiDlg ( HWND  hwndDlg,
LANSTATUSUI_CONTEXT pContext 
)

Definition at line 268 of file lanstatusui.cpp.

269{
270 WCHAR szBuffer[MAX_PATH] = {0};
271 NETCON_PROPERTIES * pProperties;
272
273 if (pContext->pNet->GetProperties(&pProperties) != S_OK)
274 return;
275
276 if (pProperties->Status == NCS_DISCONNECTED)
278 else if (pProperties->Status == NCS_MEDIA_DISCONNECTED)
280 else if (pProperties->Status == NCS_CONNECTING)
282 else if (pProperties->Status == NCS_CONNECTED)
284
285 SendDlgItemMessageW(hwndDlg, IDC_STATUS, WM_SETTEXT, 0, (LPARAM)szBuffer);
286
287 pContext->dwInOctets = 0;
288 pContext->dwOutOctets = 0;
289
290 if (!(pProperties->dwCharacter & NCCF_SHOW_ICON))
292
293 /* update adapter info */
294 pContext->Status = -1;
295 UpdateLanStatus(hwndDlg, pContext);
296 NcFreeNetconProperties(pProperties);
297}
#define IDS_STATUS_CONNECTED
Definition: resource.h:100
#define IDC_STATUS
Definition: resource.h:44
#define IDS_STATUS_DISCONNECTED
Definition: resource.h:98
#define IDS_STATUS_UNREACHABLE
Definition: resource.h:97
#define IDS_STATUS_CONNECTING
Definition: resource.h:99
#define MAX_PATH
Definition: compat.h:34
HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps)
#define S_OK
Definition: intsafe.h:52
static VOID UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
@ NCS_CONNECTING
Definition: netcon.h:40
@ NCS_MEDIA_DISCONNECTED
Definition: netcon.h:46
@ NCS_CONNECTED
Definition: netcon.h:41
@ NCS_DISCONNECTED
Definition: netcon.h:39
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define LoadStringW
Definition: utils.h:64
INetConnection * pNet
Definition: lanstatusui.h:20
NETCON_STATUS Status
Definition: netcon.h:86
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETTEXT
Definition: winuser.h:1645

Referenced by LANStatusUiDlg().

◆ InitializePropertyDialog()

VOID InitializePropertyDialog ( LANSTATUSUI_CONTEXT pContext,
NETCON_PROPERTIES pProperties 
)

Definition at line 727 of file lanstatusui.cpp.

730{
731 DWORD dwSize, dwAdapterIndex, dwResult;
732 LPOLESTR pStr;
733 IP_ADAPTER_INFO *pAdapterInfo, *pCurAdapter;
734
735 if (FAILED(StringFromCLSID((CLSID)pProperties->guidId, &pStr)))
736 {
737 return;
738 }
739
740 /* get the IfTable */
741 dwSize = 0;
742 dwResult = GetAdaptersInfo(NULL, &dwSize);
743 if (dwResult!= ERROR_BUFFER_OVERFLOW)
744 {
745 CoTaskMemFree(pStr);
746 return;
747 }
748
749 pAdapterInfo = static_cast<PIP_ADAPTER_INFO>(CoTaskMemAlloc(dwSize));
750 if (!pAdapterInfo)
751 {
752 CoTaskMemFree(pAdapterInfo);
753 CoTaskMemFree(pStr);
754 return;
755 }
756
757 if (GetAdaptersInfo(pAdapterInfo, &dwSize) != NO_ERROR)
758 {
759 CoTaskMemFree(pAdapterInfo);
760 CoTaskMemFree(pStr);
761 return;
762 }
763
764 if (!GetAdapterIndexFromNetCfgInstanceId(pAdapterInfo, pStr, &dwAdapterIndex))
765 {
766 CoTaskMemFree(pAdapterInfo);
767 CoTaskMemFree(pStr);
768 return;
769 }
770
771 pCurAdapter = pAdapterInfo;
772 while (pCurAdapter->Index != dwAdapterIndex)
773 pCurAdapter = pCurAdapter->Next;
774
775
776 pContext->IpAddress = inet_addr(pCurAdapter->IpAddressList.IpAddress.String);
777 pContext->SubnetMask = inet_addr(pCurAdapter->IpAddressList.IpMask.String);
778 pContext->Gateway = inet_addr(pCurAdapter->GatewayList.IpAddress.String);
779 pContext->DHCPEnabled = pCurAdapter->DhcpEnabled;
780 CoTaskMemFree(pStr);
781 CoTaskMemFree(pAdapterInfo);
782 pContext->dwAdapterIndex = dwAdapterIndex;
783}
BOOL GetAdapterIndexFromNetCfgInstanceId(PIP_ADAPTER_INFO pAdapterInfo, LPWSTR szNetCfg, PDWORD pIndex)
#define NO_ERROR
Definition: dderror.h:5
HRESULT WINAPI StringFromCLSID(REFCLSID clsid, LPOLESTR *str)
Definition: combase.c:1515
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FAILED(hr)
Definition: intsafe.h:51
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
char String[4 *4]
Definition: iptypes.h:31
struct _IP_ADAPTER_INFO * Next
Definition: iptypes.h:42
IP_ADDR_STRING IpAddressList
Definition: iptypes.h:52
IP_ADDR_STRING GatewayList
Definition: iptypes.h:53
UINT DhcpEnabled
Definition: iptypes.h:50
IP_ADDRESS_STRING IpAddress
Definition: iptypes.h:36
IP_MASK_STRING IpMask
Definition: iptypes.h:37
u_long WINAPI inet_addr(const char *str)
Definition: wine.c:35
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307

Referenced by ShowStatusPropertyDialog().

◆ InsertColumnToListView()

static VOID InsertColumnToListView ( HWND  hDlgCtrl,
UINT  ResId,
UINT  SubItem,
UINT  Size 
)
static

Definition at line 301 of file lanstatusui.cpp.

306{
307 WCHAR szBuffer[200];
308 LVCOLUMNW lc;
309
310 if (!LoadStringW(netshell_hInstance, ResId, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
311 return;
312
313 memset(&lc, 0, sizeof(LV_COLUMN) );
315 lc.iSubItem = SubItem;
316 lc.fmt = LVCFMT_FIXED_WIDTH;
317 lc.cx = Size;
318 lc.cchTextMax = wcslen(szBuffer);
319 lc.pszText = szBuffer;
320
321 (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, SubItem, (LPARAM)&lc);
322}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2637
#define LVCF_FMT
Definition: commctrl.h:2591
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LV_COLUMN
Definition: commctrl.h:2552
#define memset(x, y, z)
Definition: compat.h:39
int cchTextMax
Definition: commctrl.h:2573
LPWSTR pszText
Definition: commctrl.h:2572
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

Referenced by LANStatusUiDetailsDlg().

◆ InsertItemToListView()

static INT InsertItemToListView ( HWND  hDlgCtrl,
UINT  ResId 
)
static

Definition at line 368 of file lanstatusui.cpp.

371{
372 LVITEMW li;
373 WCHAR szBuffer[100];
374
375 ZeroMemory(&li, sizeof(LVITEMW));
376 li.mask = LVIF_TEXT;
377 li.iItem = ListView_GetItemCount(hDlgCtrl);
378 if (LoadStringW(netshell_hInstance, ResId, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
379 {
380 li.pszText = szBuffer;
381 return (INT)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&li);
382 }
383 return -1;
384}
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2312
int32_t INT
Definition: typedefs.h:58

Referenced by LANStatusUiDetailsDlg().

◆ LANStatusDlg()

INT_PTR CALLBACK LANStatusDlg ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 992 of file lanstatusui.cpp.

997{
998 LANSTATUSUI_CONTEXT * pContext;
999
1000 switch (uMsg)
1001 {
1002 case WM_INITDIALOG:
1003 pContext = (LANSTATUSUI_CONTEXT *)lParam;
1005 pContext->hwndStatusDlg = hwndDlg;
1006 PostMessage(hwndDlg, WM_CONFIGURETRAYICON, WPARAM_MAGIC, 0); // Delay timer until after NIM_ADD
1007 return TRUE;
1008
1009 case WM_DESTROY:
1010 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
1011 if (pContext && pContext->nIDEvent)
1012 {
1013 KillTimer(hwndDlg, pContext->nIDEvent);
1014 pContext->nIDEvent = 0;
1015 }
1017 break;
1018
1019 case WM_TIMER:
1020 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
1021 if (wParam == (WPARAM)pContext->nIDEvent)
1022 {
1023 UpdateLanStatus(pContext->hwndDlg, pContext);
1024 }
1025 break;
1026
1028 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
1029 if (pContext && wParam == WPARAM_MAGIC)
1031 break;
1032
1033 case WM_SHOWSTATUSDLG:
1034 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
1035 if (!pContext)
1036 break;
1037
1038 switch (LOWORD(lParam))
1039 {
1040 case WM_LBUTTONUP:
1041 if (pContext->hwndDlg)
1042 {
1043 HWND hwndSheet = GetParent(pContext->hwndDlg);
1044 if (hwndSheet)
1045 {
1046 ShowWindow(hwndSheet, SW_RESTORE);
1047 SetForegroundWindow(hwndSheet);
1048 BringWindowToTop(hwndSheet);
1049 }
1050 }
1051 else
1052 {
1053 ShowStatusPropertyDialog(pContext, hwndDlg);
1054 }
1055 break;
1056
1057 if (pContext->hwndDlg)
1058 {
1059 ShowWindow(GetParent(pContext->hwndDlg), SW_SHOW);
1061 }
1062 else
1063 {
1064 ShowStatusPropertyDialog(pContext, hwndDlg);
1065 }
1066 break;
1067
1068 case WM_RBUTTONUP:
1069 case WM_CONTEXTMENU:
1070 ShowNetworkIconContextMenu(hwndDlg, pContext);
1071 break;
1072 }
1073 break;
1074
1075 case WM_COMMAND:
1076 {
1077 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
1078 if (!pContext || !pContext->pNet)
1079 break;
1080
1081 switch (LOWORD(wParam))
1082 {
1083 case IDM_NETICON_ENABLE:
1084 pContext->pNet->Connect();
1085 UpdateLanStatus(NULL, pContext);
1086 break;
1087
1089 pContext->pNet->Disconnect();
1090 UpdateLanStatus(NULL, pContext);
1091 break;
1092
1093 case IDM_NETICON_STATUS:
1094 if (pContext->hwndDlg)
1095 {
1096 HWND hwndSheet = GetParent(pContext->hwndDlg);
1097 if (hwndSheet)
1098 {
1099 ShowWindow(hwndSheet, SW_RESTORE);
1100 SetForegroundWindow(hwndSheet);
1101 BringWindowToTop(hwndSheet);
1102 }
1103 }
1104 else
1105 {
1106 ShowStatusPropertyDialog(pContext, hwndDlg);
1107 }
1108 break;
1109
1110 case IDM_NETICON_REPAIR:
1111 RepairConnection(pContext->pNet, hwndDlg);
1112 break;
1113
1115 ShowNetConnectionProperties(pContext->pNet, hwndDlg);
1116 break;
1117
1119 ShellExecuteW(hwndDlg, NULL, L"control", L"netconnections", NULL, SW_SHOWNORMAL);
1120 break;
1121 }
1122 break;
1123 }
1124 }
1125 return FALSE;
1126}
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
#define IDM_NETICON_ENABLE
Definition: resource.h:57
#define IDM_NETICON_DISABLE
Definition: resource.h:58
#define IDM_NETICON_PROPERTIES
Definition: resource.h:62
#define IDM_NETICON_STATUS
Definition: resource.h:59
#define IDM_NETICON_REPAIR
Definition: resource.h:60
#define IDM_NETICON_OPEN_CONNECTIONS
Definition: resource.h:61
HRESULT Connect()
VOID ShowStatusPropertyDialog(LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
#define WPARAM_MAGIC
Definition: lanstatusui.cpp:14
static void ConfigureNotificationIconTimer(LANSTATUSUI_CONTEXT &ctx)
VOID ShowNetworkIconContextMenu(_In_ HWND hwndOwner, _In_ LANSTATUSUI_CONTEXT *pContext)
HRESULT RepairConnection(INetConnection *pNet, HWND hwndOwner)
#define WM_CONFIGURETRAYICON
Definition: lanstatusui.h:7
#define WM_SHOWSTATUSDLG
Definition: lanstatusui.h:6
UINT_PTR WPARAM
Definition: minwindef.h:174
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define WM_CONTEXTMENU
Definition: richedit.h:64
HRESULT ShowNetConnectionProperties(INetConnection *pNetConnect, HWND hwnd)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2787
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define DWLP_USER
Definition: winuser.h:883
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_RBUTTONUP
Definition: winuser.h:1808
#define WM_INITDIALOG
Definition: winuser.h:1767
#define WM_TIMER
Definition: winuser.h:1770
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define PostMessage
Definition: winuser.h:5998
#define SW_RESTORE
Definition: winuser.h:790
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1637
BOOL WINAPI BringWindowToTop(_In_ HWND)

Referenced by CLanStatus::InitializeNetTaskbarNotifications().

◆ LANStatusUiAdvancedDlg()

INT_PTR CALLBACK LANStatusUiAdvancedDlg ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 580 of file lanstatusui.cpp.

585{
586 WCHAR szBuffer[100] = {0};
588 LANSTATUSUI_CONTEXT * pContext;
589 DWORD dwIpAddr;
590
591
592 switch (uMsg)
593 {
594 case WM_INITDIALOG:
596 pContext = (LANSTATUSUI_CONTEXT*)page->lParam;
597 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pContext);
598 if (pContext->DHCPEnabled)
599 LoadStringW(netshell_hInstance, IDS_ASSIGNED_DHCP, szBuffer, sizeof(szBuffer)/sizeof(WCHAR));
600 else
601 LoadStringW(netshell_hInstance, IDS_ASSIGNED_MANUAL, szBuffer, sizeof(szBuffer)/sizeof(WCHAR));
602
603 szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
604 SendDlgItemMessageW(hwndDlg, IDC_DETAILSTYPE, WM_SETTEXT, 0, (LPARAM)szBuffer);
605
606
607 dwIpAddr = ntohl(pContext->IpAddress);
608 _swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr),
609 THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr));
610 SendDlgItemMessageW(hwndDlg, IDC_DETAILSIP, WM_SETTEXT, 0, (LPARAM)szBuffer);
611
612 dwIpAddr = ntohl(pContext->SubnetMask);
613 _swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr),
614 THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr));
616
617 dwIpAddr = ntohl(pContext->Gateway);
618 if (dwIpAddr)
619 {
620 _swprintf(szBuffer, L"%u.%u.%u.%u", FIRST_IPADDRESS(dwIpAddr), SECOND_IPADDRESS(dwIpAddr),
621 THIRD_IPADDRESS(dwIpAddr), FOURTH_IPADDRESS(dwIpAddr));
623 }
624 return TRUE;
625 case WM_COMMAND:
626 if (LOWORD(wParam) == IDC_DETAILS)
627 {
628 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
629 if (pContext)
630 {
632 LANStatusUiDetailsDlg, (LPARAM)pContext);
633 }
634 }
635 break;
636 default:
637 break;
638 }
639 return FALSE;
640}
#define IDC_DETAILS
Definition: resource.h:18
#define IDD_LAN_NETSTATUSDETAILS
Definition: resource.h:27
#define IDC_DETAILSTYPE
Definition: resource.h:49
#define IDC_DETAILSGATEWAY
Definition: resource.h:52
#define IDS_ASSIGNED_MANUAL
Definition: resource.h:119
#define IDC_DETAILSIP
Definition: resource.h:50
#define IDS_ASSIGNED_DHCP
Definition: resource.h:118
#define IDC_DETAILSSUBNET
Definition: resource.h:51
INT_PTR CALLBACK LANStatusUiDetailsDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define ntohl(x)
Definition: module.h:205
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
#define PROPSHEETPAGE
Definition: prsht.h:389
#define FOURTH_IPADDRESS(x)
Definition: commctrl.h:4496
#define FIRST_IPADDRESS(x)
Definition: commctrl.h:4493
#define SECOND_IPADDRESS(x)
Definition: commctrl.h:4494
#define THIRD_IPADDRESS(x)
Definition: commctrl.h:4495
Definition: module.h:576
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by ShowStatusPropertyDialog().

◆ LANStatusUiDetailsDlg()

INT_PTR CALLBACK LANStatusUiDetailsDlg ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 426 of file lanstatusui.cpp.

432{
433 LANSTATUSUI_CONTEXT * pContext;
434 LVITEMW li;
435 WCHAR szBuffer[100];
436 PIP_ADAPTER_INFO pAdapterInfo, pCurAdapter;
437 PIP_PER_ADAPTER_INFO pPerAdapter;
439 HWND hDlgCtrl;
440 RECT rect;
441
442 switch (uMsg)
443 {
444 case WM_INITDIALOG:
445 pContext = (LANSTATUSUI_CONTEXT*)lParam;
446
447 hDlgCtrl = GetDlgItem(hwndDlg, IDC_DETAILS);
449
450 /* Calculate column width */
451 GetClientRect(hDlgCtrl, &rect);
452 dwSize = rect.right / 2;
453
456
457 dwSize = 0;
458 pCurAdapter = NULL;
459 pAdapterInfo = NULL;
461 {
462 pAdapterInfo = static_cast<PIP_ADAPTER_INFO>(CoTaskMemAlloc(dwSize));
463 if (pAdapterInfo)
464 {
465 if (GetAdaptersInfo(pAdapterInfo, &dwSize) == NO_ERROR)
466 {
467 pCurAdapter = pAdapterInfo;
468 while (pCurAdapter && pCurAdapter->Index != pContext->dwAdapterIndex)
469 pCurAdapter = pCurAdapter->Next;
470
471 if (pCurAdapter->Index != pContext->dwAdapterIndex)
472 pCurAdapter = NULL;
473 }
474 }
475 }
476
477 ZeroMemory(&li, sizeof(LVITEMW));
478 li.mask = LVIF_TEXT;
479 li.iSubItem = 1;
480 li.pszText = szBuffer;
481
482 if (pCurAdapter)
483 {
485 if (li.iItem >= 0)
486 {
487 _swprintf(szBuffer, L"%02x-%02x-%02x-%02x-%02x-%02x",pCurAdapter->Address[0], pCurAdapter->Address[1],
488 pCurAdapter->Address[2], pCurAdapter->Address[3], pCurAdapter->Address[4], pCurAdapter->Address[5]);
489 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
490 }
491 li.iItem = InsertItemToListView(hDlgCtrl, IDS_IP_ADDRESS);
492 if (li.iItem >= 0)
493 if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->IpAddressList.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
494 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
495
496 li.iItem = InsertItemToListView(hDlgCtrl, IDS_SUBNET_MASK);
497 if (li.iItem >= 0)
498 if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->IpAddressList.IpMask.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
499 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
500
501 li.iItem = InsertItemToListView(hDlgCtrl, IDS_DEF_GATEWAY);
502 if (li.iItem >= 0 && pCurAdapter->GatewayList.IpAddress.String[0] != '0')
503 {
504 if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->GatewayList.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
505 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
506 }
507
508 li.iItem = InsertItemToListView(hDlgCtrl, IDS_DHCP_SERVER);
509 if (li.iItem >= 0 && pCurAdapter->DhcpServer.IpAddress.String[0] != '0')
510 {
511 if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->DhcpServer.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR)))
512 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
513 }
514
515 li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_OBTAINED);
516 if (li.iItem >= 0 && pCurAdapter->LeaseObtained != NULL)
517 {
518 struct tm *leaseOptained;
519
520 leaseOptained = localtime(&pCurAdapter->LeaseObtained);
521
522 if (tmToStr(leaseOptained, szBuffer, _countof(szBuffer)))
523 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
524 }
525
526 li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_EXPIRES);
527 if (li.iItem >= 0 && pCurAdapter->LeaseExpires != NULL)
528 {
529 struct tm *leaseExpire;
530
531 leaseExpire = localtime(&pCurAdapter->LeaseExpires);
532
533 if (tmToStr(leaseExpire, szBuffer, _countof(szBuffer)))
534 SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
535 }
536 }
537
538 dwSize = 0;
539 li.iItem = InsertItemToListView(hDlgCtrl, IDS_DNS_SERVERS);
541 {
542 pPerAdapter = static_cast<PIP_PER_ADAPTER_INFO>(CoTaskMemAlloc(dwSize));
543 if (pPerAdapter)
544 {
545 if (GetPerAdapterInfo(pContext->dwAdapterIndex, pPerAdapter, &dwSize) == ERROR_SUCCESS)
546 {
547 if (li.iItem >= 0)
548 AddIPAddressToListView(hDlgCtrl, &pPerAdapter->DnsServerList, li.iItem);
549 }
550 CoTaskMemFree(pPerAdapter);
551 }
552 }
553
554 if (pCurAdapter)
555 {
556 li.iItem = InsertItemToListView(hDlgCtrl, IDS_WINS_SERVERS);
557 if (pCurAdapter->HaveWins)
558 {
559 AddIPAddressToListView(hDlgCtrl, &pCurAdapter->PrimaryWinsServer, li.iItem);
560 AddIPAddressToListView(hDlgCtrl, &pCurAdapter->SecondaryWinsServer, li.iItem+1);
561 }
562 }
563
564 CoTaskMemFree(pAdapterInfo);
565 break;
566
567 case WM_COMMAND:
568 if (LOWORD(wParam) == IDCANCEL)
569 {
570 EndDialog(hwndDlg, FALSE);
571 break;
572 }
573 }
574
575 return FALSE;
576}
RECT rect
Definition: combotst.c:67
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDS_VALUE
Definition: resource.h:28
#define IDS_DNS_SERVERS
Definition: resource.h:128
#define IDS_DEF_GATEWAY
Definition: resource.h:124
#define IDS_IP_ADDRESS
Definition: resource.h:122
#define IDS_LEASE_EXPIRES
Definition: resource.h:127
#define IDS_DHCP_SERVER
Definition: resource.h:125
#define IDS_PHYSICAL_ADDRESS
Definition: resource.h:121
#define IDS_LEASE_OBTAINED
Definition: resource.h:126
#define IDS_SUBNET_MASK
Definition: resource.h:123
#define IDS_PROPERTY
Definition: resource.h:130
#define IDS_WINS_SERVERS
Definition: resource.h:129
static struct tm * localtime(const time_t *t)
Definition: time.h:121
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
static BOOL tmToStr(IN struct tm *pTM, OUT LPWSTR szBuffer, IN UINT nBufferSize)
static INT InsertItemToListView(HWND hDlgCtrl, UINT ResId)
static VOID AddIPAddressToListView(HWND hDlgCtrl, PIP_ADDR_STRING pAddr, INT Index)
static VOID InsertColumnToListView(HWND hDlgCtrl, UINT ResId, UINT SubItem, UINT Size)
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2731
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define _countof(array)
Definition: sndvol32.h:70
BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]
Definition: iptypes.h:47
IP_ADDR_STRING SecondaryWinsServer
Definition: iptypes.h:57
IP_ADDR_STRING DhcpServer
Definition: iptypes.h:54
time_t LeaseObtained
Definition: iptypes.h:58
time_t LeaseExpires
Definition: iptypes.h:59
IP_ADDR_STRING PrimaryWinsServer
Definition: iptypes.h:56
IP_ADDR_STRING DnsServerList
Definition: iptypes.h:66
LONG right
Definition: windef.h:108
#define IDCANCEL
Definition: winuser.h:842
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by LANStatusUiAdvancedDlg().

◆ LANStatusUiDlg()

INT_PTR CALLBACK LANStatusUiDlg ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 666 of file lanstatusui.cpp.

671{
673 LANSTATUSUI_CONTEXT * pContext;
674 LPPSHNOTIFY lppsn;
675
676 switch (uMsg)
677 {
678 case WM_INITDIALOG:
680 pContext = (LANSTATUSUI_CONTEXT*)page->lParam;
681 pContext->hwndDlg = hwndDlg;
682 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pContext);
683 InitializeLANStatusUiDlg(hwndDlg, pContext);
684 return TRUE;
685 case WM_DESTROY:
686 KillTimer(hwndDlg, NETTIMERID);
687 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
688 if (pContext)
689 pContext->hwndDlg = NULL;
690 break;
691 case WM_TIMER:
692 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
693 if (pContext)
694 UpdateLanStatus(pContext->hwndDlg, pContext);
695 break;
696 case WM_COMMAND:
697 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
699 {
700 if (pContext)
701 {
702 ShowNetConnectionProperties(pContext->pNet, GetParent(pContext->hwndDlg));
704 }
705 break;
706 }
707 else if (LOWORD(wParam) == IDC_ENDISABLE)
708 {
709 DisableNetworkAdapter(pContext->pNet, pContext, hwndDlg);
710 break;
711 }
712 case WM_NOTIFY:
713 lppsn = (LPPSHNOTIFY) lParam;
714 if (lppsn->hdr.code == PSN_APPLY || lppsn->hdr.code == PSN_RESET)
715 {
716 pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
718 pContext->hwndDlg = NULL;
719 return TRUE;
720 }
721 break;
722 }
723 return FALSE;
724}
#define IDC_STATUS_PROPERTIES
Definition: resource.h:42
#define IDC_ENDISABLE
Definition: resource.h:43
VOID InitializeLANStatusUiDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
VOID DisableNetworkAdapter(INetConnection *pNet, LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
#define PSN_APPLY
Definition: prsht.h:117
#define PSNRET_NOERROR
Definition: prsht.h:129
#define PSN_RESET
Definition: prsht.h:118
struct _PSHNOTIFY * LPPSHNOTIFY
#define WM_NOTIFY
Definition: richedit.h:61
NMHDR hdr
Definition: prsht.h:330
UINT code
Definition: winuser.h:3267
#define DWLP_MSGRESULT
Definition: winuser.h:881

Referenced by ShowStatusPropertyDialog().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 786 of file lanstatusui.cpp.

787{
788 // NOTE: This callback is needed to set large icon correctly.
789 HICON hIcon;
790 switch (uMsg)
791 {
792 case PSCB_INITIALIZED:
793 {
795 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
796 break;
797 }
798 }
799 return 0;
800}
#define IDI_NET_IDLE
Definition: resource.h:13
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444

Referenced by ShowStatusPropertyDialog().

◆ RefreshNetTaskbarNotificationIcon()

void RefreshNetTaskbarNotificationIcon ( )

Definition at line 1339 of file lanstatusui.cpp.

1340{
1342}
static BOOL CALLBACK RefreshNetTaskbarNotificationIconEnumProc(HWND hWnd, LPARAM lParam)
static void EnumNotificationIconWindows(WNDENUMPROC Func, LPARAM lParam=0)
Definition: lanstatusui.cpp:17

Referenced by CNetConnectionPropertyUi::LANPropertiesUIDlg().

◆ RefreshNetTaskbarNotificationIconEnumProc()

static BOOL CALLBACK RefreshNetTaskbarNotificationIconEnumProc ( HWND  hWnd,
LPARAM  lParam 
)
static

Definition at line 1330 of file lanstatusui.cpp.

1333{
1335 return TRUE;
1336}

Referenced by RefreshNetTaskbarNotificationIcon().

◆ RepairConnection()

HRESULT RepairConnection ( INetConnection pNet,
HWND  hwndOwner 
)

Definition at line 960 of file lanstatusui.cpp.

961{
963
964 return E_NOTIMPL;
965}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
#define SHELL_ErrorBox
Definition: shellutils.h:126
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

Referenced by LANStatusDlg().

◆ ShowNetworkIconContextMenu()

VOID ShowNetworkIconContextMenu ( _In_ HWND  hwndOwner,
_In_ LANSTATUSUI_CONTEXT pContext 
)

Definition at line 855 of file lanstatusui.cpp.

858{
859 if (!pContext || !pContext->pNet)
860 return;
861
862 HMENU hMenu = CreatePopupMenu();
863 if (!hMenu)
864 return;
865
866 POINT pt;
868
869 SetForegroundWindow(hwndOwner);
870
871 // The context menu items, set to their default values.
872 struct
873 {
874 UINT uID;
875 UINT uFlags;
876 UINT_PTR uIDNewItem;
877 } MenuItems[] =
878 {
882 {UINT_MAX, 0, 0}, // Separator
885 };
886
887 NETCON_PROPERTIES *pProps = NULL;
888 HRESULT hr = pContext->pNet->GetProperties(&pProps);
889 if (SUCCEEDED(hr) && pProps)
890 {
891 if (pProps->Status == NCS_HARDWARE_DISABLED ||
892 pProps->Status == NCS_MEDIA_DISCONNECTED ||
893 pProps->Status == NCS_DISCONNECTED)
894 {
895 MenuItems[0].uID = IDS_NET_ACTIVATE;
896 MenuItems[0].uFlags = MF_ENABLED | MFS_DEFAULT;
897 MenuItems[0].uIDNewItem = IDM_NETICON_ENABLE;
898 MenuItems[5].uFlags = MF_ENABLED;
899 }
900 else
901 {
902 MenuItems[0].uID = IDS_NET_DEACTIVATE;
903 MenuItems[0].uFlags = MF_ENABLED;
904 MenuItems[0].uIDNewItem = IDM_NETICON_DISABLE;
905 }
906
907 if (pProps->Status == NCS_CONNECTED)
908 {
909 MenuItems[1].uFlags = MF_ENABLED;
910 MenuItems[2].uFlags = MF_ENABLED;
911 }
912 else if (pProps->Status == NCS_CONNECTING)
913 {
914 MenuItems[1].uFlags = MF_ENABLED;
915 MenuItems[2].uFlags = MF_GRAYED;
916 }
917 else
918 {
919 MenuItems[1].uFlags = MF_GRAYED;
920 MenuItems[2].uFlags = MF_GRAYED;
921 }
922
924 pProps = NULL;
925 }
926 else
927 {
928 MenuItems[0].uFlags = MF_GRAYED;
929 MenuItems[1].uFlags = MF_GRAYED;
930 MenuItems[2].uFlags = MF_GRAYED;
931 MenuItems[5].uFlags = MF_GRAYED;
932 }
933
934 // Set the "Properties" item as default, if the Network "Enable/Disable" item isn't.
935 if (!(MenuItems[0].uFlags & MFS_DEFAULT))
936 MenuItems[5].uFlags |= MFS_DEFAULT;
937
938 WCHAR szMenuItem[128];
939
940 for (USHORT i = 0; i < _countof(MenuItems); ++i)
941 {
942 if (MenuItems[i].uID != UINT_MAX)
943 {
944 if (LoadStringW(netshell_hInstance, MenuItems[i].uID, szMenuItem, _countof(szMenuItem)))
945 AppendMenuW(hMenu, MF_STRING | MenuItems[i].uFlags, MenuItems[i].uIDNewItem, szMenuItem);
946 }
947 else
948 {
949 AppendMenuW(hMenu, MF_SEPARATOR, 0, NULL);
950 }
951 }
952
954
955 PostMessage(hwndOwner, WM_NULL, 0, 0);
956
957 DestroyMenu(hMenu);
958}
#define IDS_NET_STATUS
Definition: resource.h:105
#define IDS_NET_PROPERTIES
Definition: resource.h:110
#define IDS_NET_DEACTIVATE
Definition: resource.h:104
#define IDS_NET_OPEN_CONNECTIONS
Definition: resource.h:64
#define IDS_NET_REPAIR
Definition: resource.h:106
#define IDS_NET_ACTIVATE
Definition: resource.h:103
UINT uFlags
Definition: api.c:59
#define UINT_MAX
Definition: limits.h:27
#define pt(x, y)
Definition: drawing.c:79
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
@ NCS_HARDWARE_DISABLED
Definition: netcon.h:44
unsigned short USHORT
Definition: pedump.c:61
_In_ UINT uID
Definition: shlwapi.h:156
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define TPM_RIGHTBUTTON
Definition: winuser.h:2416
#define TPM_BOTTOMALIGN
Definition: winuser.h:2421
#define MF_STRING
Definition: winuser.h:138
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define MFS_DEFAULT
Definition: winuser.h:759
#define MF_ENABLED
Definition: winuser.h:128
#define MF_SEPARATOR
Definition: winuser.h:137
#define TPM_LEFTALIGN
Definition: winuser.h:2413
#define WM_NULL
Definition: winuser.h:1635
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_GRAYED
Definition: winuser.h:129

Referenced by LANStatusDlg().

◆ ShowStatusPropertyDialog()

VOID ShowStatusPropertyDialog ( LANSTATUSUI_CONTEXT pContext,
HWND  hwndDlg 
)

Definition at line 803 of file lanstatusui.cpp.

806{
807 HPROPSHEETPAGE hppages[2];
808 PROPSHEETHEADERW pinfo;
809 NETCON_PROPERTIES * pProperties = NULL;
810
811 ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
812 ZeroMemory(hppages, sizeof(hppages));
813 pinfo.dwSize = sizeof(PROPSHEETHEADERW);
814 pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
816 pinfo.phpage = hppages;
817 pinfo.hwndParent = hwndDlg;
821
822 if (pContext->pNet->GetProperties(&pProperties) == S_OK)
823 {
824 if (pProperties->pszwName)
825 {
826 pinfo.pszCaption = pProperties->pszwName;
827 pinfo.dwFlags |= PSH_PROPTITLE;
828 }
829 InitializePropertyDialog(pContext, pProperties);
830 if (pProperties->MediaType == NCM_LAN && pProperties->Status == NCS_CONNECTED)
831 {
833 if (hppages[0])
834 pinfo.nPages++;
835
837 if (hppages[pinfo.nPages])
838 pinfo.nPages++;
839
840 if (pinfo.nPages)
841 {
842 PropertySheetW(&pinfo);
843 }
844 }
845 else if (pProperties->Status == NCS_MEDIA_DISCONNECTED || pProperties->Status == NCS_DISCONNECTED ||
846 pProperties->Status == NCS_HARDWARE_DISABLED)
847 {
848 ShowNetConnectionProperties(pContext->pNet, pContext->hwndDlg);
849 }
850
851 NcFreeNetconProperties(pProperties);
852 }
853}
#define IDD_LAN_NETSTATUS
Definition: resource.h:24
#define IDD_LAN_NETSTATUSADVANCED
Definition: resource.h:26
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2950
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
INT_PTR CALLBACK LANStatusUiAdvancedDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK LANStatusUiDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID InitializePropertyDialog(LANSTATUSUI_CONTEXT *pContext, NETCON_PROPERTIES *pProperties)
@ NCM_LAN
Definition: netcon.h:71
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
Definition: netshell.cpp:29
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_USEICONID
Definition: prsht.h:42
struct _PROPSHEETHEADERW PROPSHEETHEADERW
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
LPCWSTR pszCaption
Definition: prsht.h:301
Definition: mmc.idl:376
NETCON_MEDIATYPE MediaType
Definition: netcon.h:87

Referenced by LANStatusDlg().

◆ tmToStr()

static BOOL tmToStr ( IN struct tm pTM,
OUT LPWSTR  szBuffer,
IN UINT  nBufferSize 
)
static

Definition at line 388 of file lanstatusui.cpp.

392{
393 SYSTEMTIME st;
394 CString strBufferDate;
395 CString strBufferTime;
396 UINT nCharDate, nCharTime;
397 BOOL bResult = FALSE;
398
399 st.wYear = pTM->tm_year + 1900;
400 st.wMonth = pTM->tm_mon + 1;
401 st.wDay = pTM->tm_mday;
402 st.wHour = pTM->tm_hour;
403 st.wMinute = pTM->tm_min;
404 st.wSecond = pTM->tm_sec;
405
406 /* Check required size before cpy/cat */
407 nCharDate = GetDateFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, NULL, 0) + 1;
408 nCharTime = GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, NULL, 0) + 1;
409
410 if (GetDateFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, strBufferDate.GetBuffer(nCharDate), nCharDate) &&
411 GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &st, NULL, strBufferTime.GetBuffer(nCharTime), nCharTime))
412 {
413 StringCbCopy(szBuffer, nBufferSize, strBufferDate);
414 StringCbCat(szBuffer, nBufferSize, L" ");
415 StringCbCat(szBuffer, nBufferSize, strBufferTime);
416 bResult = TRUE;
417 }
418 strBufferDate.ReleaseBuffer();
419 strBufferTime.ReleaseBuffer();
420
421 return bResult;
422}
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1101
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition: lcformat.c:1001
#define LOCALE_USER_DEFAULT
#define StringCbCat
Definition: strsafe.h:334
#define StringCbCopy
Definition: strsafe.h:155
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261

Referenced by LANStatusUiDetailsDlg().

◆ UpdateLanStatus()

static VOID UpdateLanStatus ( HWND  hwndDlg,
LANSTATUSUI_CONTEXT pContext 
)
static

Definition at line 185 of file lanstatusui.cpp.

186{
187 MIB_IFROW IfEntry;
188
189 ZeroMemory(&IfEntry, sizeof(IfEntry));
190 IfEntry.dwIndex = pContext->dwAdapterIndex;
191 if (GetIfEntry(&IfEntry) != NO_ERROR)
192 {
193 return;
194 }
195
196 if (pContext->Status == (UINT)-1)
197 {
198 /*
199 * On first execution, pContext->dw[In|Out]Octets will be zero while
200 * the interface info is already refreshed with non-null data, so a
201 * gap is normal and does not correspond to an effective TX or RX packet.
202 */
203 pContext->dwInOctets = IfEntry.dwInOctets;
204 pContext->dwOutOctets = IfEntry.dwOutOctets;
205 }
206
207 UINT IconRes = 0;
209 {
210 if (pContext->dwInOctets == IfEntry.dwInOctets && pContext->dwOutOctets == IfEntry.dwOutOctets && pContext->Status != 0)
211 {
212 IconRes = IDI_NET_IDLE;
213 pContext->Status = 0;
214 }
215 else if (pContext->dwInOctets != IfEntry.dwInOctets && pContext->dwOutOctets != IfEntry.dwOutOctets && pContext->Status != 1)
216 {
217 IconRes = IDI_NET_TRANSREC;
218 pContext->Status = 1;
219 }
220 else if (pContext->dwInOctets != IfEntry.dwInOctets && pContext->Status != 2)
221 {
222 IconRes = IDI_NET_REC;
223 pContext->Status = 2;
224 }
225 else if (pContext->dwOutOctets != IfEntry.dwOutOctets && pContext->Status != 3)
226 {
227 IconRes = IDI_NET_TRANS;
228 pContext->Status = 3;
229 }
230 }
232 {
233 if (pContext->Status != 4)
234 {
235 IconRes = IDI_NET_OFF;
236 pContext->Status = 4;
237 }
238 }
240 {
241 if (pContext->Status != 5)
242 {
243 IconRes = IDI_NET_OFF;
244 pContext->Status = 5;
245 }
246 }
247
248 if (hwndDlg && IconRes)
249 {
251 hBigIcon = (HICON)SendDlgItemMessageW(hwndDlg, IDC_NETSTAT, STM_SETICON, (WPARAM)hBigIcon, 0);
252 if (hBigIcon)
253 DestroyIcon(hBigIcon);
254 }
255
256 if (IconRes)
257 UpdateNotificationIcon(*pContext, IconRes);
258
259 pContext->dwInOctets = IfEntry.dwInOctets;
260 pContext->dwOutOctets = IfEntry.dwOutOctets;
261
262 if (hwndDlg)
263 UpdateLanStatusUiDlg(hwndDlg, &IfEntry, pContext);
264}
#define IDI_NET_TRANSREC
Definition: resource.h:17
#define IDI_NET_TRANS
Definition: resource.h:16
#define IDI_NET_OFF
Definition: resource.h:14
#define IDI_NET_REC
Definition: resource.h:15
#define IDC_NETSTAT
Definition: resource.h:47
DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
#define MIB_IF_OPER_STATUS_DISCONNECTED
Definition: ipifcons.h:248
#define MIB_IF_OPER_STATUS_CONNECTED
Definition: ipifcons.h:250
#define MIB_IF_OPER_STATUS_NON_OPERATIONAL
Definition: ipifcons.h:246
#define MIB_IF_OPER_STATUS_UNREACHABLE
Definition: ipifcons.h:247
#define MIB_IF_OPER_STATUS_OPERATIONAL
Definition: ipifcons.h:251
VOID UpdateLanStatusUiDlg(HWND hwndDlg, MIB_IFROW *IfEntry, LANSTATUSUI_CONTEXT *pContext)
Definition: lanstatusui.cpp:38
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
DWORD dwInOctets
Definition: ifmib.h:47
INTERNAL_IF_OPER_STATUS dwOperStatus
Definition: ifmib.h:45
DWORD dwOutOctets
Definition: ifmib.h:53
DWORD dwIndex
Definition: ifmib.h:38
#define STM_SETICON
Definition: winuser.h:2128
#define IMAGE_ICON
Definition: winuser.h:212
#define LR_SHARED
Definition: winuser.h:1111
#define LoadImage
Definition: winuser.h:5981
#define LR_DEFAULTSIZE
Definition: winuser.h:1105
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422

Referenced by InitializeLANStatusUiDlg(), LANStatusDlg(), and LANStatusUiDlg().

◆ UpdateLanStatusUiDlg()

VOID UpdateLanStatusUiDlg ( HWND  hwndDlg,
MIB_IFROW IfEntry,
LANSTATUSUI_CONTEXT pContext 
)

Definition at line 38 of file lanstatusui.cpp.

42{
43 WCHAR szFormat[MAX_PATH] = {0};
44 WCHAR szBuffer[MAX_PATH] = {0};
45 SYSTEMTIME TimeConnected;
46 DWORD DurationSeconds;
47 WCHAR Buffer[100];
48 WCHAR DayBuffer[30];
49 WCHAR LocBuffer[50];
50
51#if 0
52 ULONGLONG Ticks;
53#else
54 DWORD Ticks;
55#endif
56
57 if (IfEntry->dwSpeed < 1000)
58 {
59 if (LoadStringW(netshell_hInstance, IDS_FORMAT_BIT, szFormat, sizeof(szFormat)/sizeof(WCHAR)))
60 {
61 _swprintf(szBuffer, szFormat, IfEntry->dwSpeed);
62 SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer);
63 }
64 }
65 else if (IfEntry->dwSpeed < 1000000)
66 {
67 if (LoadStringW(netshell_hInstance, IDS_FORMAT_KBIT, szFormat, sizeof(szFormat)/sizeof(WCHAR)))
68 {
69 _swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000);
70 SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer);
71 }
72 }
73 else if (IfEntry->dwSpeed < 1000000000)
74 {
75 if (LoadStringW(netshell_hInstance, IDS_FORMAT_MBIT, szFormat, sizeof(szFormat)/sizeof(WCHAR)))
76 {
77 _swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000000);
78 SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer);
79 }
80 }
81 else
82 {
83 if (LoadStringW(netshell_hInstance, IDS_FORMAT_GBIT, szFormat, sizeof(szFormat)/sizeof(WCHAR)))
84 {
85 _swprintf(szBuffer, szFormat, IfEntry->dwSpeed/1000000000);
86 SendDlgItemMessageW(hwndDlg, IDC_SPEED, WM_SETTEXT, 0, (LPARAM)szBuffer);
87 }
88 }
89
90 if (StrFormatByteSizeW(IfEntry->dwInOctets, szBuffer, _countof(szBuffer)))
91 {
92 SendDlgItemMessageW(hwndDlg, IDC_RECEIVED, WM_SETTEXT, 0, (LPARAM)szBuffer);
93 }
94
95 if (StrFormatByteSizeW(IfEntry->dwOutOctets, szBuffer, _countof(szBuffer)))
96 {
97 SendDlgItemMessageW(hwndDlg, IDC_SEND, WM_SETTEXT, 0, (LPARAM)szBuffer);
98 }
99
100#if 0
101 Ticks = GetTickCount64();
102#else
103 Ticks = GetTickCount();
104#endif
105
106 DurationSeconds = Ticks / 1000;
107 TimeConnected.wSecond = (DurationSeconds % 60);
108 TimeConnected.wMinute = (DurationSeconds / 60) % 60;
109 TimeConnected.wHour = (DurationSeconds / (60 * 60)) % 24;
110 TimeConnected.wDay = DurationSeconds / (60 * 60 * 24);
111
112 if (!GetTimeFormatW(LOCALE_USER_DEFAULT, 0, &TimeConnected, L"HH':'mm':'ss", LocBuffer, sizeof(LocBuffer) / sizeof(LocBuffer[0])))
113 return;
114
115 if (!TimeConnected.wDay)
116 {
117 SendDlgItemMessageW(hwndDlg, IDC_DURATION, WM_SETTEXT, 0, (LPARAM)LocBuffer);
118 }
119 else
120 {
121 if (TimeConnected.wDay == 1)
122 {
123 if (!LoadStringW(netshell_hInstance, IDS_DURATION_DAY, DayBuffer, sizeof(DayBuffer) / sizeof(DayBuffer[0])))
124 DayBuffer[0] = L'\0';
125 }
126 else
127 {
128 if (!LoadStringW(netshell_hInstance, IDS_DURATION_DAYS, DayBuffer, sizeof(DayBuffer) / sizeof(DayBuffer[0])))
129 DayBuffer[0] = L'\0';
130 }
131 _swprintf(Buffer, DayBuffer, TimeConnected.wDay, LocBuffer);
133 }
134
135}
Definition: bufpool.h:45
#define IDC_SPEED
Definition: resource.h:46
#define IDC_DURATION
Definition: resource.h:45
#define IDS_FORMAT_BIT
Definition: resource.h:112
#define IDS_DURATION_DAY
Definition: resource.h:116
#define IDS_DURATION_DAYS
Definition: resource.h:117
#define IDC_SEND
Definition: resource.h:40
#define IDS_FORMAT_KBIT
Definition: resource.h:114
#define IDC_RECEIVED
Definition: resource.h:41
#define IDS_FORMAT_MBIT
Definition: resource.h:113
#define IDS_FORMAT_GBIT
Definition: resource.h:115
ULONGLONG WINAPI DECLSPEC_HOTPATCH GetTickCount64(void)
Definition: sync.c:192
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:854
DWORD dwSpeed
Definition: ifmib.h:41
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by UpdateLanStatus().

◆ UpdateNotificationIcon()

static VOID UpdateNotificationIcon ( LANSTATUSUI_CONTEXT ctx,
UINT  IconRes = 0 
)
static

Definition at line 138 of file lanstatusui.cpp.

139{
140 NETCON_PROPERTIES *pProps;
141 if (FAILED(ctx.pNet->GetProperties(&pProps)))
142 return;
143 if (!IconRes)
144 {
145 switch (pProps->Status)
146 {
147 case NCS_CONNECTING:
148 case NCS_CONNECTED:
151 IconRes = IDI_NET_IDLE;
152 break;
153 default:
154 IconRes = IDI_NET_OFF;
155 }
156 }
157
158 UINT IconSize = 32; // FIXME: DPI scaled 16px based on taskbar window or Shell_NotifyIconGetRect
160 nid.cbSize = sizeof(nid);
161 nid.uID = ctx.uID;
162 nid.hWnd = ctx.hwndStatusDlg;
163 nid.uVersion = NOTIFYICON_VERSION;
164 nid.uFlags = NIF_STATE;
165 nid.dwState = 0;
166 nid.dwStateMask = NIS_HIDDEN;
167 if (pProps->dwCharacter & NCCF_SHOW_ICON)
168 {
169 nid.uFlags |= NIF_TIP;
171
173 if (nid.hIcon)
175 }
176 else
177 {
178 nid.dwState |= NIS_HIDDEN;
179 }
182}
#define lstrcpynW
Definition: compat.h:738
@ NCS_AUTHENTICATION_SUCCEEDED
Definition: netcon.h:48
@ NCS_AUTHENTICATING
Definition: netcon.h:47
#define NIF_ICON
Definition: shellapi.h:106
#define NIF_TIP
Definition: shellapi.h:107
CHAR szTip[128]
Definition: shellapi.h:237

Referenced by ConfigureNotificationIconTimer(), and UpdateLanStatus().