From 6b9c6296db295e4ed366cd294b2ec8f5e51c8d26 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Mon, 3 Nov 2008 22:13:24 +0000 Subject: [PATCH] - Apply changes to Hide / Show Network Notification setting on exit svn path=/trunk/; revision=37179 --- reactos/dll/win32/netshell/lanconnectui.c | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/netshell/lanconnectui.c b/reactos/dll/win32/netshell/lanconnectui.c index 4c9b41ed149..34d3c6a02c8 100644 --- a/reactos/dll/win32/netshell/lanconnectui.c +++ b/reactos/dll/win32/netshell/lanconnectui.c @@ -307,7 +307,11 @@ LANPropertiesUIDlg( PNET_ITEM pItem; INetConnectionPropertyUiImpl * This; LPPSHNOTIFY lppsn; + DWORD dwShowIcon; HRESULT hr; + WCHAR szKey[200]; + LPOLESTR pStr; + HKEY hKey; switch(uMsg) { @@ -326,14 +330,31 @@ LANPropertiesUIDlg( if (This->pNCfg) { hr = INetCfg_Apply(This->pNCfg); - if (SUCCEEDED(hr)) - return PSNRET_NOERROR; - else + if (FAILED(hr)) return PSNRET_INVALID; } + + if (SendDlgItemMessageW(hwndDlg, IDC_SHOWTASKBAR, BM_GETCHECK, 0, 0) == BST_CHECKED) + dwShowIcon = 1; + else + dwShowIcon = 0; + + + if (StringFromCLSID(&This->pProperties->guidId, &pStr) == ERROR_SUCCESS) + { + swprintf(szKey, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr); + CoTaskMemFree(pStr); + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS) + { + RegSetValueExW(hKey, L"ShowIcon", 0, REG_DWORD, (LPBYTE)&dwShowIcon, sizeof(DWORD)); + RegCloseKey(hKey); + } + } + return PSNRET_NOERROR; } - else if (lppsn->hdr.code == PSN_APPLY) +#if 0 + else if (lppsn->hdr.code == PSN_CANCEL) { This = (INetConnectionPropertyUiImpl*)GetWindowLongPtr(hwndDlg, DWLP_USER); if (This->pNCfg) @@ -346,6 +367,7 @@ LANPropertiesUIDlg( } return PSNRET_NOERROR; } +#endif if (lppl->hdr.code == LVN_ITEMCHANGING) { ZeroMemory(&li, sizeof(li));