ReactOS 0.4.17-dev-804-g023d8af
lanstatusui.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Shell
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: CLanStatus: Lan connection status dialog
5 * COPYRIGHT: Copyright 2008 Johannes Anderwald (johannes.anderwald@reactos.org)
6 */
7
8#include "precomp.h"
9
10#include <winsock.h>
11
12#define NETTIMERID 0xFABC
13#define NETTIMERINTERVAL 1000
14#define WPARAM_MAGIC MAKELONG(MAKEWORD('L', 'S'), MAKEWORD('T', 'I')) // "LanStatusTrayIcon" (Arbitrary)
15
16static void
19 LPARAM lParam = 0)
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}
30
32 m_lpNetMan(NULL),
33 m_pHead(NULL)
34{
35}
36
37VOID
39 HWND hwndDlg,
40 MIB_IFROW *IfEntry,
41 LANSTATUSUI_CONTEXT *pContext)
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}
136
137static VOID
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}
183
184static VOID
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}
265
266
267VOID
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}
298
299static
300VOID
302 HWND hDlgCtrl,
303 UINT ResId,
304 UINT SubItem,
305 UINT Size)
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}
323
324static
325VOID
327 HWND hDlgCtrl,
329 INT Index)
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}
365
366static
367INT
369 HWND hDlgCtrl,
370 UINT ResId)
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}
385
386static
387BOOL
389 IN struct tm *pTM,
390 OUT LPWSTR szBuffer,
391 IN UINT nBufferSize)
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}
423
427 HWND hwndDlg,
428 UINT uMsg,
431)
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}
577
581 HWND hwndDlg,
582 UINT uMsg,
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}
641
642VOID
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}
662
663
667 HWND hwndDlg,
668 UINT uMsg,
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}
725
726VOID
728 LANSTATUSUI_CONTEXT * pContext,
729 NETCON_PROPERTIES * pProperties)
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}
784
785static int CALLBACK
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}
801
802VOID
804 LANSTATUSUI_CONTEXT *pContext,
805 HWND hwndDlg)
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}
854
856 _In_ HWND hwndOwner,
857 _In_ LANSTATUSUI_CONTEXT *pContext)
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}
959
961{
963
964 return E_NOTIMPL;
965}
966
967static void
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}
989
993 HWND hwndDlg,
994 UINT uMsg,
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}
1127
1128HRESULT
1130{
1132 HWND hwndDlg;
1136 NETCON_PROPERTIES* pProps;
1137 HRESULT hr;
1138 ULONG Count;
1139 ULONG Index;
1140 NOTIFICATION_ITEM * pItem, *pLast = NULL;
1141 LANSTATUSUI_CONTEXT * pContext;
1142
1143 TRACE("InitializeNetTaskbarNotifications\n");
1144
1145 if (m_pHead)
1146 {
1147 pItem = m_pHead;
1148 while (pItem)
1149 {
1150 hr = pItem->pNet->GetProperties(&pProps);
1151 if (SUCCEEDED(hr))
1152 {
1153 ZeroMemory(&nid, sizeof(nid));
1154 nid.cbSize = sizeof(nid);
1155 nid.uID = pItem->uID;
1156 nid.hWnd = pItem->hwndDlg;
1157 nid.uFlags = NIF_STATE;
1158 if (pProps->dwCharacter & NCCF_SHOW_ICON)
1159 nid.dwState = 0;
1160 else
1161 nid.dwState = NIS_HIDDEN;
1162
1163 nid.dwStateMask = NIS_HIDDEN;
1165 NcFreeNetconProperties(pProps);
1166 }
1167 pItem = pItem->pNext;
1168 }
1169 return S_OK;
1170 }
1171 /* get an instance to of IConnectionManager */
1172 hr = CNetConnectionManager_CreateInstance(IID_PPV_ARG(INetConnectionManager, &pNetConMan));
1174 return hr;
1175
1176 hr = pNetConMan->EnumConnections(NCME_DEFAULT, &pEnumCon);
1178 return hr;
1179
1180 Index = 1;
1181 while (TRUE)
1182 {
1183 pNetCon.Release();
1184 hr = pEnumCon->Next(1, &pNetCon, &Count);
1185 if (hr != S_OK)
1186 break;
1187
1188 TRACE("new connection\n");
1189 pItem = static_cast<NOTIFICATION_ITEM*>(CoTaskMemAlloc(sizeof(NOTIFICATION_ITEM)));
1190 if (!pItem)
1191 break;
1192
1193 pContext = static_cast<LANSTATUSUI_CONTEXT*>(CoTaskMemAlloc(sizeof(LANSTATUSUI_CONTEXT)));
1194 if (!pContext)
1195 {
1196 CoTaskMemFree(pItem);
1197 break;
1198 }
1199
1200 ZeroMemory(pContext, sizeof(LANSTATUSUI_CONTEXT));
1201 pContext->uID = Index;
1202 pContext->pNet = pNetCon;
1203 pContext->Status = -1;
1204 pContext->dwAdapterIndex = Index;
1205 pItem->uID = Index;
1206 pItem->pNext = NULL;
1207 pItem->pNet = pNetCon;
1208 pItem->pNet->AddRef();
1210 if (!hwndDlg)
1211 {
1212 ERR("CreateDialogParamW failed\n");
1213 continue;
1214 }
1215
1216 ZeroMemory(&nid, sizeof(nid));
1217 nid.cbSize = sizeof(nid);
1218 nid.uID = Index++;
1220 nid.uVersion = NOTIFYICON_VERSION;
1222 nid.hWnd = hwndDlg;
1223
1224 hr = pNetCon->GetProperties(&pProps);
1225 if (SUCCEEDED(hr))
1226 {
1227 CopyMemory(&pItem->guidItem, &pProps->guidId, sizeof(GUID));
1228 if (!(pProps->dwCharacter & NCCF_SHOW_ICON))
1229 {
1230 nid.dwState = NIS_HIDDEN;
1231 nid.dwStateMask = NIS_HIDDEN;
1232 nid.uFlags |= NIF_STATE;
1233 }
1234 if (pProps->Status == NCS_MEDIA_DISCONNECTED || pProps->Status == NCS_DISCONNECTED || pProps->Status == NCS_HARDWARE_DISABLED)
1236 else if (pProps->Status == NCS_CONNECTED)
1238
1239 if (nid.hIcon)
1240 nid.uFlags |= NIF_ICON;
1241
1242 wcscpy(nid.szTip, pProps->pszwName);
1243 nid.uFlags |= NIF_TIP;
1244 NcFreeNetconProperties(pProps);
1245 }
1246 pContext->hwndStatusDlg = hwndDlg;
1247 pItem->hwndDlg = hwndDlg;
1248
1250 {
1251 if (pLast)
1252 pLast->pNext = pItem;
1253 else
1254 m_pHead = pItem;
1255
1256 pLast = pItem;
1257 Index++;
1258 }
1259 else
1260 {
1261 ERR("Shell_NotifyIconW failed\n");
1262 CoTaskMemFree(pItem);
1263 }
1264
1265 if (nid.uFlags & NIF_ICON)
1267 }
1268
1269 m_lpNetMan = pNetConMan;
1270 return S_OK;
1271}
1272
1273HRESULT
1275{
1276 NOTIFICATION_ITEM *pItem;
1277
1278 pItem = m_pHead;
1279 while (pItem)
1280 {
1281 if (IsEqualGUID(pItem->guidItem, *pguidCmdGroup))
1282 {
1284 return S_OK;
1285 }
1286 pItem = pItem->pNext;
1287 }
1288
1289 ERR("not found\n");
1290 return E_FAIL;
1291}
1292
1293HRESULT
1294WINAPI
1296 const GUID *pguidCmdGroup,
1297 ULONG cCmds,
1298 OLECMD *prgCmds,
1299 OLECMDTEXT *pCmdText)
1300{
1301 MessageBoxW(NULL, pCmdText->rgwz, L"IOleCommandTarget_fnQueryStatus", MB_OK);
1302 return E_NOTIMPL;
1303}
1304
1305HRESULT
1306WINAPI
1308 const GUID *pguidCmdGroup,
1309 DWORD nCmdID,
1310 DWORD nCmdexecopt,
1311 VARIANT *pvaIn,
1312 VARIANT *pvaOut)
1313{
1314 if (pguidCmdGroup)
1315 {
1316 if (IsEqualGUID(*pguidCmdGroup, CGID_ShellServiceObject))
1317 {
1319 }
1320 else
1321 {
1322 /* invoke status dialog */
1323 return ShowStatusDialogByCLSID(pguidCmdGroup);
1324 }
1325 }
1326 return S_OK;
1327}
1328
1329static BOOL CALLBACK
1331 HWND hWnd,
1332 LPARAM lParam)
1333{
1335 return TRUE;
1336}
1337
1338void
1340{
1342}
#define IID_PPV_ARG(Itype, ppType)
HWND hWnd
Definition: settings.c:17
#define IDC_DETAILS
Definition: resource.h:18
#define ERR(fmt,...)
Definition: precomp.h:57
void Release()
Definition: atlcomcli.h:170
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
Definition: bufpool.h:45
HRESULT InitializeNetTaskbarNotifications()
CComPtr< INetConnectionManager > m_lpNetMan
Definition: lanstatusui.h:51
NOTIFICATION_ITEM * m_pHead
Definition: lanstatusui.h:52
STDMETHOD() Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
HRESULT ShowStatusDialogByCLSID(const GUID *pguidCmdGroup)
STDMETHOD() QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT *pCmdText) override
RECT rect
Definition: combotst.c:67
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL GetAdapterIndexFromNetCfgInstanceId(PIP_ADAPTER_INFO pAdapterInfo, LPWSTR szNetCfg, PDWORD pIndex)
HRESULT WINAPI CNetConnectionManager_CreateInstance(REFIID riid, LPVOID *ppv)
#define NO_ERROR
Definition: dderror.h:5
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
HRESULT hr
Definition: delayimp.cpp:582
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_VALUE
Definition: resource.h:28
#define IDD_LAN_NETSTATUSDETAILS
Definition: resource.h:27
#define IDD_STATUS
Definition: resource.h:25
#define IDS_DNS_SERVERS
Definition: resource.h:128
#define TRAYICONWINDOWCAPTIONW
Definition: resource.h:4
#define IDC_SPEED
Definition: resource.h:46
#define IDI_NET_TRANSREC
Definition: resource.h:17
#define IDS_NET_STATUS
Definition: resource.h:105
#define IDS_NET_PROPERTIES
Definition: resource.h:110
#define IDC_DURATION
Definition: resource.h:45
#define IDD_LAN_NETSTATUS
Definition: resource.h:24
#define IDS_FORMAT_BIT
Definition: resource.h:112
#define IDM_NETICON_ENABLE
Definition: resource.h:57
#define IDC_DETAILSTYPE
Definition: resource.h:49
#define IDS_NET_DEACTIVATE
Definition: resource.h:104
#define IDM_NETICON_DISABLE
Definition: resource.h:58
#define IDC_STATUS_PROPERTIES
Definition: resource.h:42
#define IDI_NET_TRANS
Definition: resource.h:16
#define IDS_STATUS_CONNECTED
Definition: resource.h:100
#define IDC_DETAILSGATEWAY
Definition: resource.h:52
#define IDC_STATUS
Definition: resource.h:44
#define IDS_ASSIGNED_MANUAL
Definition: resource.h:119
#define IDS_DEF_GATEWAY
Definition: resource.h:124
#define IDM_NETICON_PROPERTIES
Definition: resource.h:62
#define IDS_DURATION_DAY
Definition: resource.h:116
#define IDS_NET_OPEN_CONNECTIONS
Definition: resource.h:64
#define IDI_NET_OFF
Definition: resource.h:14
#define IDC_DETAILSIP
Definition: resource.h:50
#define IDI_NET_REC
Definition: resource.h:15
#define IDS_DURATION_DAYS
Definition: resource.h:117
#define IDD_LAN_NETSTATUSADVANCED
Definition: resource.h:26
#define IDC_NETSTAT
Definition: resource.h:47
#define IDS_ASSIGNED_DHCP
Definition: resource.h:118
#define IDS_NET_REPAIR
Definition: resource.h:106
#define IDC_DETAILSSUBNET
Definition: resource.h:51
#define IDS_IP_ADDRESS
Definition: resource.h:122
#define IDS_LEASE_EXPIRES
Definition: resource.h:127
#define IDC_SEND
Definition: resource.h:40
#define IDS_DHCP_SERVER
Definition: resource.h:125
#define IDM_NETICON_STATUS
Definition: resource.h:59
#define IDS_PHYSICAL_ADDRESS
Definition: resource.h:121
#define IDS_FORMAT_KBIT
Definition: resource.h:114
#define IDM_NETICON_REPAIR
Definition: resource.h:60
#define IDS_NET_ACTIVATE
Definition: resource.h:103
#define IDS_LEASE_OBTAINED
Definition: resource.h:126
#define IDS_SUBNET_MASK
Definition: resource.h:123
#define IDC_RECEIVED
Definition: resource.h:41
#define IDS_STATUS_DISCONNECTED
Definition: resource.h:98
#define IDS_PROPERTY
Definition: resource.h:130
#define IDI_NET_IDLE
Definition: resource.h:13
#define IDC_ENDISABLE
Definition: resource.h:43
#define IDM_NETICON_OPEN_CONNECTIONS
Definition: resource.h:61
#define IDS_FORMAT_MBIT
Definition: resource.h:113
#define IDS_WINS_SERVERS
Definition: resource.h:129
#define IDS_FORMAT_GBIT
Definition: resource.h:115
#define IDS_STATUS_UNREACHABLE
Definition: resource.h:97
#define IDS_STATUS_CONNECTING
Definition: resource.h:99
UINT uFlags
Definition: api.c:59
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
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2950
#define CP_ACP
Definition: compat.h:109
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrcpynW
Definition: compat.h:738
ULONGLONG WINAPI DECLSPEC_HOTPATCH GetTickCount64(void)
Definition: sync.c:192
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define UINT_MAX
Definition: limits.h:27
static struct tm * localtime(const time_t *t)
Definition: time.h:121
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:854
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
#define pt(x, y)
Definition: drawing.c:79
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
SINGLE_LIST_ENTRY * pCur
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235
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
unsigned int UINT
Definition: sysinfo.c:13
HRESULT Connect()
HRESULT Disconnect()
HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps)
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
#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
static BOOL tmToStr(IN struct tm *pTM, OUT LPWSTR szBuffer, IN UINT nBufferSize)
VOID ShowStatusPropertyDialog(LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
VOID InitializeLANStatusUiDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
INT_PTR CALLBACK LANStatusUiDetailsDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define NETTIMERID
Definition: lanstatusui.cpp:12
VOID UpdateLanStatusUiDlg(HWND hwndDlg, MIB_IFROW *IfEntry, LANSTATUSUI_CONTEXT *pContext)
Definition: lanstatusui.cpp:38
static INT InsertItemToListView(HWND hDlgCtrl, UINT ResId)
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
INT_PTR CALLBACK LANStatusUiAdvancedDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static BOOL CALLBACK RefreshNetTaskbarNotificationIconEnumProc(HWND hWnd, LPARAM lParam)
static VOID UpdateNotificationIcon(LANSTATUSUI_CONTEXT &ctx, UINT IconRes=0)
#define WPARAM_MAGIC
Definition: lanstatusui.cpp:14
static VOID AddIPAddressToListView(HWND hDlgCtrl, PIP_ADDR_STRING pAddr, INT Index)
INT_PTR CALLBACK LANStatusUiDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID InsertColumnToListView(HWND hDlgCtrl, UINT ResId, UINT SubItem, UINT Size)
INT_PTR CALLBACK LANStatusDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID DisableNetworkAdapter(INetConnection *pNet, LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
static void ConfigureNotificationIconTimer(LANSTATUSUI_CONTEXT &ctx)
VOID InitializePropertyDialog(LANSTATUSUI_CONTEXT *pContext, NETCON_PROPERTIES *pProperties)
static void EnumNotificationIconWindows(WNDENUMPROC Func, LPARAM lParam=0)
Definition: lanstatusui.cpp:17
static VOID UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
void RefreshNetTaskbarNotificationIcon()
#define NETTIMERINTERVAL
Definition: lanstatusui.cpp:13
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
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
NOTIFYICONDATA nid
Definition: magnifier.c:44
#define ZeroMemory
Definition: minwinbase.h:31
#define CopyMemory
Definition: minwinbase.h:29
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
#define ntohl(x)
Definition: module.h:205
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
static HICON
Definition: imagelist.c:80
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
@ NCCF_SHOW_ICON
Definition: netcon.h:20
@ NCS_CONNECTING
Definition: netcon.h:40
@ NCS_MEDIA_DISCONNECTED
Definition: netcon.h:46
@ NCS_CONNECTED
Definition: netcon.h:41
@ NCS_AUTHENTICATION_SUCCEEDED
Definition: netcon.h:48
@ NCS_DISCONNECTED
Definition: netcon.h:39
@ NCS_HARDWARE_DISABLED
Definition: netcon.h:44
@ NCS_AUTHENTICATING
Definition: netcon.h:47
@ NCM_LAN
Definition: netcon.h:71
@ NCME_DEFAULT
Definition: netcon.h:10
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
Definition: netshell.cpp:29
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
#define _In_
Definition: no_sal2.h:158
int Count
Definition: noreturn.cpp:7
#define LOCALE_USER_DEFAULT
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
#define PSBTN_CANCEL
Definition: prsht.h:151
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSN_APPLY
Definition: prsht.h:117
#define PSNRET_NOERROR
Definition: prsht.h:129
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
struct _PROPSHEETHEADERW PROPSHEETHEADERW
#define PSN_RESET
Definition: prsht.h:118
struct _PSHNOTIFY * LPPSHNOTIFY
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
#define PROPSHEETPAGE
Definition: prsht.h:389
#define FOURTH_IPADDRESS(x)
Definition: commctrl.h:4496
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2731
#define FIRST_IPADDRESS(x)
Definition: commctrl.h:4493
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVM_SETITEMW
Definition: commctrl.h:2402
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2312
#define SECOND_IPADDRESS(x)
Definition: commctrl.h:4494
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2637
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVCF_FMT
Definition: commctrl.h:2591
#define THIRD_IPADDRESS(x)
Definition: commctrl.h:4495
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVM_INSERTITEMW
Definition: commctrl.h:2409
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LV_COLUMN
Definition: commctrl.h:2552
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ UINT uID
Definition: shlwapi.h:156
void(* Func)(int)
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
wcscpy
#define LoadStringW
Definition: utils.h:64
#define memset(x, y, z)
Definition: compat.h:39
#define NIM_MODIFY
Definition: shellapi.h:95
#define NIF_ICON
Definition: shellapi.h:106
#define NIF_MESSAGE
Definition: shellapi.h:105
#define NIM_ADD
Definition: shellapi.h:94
#define NIF_TIP
Definition: shellapi.h:107
#define SHELL_ErrorBox
Definition: shellutils.h:126
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 _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
#define StringCbCat
Definition: strsafe.h:334
#define StringCbCopy
Definition: strsafe.h:155
char String[4 *4]
Definition: iptypes.h:31
INetConnection * pNet
Definition: lanstatusui.h:20
BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]
Definition: iptypes.h:47
struct _IP_ADAPTER_INFO * Next
Definition: iptypes.h:42
IP_ADDR_STRING SecondaryWinsServer
Definition: iptypes.h:57
IP_ADDR_STRING IpAddressList
Definition: iptypes.h:52
IP_ADDR_STRING DhcpServer
Definition: iptypes.h:54
time_t LeaseObtained
Definition: iptypes.h:58
IP_ADDR_STRING GatewayList
Definition: iptypes.h:53
time_t LeaseExpires
Definition: iptypes.h:59
IP_ADDR_STRING PrimaryWinsServer
Definition: iptypes.h:56
UINT DhcpEnabled
Definition: iptypes.h:50
IP_ADDRESS_STRING IpAddress
Definition: iptypes.h:36
IP_MASK_STRING IpMask
Definition: iptypes.h:37
IP_ADDR_STRING DnsServerList
Definition: iptypes.h:66
DWORD dwSpeed
Definition: ifmib.h:41
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
UINT uCallbackMessage
Definition: shellapi.h:231
DWORD dwStateMask
Definition: shellapi.h:239
CHAR szTip[128]
Definition: shellapi.h:237
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
NMHDR hdr
Definition: prsht.h:330
Definition: mmc.idl:376
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:641
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261
Definition: module.h:576
int cchTextMax
Definition: commctrl.h:2573
LPWSTR pszText
Definition: commctrl.h:2572
NETCON_STATUS Status
Definition: netcon.h:86
NETCON_MEDIATYPE MediaType
Definition: netcon.h:87
UINT code
Definition: winuser.h:3267
struct tagNotificationItem * pNext
Definition: lanstatusui.h:11
INetConnection * pNet
Definition: lanstatusui.h:15
LONG right
Definition: windef.h:108
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
Definition: systray.cpp:128
#define ICON_BIG
Definition: tnclass.cpp:51
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
uint16_t * LPWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58
uint64_t ULONGLONG
Definition: typedefs.h:67
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
#define WINAPI
Definition: msvc.h:6
u_long WINAPI inet_addr(const char *str)
Definition: wine.c:35
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define SW_SHOWNORMAL
Definition: winuser.h:781
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define DWLP_USER
Definition: winuser.h:883
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define STM_SETICON
Definition: winuser.h:2128
#define IDCANCEL
Definition: winuser.h:842
#define IMAGE_ICON
Definition: winuser.h:212
#define TPM_RIGHTBUTTON
Definition: winuser.h:2416
#define WM_COMMAND
Definition: winuser.h:1768
#define TPM_BOTTOMALIGN
Definition: winuser.h:2421
#define MF_STRING
Definition: winuser.h:138
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
#define WM_RBUTTONUP
Definition: winuser.h:1808
#define WM_INITDIALOG
Definition: winuser.h:1767
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MFS_DEFAULT
Definition: winuser.h:759
#define WM_SETTEXT
Definition: winuser.h:1645
HWND WINAPI FindWindowExW(_In_opt_ HWND, _In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define MF_ENABLED
Definition: winuser.h:128
#define MF_SEPARATOR
Definition: winuser.h:137
#define WM_TIMER
Definition: winuser.h:1770
#define TPM_LEFTALIGN
Definition: winuser.h:2413
#define LoadIcon
Definition: winuser.h:5979
#define WM_NULL
Definition: winuser.h:1635
#define LR_SHARED
Definition: winuser.h:1111
#define MB_OK
Definition: winuser.h:801
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define PostMessage
Definition: winuser.h:5998
HWND WINAPI GetParent(_In_ HWND)
#define LoadImage
Definition: winuser.h:5981
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define SW_RESTORE
Definition: winuser.h:790
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1637
#define LR_DEFAULTSIZE
Definition: winuser.h:1105
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
BOOL(CALLBACK * WNDENUMPROC)(HWND, LPARAM)
Definition: winuser.h:3016
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444
BOOL WINAPI BringWindowToTop(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422
#define MF_GRAYED
Definition: winuser.h:129