Index: dll/shellext/netshell/CMakeLists.txt =================================================================== --- dll/shellext/netshell/CMakeLists.txt (revision 74275) +++ dll/shellext/netshell/CMakeLists.txt (working copy) @@ -36,6 +36,6 @@ set_module_type(netshell win32dll) target_link_libraries(netshell uuid wine) -add_importlibs(netshell shlwapi shell32 version iphlpapi ole32 gdi32 user32 advapi32 setupapi ws2_32 comctl32 msvcrt kernel32 ntdll) +add_importlibs(netshell shlwapi shell32 version iphlpapi ole32 gdi32 user32 advapi32 setupapi ws2_32 comctl32 msvcrt kernel32 kernel32_vista ntdll) add_pch(netshell precomp.h SOURCE) add_cd_file(TARGET netshell DESTINATION reactos/system32 FOR all) Index: dll/shellext/netshell/lang/en-US.rc =================================================================== --- dll/shellext/netshell/lang/en-US.rc (revision 74275) +++ dll/shellext/netshell/lang/en-US.rc (working copy) @@ -1,5 +1,17 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +IDR_POPUP MENUEX +BEGIN + POPUP "popup" + BEGIN + MENUITEM "&Disable", IDC_ENDISABLE + MENUITEM "&Status", IDM_STATUS + MENUITEM "Re&pair", IDC_REPAIR + MENUITEM SEPARATOR + MENUITEM "&Open Network Connections", IDM_OPEN_NETWORK + END +END + IDD_NETPROPERTIES DIALOGEX 0, 0, 246, 246 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION CAPTION "General" @@ -6,16 +18,16 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_COMPONENTSLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 9, 71, 230, 55 - LTEXT "Connect Using:", -1, 9, 9, 217, 8 + LTEXT "Connect Using:", IDC_STATIC, 9, 9, 217, 8 EDITTEXT IDC_NETCARDNAME, 9, 21, 230, 12, WS_BORDER | WS_TABSTOP | ES_READONLY PUSHBUTTON "&Configure", IDC_CONFIGURE, 189, 38, 50, 14 - LTEXT "Components checked are used by this connection:", -1, 9, 59, 217, 8 + LTEXT "Components checked are used by this connection:", IDC_STATIC, 9, 59, 217, 8 PUSHBUTTON "&Install", IDC_INSTALL, 9, 130, 65, 14, WS_DISABLED | WS_TABSTOP PUSHBUTTON "&Uninstall", IDC_UNINSTALL, 90, 130, 65, 14, WS_DISABLED | WS_TABSTOP PUSHBUTTON "&Properties", IDC_PROPERTIES, 174, 130, 65, 14 - GROUPBOX "Description", -1, 9, 153, 230, 46, BS_GROUPBOX + GROUPBOX "Description", IDC_STATIC, 9, 153, 230, 46, BS_GROUPBOX LTEXT "Component Description goes here...", IDC_DESCRIPTION, 15, 165, 217, 28, WS_GROUP - CHECKBOX "&Show Icon in taskbar when connected", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Show icon in taskbar when connected", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP CHECKBOX "&Notify me when this connection has limited or no connectivity", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP END @@ -26,54 +38,55 @@ BEGIN END -IDD_LAN_NETSTATUS DIALOGEX 0, 0, 200, 180 +IDD_LAN_NETSTATUS DIALOGEX 0, 0, 200, 150 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Connection", -1, 9, 8, 182, 58, BS_GROUPBOX - LTEXT "Status:", -1, 19, 20, 60, 8 - LTEXT "Duration:", -1, 19, 34, 60, 8 - LTEXT "Speed:", -1, 19, 48, 60, 8 - GROUPBOX "Activity", -1, 9, 74, 182, 70, BS_GROUPBOX - RTEXT "Sent", -1, 26, 90, 60, 8 - ICON "", IDC_NETSTAT, 110, 85, 32, 32 - LTEXT "Received", -1, 149, 90, 37, 8 - LTEXT "Bytes:", -1, 17, 115, 32, 8 - RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 - RTEXT "000.000.000", IDC_RECEIVED, 139, 115, 44, 8 - PUSHBUTTON "&Properties", IDC_STATUS_PROPERTIES, 10, 150, 50, 14 - PUSHBUTTON "&Disable", IDC_ENDISABLE, 66, 150, 50, 14 - RTEXT "", IDC_STATUS, 83, 20, 98, 8 - RTEXT "", IDC_DURATION, 83, 34, 98, 8 - RTEXT "", IDC_SPEED, 83, 48, 98, 8 + GROUPBOX "Connection", IDC_STATIC, 5, 5, 195, 58, BS_GROUPBOX + LTEXT "Status:", IDC_STATIC, 19, 15, 60, 8 + LTEXT "Duration:", IDC_STATIC, 19, 25, 60, 8 + LTEXT "Speed:", IDC_STATIC, 19, 35, 60, 8 + GROUPBOX "Activity", IDC_STATIC, 5, 65, 195, 58, BS_GROUPBOX + RTEXT "Sent", IDC_STATIC, 26, 85, 60, 8 + ICON "", IDC_NETSTAT, 110, 75, 32, 32 + LTEXT "Received", IDC_STATIC, 149, 85, 37, 8 + LTEXT "Bytes:", IDC_STATIC, 17, 105, 32, 8 + RTEXT "000.000.000", IDC_SEND, 63, 105, 44, 8 + RTEXT "000.000.000", IDC_RECEIVED, 139, 105, 44, 8 + PUSHBUTTON "&Properties", IDC_STATUS_PROPERTIES, 10, 130, 50, 14 + PUSHBUTTON "&Disable", IDC_ENDISABLE, 66, 130, 50, 14 + RTEXT "", IDC_STATUS, 88, 15, 98, 8 + RTEXT "", IDC_DURATION, 88, 25, 98, 8 + RTEXT "", IDC_SPEED, 88, 35, 98, 8 END -IDD_LAN_NETSTATUSADVANCED DIALOGEX 0, 0, 200, 180 +IDD_LAN_NETSTATUSADVANCED DIALOGEX 0, 0, 200, 150 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Support" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Connection Status", -1, 9, 8, 190, 88, BS_GROUPBOX - LTEXT "Address type:", -1, 22, 20, 80, 8 - LTEXT "IP Address:", -1, 22, 34, 80, 8 - LTEXT "Subnet Mask:", -1, 22, 48, 80, 8 - LTEXT "Default Gateway:", -1, 22, 62, 80, 8 + GROUPBOX "Connection Status", IDC_STATIC, 9, 8, 190, 88, BS_GROUPBOX + LTEXT "Address type:", IDC_STATIC, 22, 20, 80, 8 + LTEXT "IPv4 Address:", IDC_STATIC, 22, 34, 80, 8 + LTEXT "IPv4 Subnet Mask:", IDC_STATIC, 22, 48, 80, 8 + LTEXT "IPv4 Default Gateway:", IDC_STATIC, 22, 62, 80, 8 RTEXT "N/A", IDC_DETAILSTYPE, 112, 20, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSIP, 112, 34, 80, 8 RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 112, 48, 80, 8 RTEXT "", IDC_DETAILSGATEWAY, 112, 62, 80, 8 - PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 + PUSHBUTTON "&Details...", IDC_DETAILS, 132, 76, 62, 14 + PUSHBUTTON "&Repair", IDC_REPAIR, 9, 100, 62, 14, WS_DISABLED END -IDD_LAN_NETSTATUSDETAILS DIALOGEX 0, 0, 190, 175 +IDD_LAN_NETSTATUSDETAILS DIALOGEX 0, 0, 190, 170 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | DS_MODALFRAME CAPTION "Network Connection Details" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Network Connection &Details:", -1, 10, 4, 170, 12 - CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 10, 15, 170, 130 - PUSHBUTTON "&Close", IDC_CLOSE, 120, 155, 60, 14 + LTEXT "Network Connection &Details:", -1, 5, 5, 170, 12 + CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | WS_CHILD | WS_BORDER | WS_TABSTOP, 5, 15, 180, 130 + PUSHBUTTON "&Close", IDC_CLOSE, 125, 150, 60, 14 END IDD_NETWORKSETTINGSPAGE DIALOGEX 0, 0, 317, 143 @@ -121,14 +134,14 @@ STRINGTABLE BEGIN IDS_PHYSICAL_ADDRESS "Physical Address" - IDS_IP_ADDRESS "IP Address" - IDS_SUBNET_MASK "Subnet Mask" - IDS_DEF_GATEWAY "Default Gateway" - IDS_DHCP_SERVER "DHCP Server" + IDS_IP_ADDRESS "IPv4 Address" + IDS_SUBNET_MASK "IPv4 Subnet Mask" + IDS_DEF_GATEWAY "IPv4 Default Gateway" + IDS_DHCP_SERVER "IPv4 DHCP Server" IDS_LEASE_OBTAINED "Lease Obtained" IDS_LEASE_EXPIRES "Lease Expires" - IDS_DNS_SERVERS "DNS Servers" - IDS_WINS_SERVERS "WINS Servers" + IDS_DNS_SERVERS "IPv4 DNS Servers" + IDS_WINS_SERVERS "IPv4 WINS Server" IDS_PROPERTY "Property" IDS_VALUE "Value" IDS_NETWORKCONNECTION "Network Connections" @@ -173,4 +186,6 @@ IDS_NETWORKDOMAINSUBTITLE "A domain is a group of computers defined by a network administrator. A workgroup is a group of computers sharing the same workgroup name." IDS_REACTOS_SETUP "ReactOS Setup" IDS_WZD_DOMAIN_NAME "Setup cannot continue until you\nenter the name of your domain\nor workgroup." + IDS_ERROR_NETWORK_FOLDER "Error loading Network Connections dialog." + IDS_ERROR_CAPTION "Network Shell Error" END Index: dll/shellext/netshell/lanstatusui.cpp =================================================================== --- dll/shellext/netshell/lanstatusui.cpp (revision 74275) +++ dll/shellext/netshell/lanstatusui.cpp (working copy) @@ -65,6 +65,18 @@ { } +#if 0 +VOID WINAPI StartNCW(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) +{ + //... +} + +VOID WINAPI RepairConnection(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) +{ + //... +} +#endif + VOID UpdateLanStatusUiDlg( HWND hwndDlg, @@ -79,11 +91,7 @@ WCHAR DayBuffer[30]; WCHAR LocBuffer[50]; -#if 0 ULONGLONG Ticks; -#else - DWORD Ticks; -#endif if (IfEntry->dwSpeed < 1000) { @@ -128,11 +136,7 @@ SendDlgItemMessageW(hwndDlg, IDC_SEND, WM_SETTEXT, 0, (LPARAM)szBuffer); } -#if 0 Ticks = GetTickCount64(); -#else - Ticks = GetTickCount(); -#endif DurationSeconds = Ticks / 1000; TimeConnected.wSecond = (DurationSeconds % 60); @@ -287,7 +291,6 @@ UpdateLanStatusUiDlg(hwndDlg, &IfEntry, pContext); } - VOID InitializeLANStatusUiDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext) { @@ -430,6 +433,10 @@ hDlgCtrl = GetDlgItem(hwndDlg, IDC_DETAILS); + /* Highlights the entire row instead of just the selected item in the first column. + This increases readability on the selected item in the list. */ + SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); + /* get client rect */ GetClientRect(hDlgCtrl, &rect); @@ -489,13 +496,39 @@ if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->GatewayList.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); } -#if 0 + + li.iItem = InsertItemToListView(hDlgCtrl, IDS_DHCP_SERVER); + if (li.iItem >= 0 && pCurAdapter->DhcpServer.IpAddress.String[0] != '0') + { + if (MultiByteToWideChar(CP_ACP, 0, pCurAdapter->DhcpServer.IpAddress.String, -1, szBuffer, sizeof(szBuffer)/sizeof(WCHAR))) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + } + li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_OBTAINED); + if (li.iItem >= 0 && pCurAdapter->LeaseObtained != NULL) + { + struct tm *leaseOptained; + + leaseOptained = localtime(&pCurAdapter->LeaseObtained); + + if(wcsftime(szBuffer, 100, L"%m/%d/%Y %H:%M:%S %p", leaseOptained) != 0) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + } + li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_EXPIRES); -#endif + if (li.iItem >= 0 && pCurAdapter->LeaseExpires != NULL) + { + struct tm *leaseExpire; + + leaseExpire = localtime(&pCurAdapter->LeaseExpires); + + if(wcsftime(szBuffer, 100, L"%m/%d/%Y %H:%M:%S %p", leaseExpire) != 0) + SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li); + } } dwSize = 0; + li.iItem = InsertItemToListView(hDlgCtrl, IDS_DNS_SERVERS); if (GetPerAdapterInfo(pContext->dwAdapterIndex, NULL, &dwSize) == ERROR_BUFFER_OVERFLOW) { pPerAdapter = static_cast(CoTaskMemAlloc(dwSize)); @@ -503,7 +536,6 @@ { if (GetPerAdapterInfo(pContext->dwAdapterIndex, pPerAdapter, &dwSize) == ERROR_SUCCESS) { - li.iItem = InsertItemToListView(hDlgCtrl, IDS_DNS_SERVERS); if (li.iItem >= 0) AddIPAddressToListView(hDlgCtrl, &pPerAdapter->DnsServerList, li.iItem); } @@ -510,14 +542,17 @@ CoTaskMemFree(pPerAdapter); } } -#if 0 + if (pCurAdapter) { li.iItem = InsertItemToListView(hDlgCtrl, IDS_WINS_SERVERS); - AddIPAddressToListView(hDlgCtrl, &pCurAdapter->PrimaryWinsServer, li.iItem); - AddIPAddressToListView(hDlgCtrl, &pCurAdapter->SecondaryWinsServer, li.iItem+1); + if (pCurAdapter->HaveWins) + { + AddIPAddressToListView(hDlgCtrl, &pCurAdapter->PrimaryWinsServer, li.iItem); + AddIPAddressToListView(hDlgCtrl, &pCurAdapter->SecondaryWinsServer, li.iItem+1); + } } -#endif + CoTaskMemFree(pAdapterInfo); break; case WM_COMMAND: @@ -751,7 +786,7 @@ LPARAM lParam) { PROPSHEETPAGE *page; - LANSTATUSUI_CONTEXT * pContext; + LANSTATUSUI_CONTEXT *pContext; LPPSHNOTIFY lppsn; switch (uMsg) @@ -910,14 +945,19 @@ LPARAM lParam) { LANSTATUSUI_CONTEXT * pContext; + static HMENU hRightPopupMenu; switch (uMsg) { case WM_INITDIALOG: + { pContext = (LANSTATUSUI_CONTEXT *)lParam; SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam); pContext->nIDEvent = SetTimer(hwndDlg, 0xFABC, 1000, NULL); + + hRightPopupMenu = GetSubMenu(LoadMenu(netshell_hInstance, MAKEINTRESOURCE(IDR_POPUP)), 0); return TRUE; + } case WM_TIMER: pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER); if (wParam == (WPARAM)pContext->nIDEvent) @@ -926,24 +966,87 @@ } break; case WM_SHOWSTATUSDLG: - if (LOWORD(lParam) == WM_LBUTTONDOWN) + { + pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER); + if (!pContext) + break; + + switch (lParam) { - pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER); - if (!pContext) + case WM_RBUTTONUP: + + { + POINT pt; + + GetCursorPos(&pt); + SetForegroundWindow(hwndDlg); + + TrackPopupMenu(hRightPopupMenu, 0, pt.x, pt.y, 0, hwndDlg, NULL); break; + } + case WM_LBUTTONUP: + { + if (pContext->hwndDlg) + { + ShowWindow(GetParent(pContext->hwndDlg), SW_SHOW); + BringWindowToTop(GetParent(pContext->hwndDlg)); + } + else + { + ShowStatusPropertyDialog(pContext, hwndDlg); + } + break; + } + } + break; + } + case WM_COMMAND: + { + pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER); + if (!pContext) + break; - if (pContext->hwndDlg) + switch (LOWORD(wParam)) + { + case IDM_OPEN_NETWORK: { - ShowWindow(GetParent(pContext->hwndDlg), SW_SHOW); - BringWindowToTop(GetParent(pContext->hwndDlg)); + if(ShellExecuteW(NULL, L"open", L"explorer.exe", + L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}", + NULL, SW_SHOWDEFAULT) == 0) + { + WCHAR Buffer[100], Caption[100]; + + LoadStringW(netshell_hInstance, IDS_ERROR_NETWORK_FOLDER, Buffer, sizeof(Buffer)/sizeof(WCHAR)); + LoadStringW(netshell_hInstance, IDS_ERROR_CAPTION, Caption, sizeof(Caption)/sizeof(WCHAR)); + + MessageBoxW(hwndDlg, Buffer, Caption, MB_OK); + } + return 0; } - else + case IDC_ENDISABLE: { - ShowStatusPropertyDialog(pContext, hwndDlg); + DisableNetworkAdapter(pContext->pNet, pContext, hwndDlg); + break; } - break; + case IDM_STATUS: + { + if (pContext->hwndDlg) + { + ShowWindow(GetParent(pContext->hwndDlg), SW_SHOW); + BringWindowToTop(GetParent(pContext->hwndDlg)); + } + else + { + ShowStatusPropertyDialog(pContext, hwndDlg); + } + break; + } + case IDM_REPAIR: + { + return 0; + } } - break; + } } return FALSE; } @@ -1214,4 +1317,3 @@ return ((CLanStatus*)pCachedLanStatus)->QueryInterface(riid, ppv); } - Index: dll/shellext/netshell/netshell.spec =================================================================== --- dll/shellext/netshell/netshell.spec (revision 74275) +++ dll/shellext/netshell/netshell.spec (working copy) @@ -30,5 +30,5 @@ 29 stub NetSetupSetProgressCallback 30 stub NormalizeExtendedStatus 31 stub RaiseSupportDialog -32 stub RepairConnection -33 stub StartNCW +32 stub RepairConnection ;(ptr ptr str long) +33 stub StartNCW ;(ptr ptr str long) Index: dll/shellext/netshell/resource.h =================================================================== --- dll/shellext/netshell/resource.h (revision 74275) +++ dll/shellext/netshell/resource.h (working copy) @@ -16,6 +16,13 @@ #define IDC_STATIC -1 +/* Menus */ +#define IDR_POPUP 200 +#define IDM_DISABLE 201 +#define IDM_STATUS 202 +#define IDM_REPAIR 203 +#define IDM_OPEN_NETWORK 204 + /* dialogs */ #define IDD_NETPROPERTIES 400 #define IDD_LAN_NETSTATUS 401 @@ -48,6 +55,7 @@ #define IDC_DETAILSSUBNET 1202 #define IDC_DETAILSGATEWAY 1203 #define IDC_DETAILS 1204 +#define IDC_REPAIR 1205 #define IDC_CLOSE 1300 @@ -123,5 +131,7 @@ #define IDS_NETWORKDOMAINSUBTITLE 13055 #define IDS_REACTOS_SETUP 13456 #define IDS_WZD_DOMAIN_NAME 13457 +#define IDS_ERROR_NETWORK_FOLDER 13458 +#define IDS_ERROR_CAPTION 13459 #define IDR_NETSHELL 20000