From 3fc79a4b4c6e15ef2fb97f8e8a661a1288db6faf Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 31 Oct 2008 13:48:13 +0000 Subject: [PATCH] Win32 TrayIcon i18n fix git-svn-id: svn://ultimatepp.org/upp/trunk@583 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/TrayIconWin32.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/uppsrc/CtrlLib/TrayIconWin32.cpp b/uppsrc/CtrlLib/TrayIconWin32.cpp index d19615e6a..59a70e66e 100644 --- a/uppsrc/CtrlLib/TrayIconWin32.cpp +++ b/uppsrc/CtrlLib/TrayIconWin32.cpp @@ -54,8 +54,9 @@ void TrayIcon::Notify(dword msg) if(nid.icon) DestroyIcon(nid.icon); nid.icon = IconWin32(icon); - int len = min(tip.GetLength(), 60); - memcpy(nid.tip, tip, len); + String stip = ToSystemCharset(tip); + int len = min(stip.GetLength(), 60); + memcpy(nid.tip, stip, len); nid.tip[len] = 0; VERIFY(Shell_NotifyIcon(msg, (NOTIFYICONDATA *)&nid)); } @@ -68,11 +69,13 @@ void TrayIcon::Message(int type, const char *title, const char *text, int timeou nid.flags = 0x10; *nid.info = *nid.title = 0; if(text) { - memcpy(nid.info, text, min((int)strlen(text), 255) + 1); + String h = ToSystemCharset(text); + memcpy(nid.info, h, min(h.GetLength(), 255) + 1); nid.info[255] = 0; } if(title) { - memcpy(nid.title, title, min((int)strlen(title), 63) + 1); + String h = ToSystemCharset(title); + memcpy(nid.title, h, min(h.GetLength(), 63) + 1); nid.title[63] = 0; } nid.infoflags = type;