]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/taskbar.cpp
fix another logical/physical coords confusion and update the comment to help with...
[wxWidgets.git] / src / msw / taskbar.cpp
index 83aef42cde8cb73f565a636a90ecffa0c8dd6b8b..856b6c1911bec6c5d1a2fb35ef1109586bfb52a2 100644 (file)
     #define NIN_BALLOONUSERCLICK    0x0405
 #endif
 
+#ifndef NIM_SETVERSION
+    #define NIM_SETVERSION  0x00000004
+#endif
+
+#ifndef NIF_INFO
+    #define NIF_INFO        0x00000010
+#endif
+
+
 // initialized on demand
 static UINT gs_msgTaskbar = 0;
 static UINT gs_msgRestartTaskbar = 0;
@@ -188,7 +197,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
     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
@@ -200,6 +209,8 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
     return ok;
 }
 
+#if wxUSE_TASKBARICON_BALLOONS
+
 bool
 wxTaskBarIcon::ShowBalloon(const wxString& title,
                            const wxString& text,
@@ -224,8 +235,8 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
     notifyData = NotifyIconData(hwnd);
     notifyData.uFlags |= NIF_INFO;
     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 )
@@ -238,6 +249,8 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
     return wxShellNotifyIcon(NIM_MODIFY, &notifyData) != 0;
 }
 
+#endif // wxUSE_TASKBARICON_BALLOONS
+
 bool wxTaskBarIcon::RemoveIcon()
 {
     if (!m_iconAdded)