- Fix several bugs in icon changing code

svn path=/trunk/; revision=36296
This commit is contained in:
Johannes Anderwald 2008-09-17 22:21:04 +00:00
parent 48dac13bd4
commit 245ddb9f52

View file

@ -151,12 +151,12 @@ UpdateLanStatusUIDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext)
pContext->Status = 1; pContext->Status = 1;
hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_TRANSREC)); hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_TRANSREC));
} }
else if (pContext->dwInOctets == IfEntry.dwInOctets && pContext->Status != 2) else if (pContext->dwInOctets != IfEntry.dwInOctets && pContext->Status != 2)
{ {
hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_REC)); hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_REC));
pContext->Status = 2; pContext->Status = 2;
} }
else if (pContext->dwOutOctets == IfEntry.dwOutOctets && pContext->Status != 3) else if (pContext->dwOutOctets != IfEntry.dwOutOctets && pContext->Status != 3)
{ {
hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_TRANS)); hIcon = LoadIcon(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_TRANS));
pContext->Status = 3; pContext->Status = 3;
@ -246,6 +246,8 @@ InitializeLANStatusUiDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext)
} }
CoTaskMemFree(pStr); CoTaskMemFree(pStr);
pContext->dwAdapterIndex = dwAdapterIndex; pContext->dwAdapterIndex = dwAdapterIndex;
pContext->dwInOctets = 0;
pContext->dwOutOctets = 0;
/* update adapter info */ /* update adapter info */
pContext->Status = -1; pContext->Status = -1;