X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1dc9f8394c1488ad8e7d945e6f943f7b34554ce..69659fd770f615210efac4b4fa741b3ad6223616:/src/msw/taskbar.cpp?ds=sidebyside diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 8bc91d1d2f..0a6277803f 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -17,6 +17,8 @@ #pragma hdrstop #endif +#if wxUSE_TASKBARICON + #ifndef WX_PRECOMP #include "wx/window.h" #include "wx/frame.h" @@ -143,10 +145,11 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) notifyData.hIcon = GetHiconOf(icon); } + // set NIF_TIP even for an empty tooltip: otherwise it would be impossible + // to remove an existing tooltip using this function + notifyData.uFlags |= NIF_TIP; if ( !tooltip.empty() ) { - notifyData.uFlags |= NIF_TIP; -// lstrcpyn(notifyData.szTip, tooltip.c_str(), WXSIZEOF(notifyData.szTip)); wxStrncpy(notifyData.szTip, tooltip.c_str(), WXSIZEOF(notifyData.szTip)); } @@ -171,6 +174,7 @@ bool wxTaskBarIcon::RemoveIcon() return Shell_NotifyIcon(NIM_DELETE, ¬ifyData) != 0; } +#if wxUSE_MENUS bool wxTaskBarIcon::PopupMenu(wxMenu *menu) { wxASSERT_MSG( m_win != NULL, _T("taskbar icon not initialized") ); @@ -206,6 +210,7 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) return rval; } +#endif // wxUSE_MENUS void wxTaskBarIcon::RegisterWindowMessages() { @@ -285,3 +290,6 @@ long wxTaskBarIcon::WindowProc(unsigned int msg, return 0; } + +#endif // wxUSE_TASKBARICON +