Author: dquintana
Date: Wed Dec 16 12:36:33 2015
New Revision: 70360
URL:
http://svn.reactos.org/svn/reactos?rev=70360&view=rev
Log:
[SHELL32]
Apply patch by Mark Jansen (learn_more) with a few tweaks. Fixes calls to
Shell_NotifyIconA such as those from VBoxTray.
CORE-10497 #resolve
Modified:
trunk/reactos/dll/win32/shell32/systray.cpp
Modified: trunk/reactos/dll/win32/shell32/systray.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/systray.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/systray.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/systray.cpp [iso-8859-1] Wed Dec 16 12:36:33 2015
@@ -63,6 +63,7 @@
*/
BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid)
{
+ NOTIFYICONDATAW nidW;
DWORD cbSize;
/* Validate the cbSize as Windows XP does */
@@ -77,7 +78,37 @@
else
cbSize = pnid->cbSize;
- return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, cbSize, FALSE);
+ ZeroMemory(&nidW, sizeof(nidW));
+ nidW.cbSize = sizeof(nidW);
+ nidW.hWnd = pnid->hWnd;
+ nidW.uID = pnid->uID;
+ nidW.uFlags = pnid->uFlags;
+ nidW.uCallbackMessage = pnid->uCallbackMessage;
+ nidW.hIcon = pnid->hIcon;
+
+ /* szTip */
+ if (pnid->uFlags & NIF_TIP)
+ MultiByteToWideChar(CP_ACP, 0, pnid->szTip, -1, nidW.szTip,
_countof(nidW.szTip));
+
+ if (cbSize >= NOTIFYICONDATAA_V2_SIZE)
+ {
+ nidW.dwState = pnid->dwState;
+ nidW.dwStateMask = pnid->dwStateMask;
+
+ /* szInfo, szInfoTitle */
+ if (pnid->uFlags & NIF_INFO)
+ {
+ MultiByteToWideChar(CP_ACP, 0, pnid->szInfo, -1, nidW.szInfo,
_countof(nidW.szTip));
+ MultiByteToWideChar(CP_ACP, 0, pnid->szInfoTitle, -1, nidW.szInfoTitle,
_countof(nidW.szTip));
+ }
+
+ nidW.uTimeout = pnid->uTimeout;
+ nidW.dwInfoFlags = pnid->dwInfoFlags;
+ }
+
+ if (cbSize >= sizeof(NOTIFYICONDATAA))
+ nidW.hBalloonIcon = pnid->hBalloonIcon;
+ return Shell_NotifyIconW(dwMessage, &nidW);
}
/*************************************************************************