- SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]), (LPARAM) OldText);
- if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || 0 != wcscmp(OldText, szStatusText))
+ DWORD len = wcslen(szStatusText) * sizeof(WCHAR);
+ PWSTR buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
+
+ if (buf)
+ {
+ /* beautify our url for display purposes */
+ InternetCanonicalizeUrl(szStatusText, buf, &len, ICU_DECODE | ICU_NO_ENCODE);
+
+ /* paste it into our dialog, free the temp buffer
+ and don't do it again in this instance */
+ SendMessageW(Item, WM_SETTEXT, 0, (LPARAM)buf);
+ HeapFree(GetProcessHeap(), 0, buf);
+ }
+ else