notifyData.uFlags |= NIF_TIP;
if ( !tooltip.empty() )
{
- wxStrncpy(notifyData.szTip, tooltip.wx_str(), WXSIZEOF(notifyData.szTip));
+ wxStrlcpy(notifyData.szTip, tooltip.wx_str(), WXSIZEOF(notifyData.szTip));
}
bool ok = wxShellNotifyIcon(m_iconAdded ? NIM_MODIFY
return ok;
}
+#if wxUSE_TASKBARICON_BALLOONS
+
bool
wxTaskBarIcon::ShowBalloon(const wxString& title,
const wxString& text,
// the balloon disappearance
NotifyIconData notifyData(hwnd);
notifyData.uFlags = 0;
-#if (WINVER >= 0x0500)
notifyData.uVersion = 3 /* NOTIFYICON_VERSION for Windows XP */;
-#endif
wxShellNotifyIcon(NIM_SETVERSION, ¬ifyData);
// do show the balloon now
notifyData = NotifyIconData(hwnd);
notifyData.uFlags |= NIF_INFO;
-#if (WINVER >= 0x0500)
notifyData.uTimeout = msec;
- wxStrncpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo));
- wxStrncpy(notifyData.szInfoTitle, title.wx_str(),
+ wxStrlcpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo));
+ wxStrlcpy(notifyData.szInfoTitle, title.wx_str(),
WXSIZEOF(notifyData.szInfoTitle));
if ( flags & wxICON_INFORMATION )
notifyData.dwInfoFlags |= NIIF_WARNING;
else if ( flags & wxICON_ERROR )
notifyData.dwInfoFlags |= NIIF_ERROR;
-#endif
return wxShellNotifyIcon(NIM_MODIFY, ¬ifyData) != 0;
}
+#endif // wxUSE_TASKBARICON_BALLOONS
+
bool wxTaskBarIcon::RemoveIcon()
{
if (!m_iconAdded)