When I tried to compile on Windows under Mozilla makefile environment, I got compilation error that certain members of the notifyicondata structure are not defined. Looking at the code, it should been taken care of. Upon closer inspection, it looks like macro like NOTIFYICONDATAW_V2_SIZE are also only conditionally defined in the Windows headers depending on the version we are compiling. Hence the patch simplifies the code, eliminates the error and does things more correctly, in my opinion.

changeset: 5167:d5e7d1dfbdbf
branch: minimizetotray
user: Sunil Mohan Adapa <sunil@synovel.com>
date: Fri Feb 19 18:27:39 2010 +0530
summary: Eliminate compile error dealing with nofityicondata

diff --git a/collab/extensions/minimizetotray/source/windows/trayToolkit.cpp b/collab/extensions/minimizetotray/source/windows/trayToolkit.cpp
--- a/collab/extensions/minimizetotray/source/windows/trayToolkit.cpp
+++ b/collab/extensions/minimizetotray/source/windows/trayToolkit.cpp
@@ -83,40 +83,22 @@
NOTIFYICONDATAA data;

int version = 0;



- // try to figure out which version of NOTIFYICONDATA the client is using

- if (NOTIFYICONDATAW_V1_SIZE == lpdata->cbSize) {

- data.cbSize = NOTIFYICONDATAA_V1_SIZE;

- version = 1;

- } else if (NOTIFYICONDATAW_V2_SIZE == lpdata->cbSize) {

- data.cbSize = NOTIFYICONDATAA_V2_SIZE;

- version = 2;

- } else if (sizeof(NOTIFYICONDATAW) == lpdata->cbSize) {

- data.cbSize = sizeof(NOTIFYICONDATAA);

- version = 3;

- } else {

- ::SetLastError( E_NOTIMPL);

- return FALSE;

- }

-

- // now copy the data over (note that everything falls through)

- switch (version) {

-#if _MSC_VER >= 1300

- case 3:

+ // now copy the data over

+#if (NTDDI_VERSION >= NTDDI_WINXP)

data.guidItem = lpdata->guidItem;

- case 2:

+#endif

+#if (NTDDI_VERSION >= NTDDI_WIN2K)

data.dwState = lpdata->dwState;

data.dwStateMask = lpdata->dwStateMask;

ConvertWtoA(lpdata->szInfoTitle, sizeof(data.szInfoTitle), data.szInfoTitle);

data.dwInfoFlags = lpdata->dwInfoFlags;

#endif

- case 1:

- data.hWnd = lpdata->hWnd;

- data.uID = lpdata->uID;

- data.uFlags = lpdata->uFlags;

- data.uCallbackMessage = lpdata->uCallbackMessage;

- data.hIcon = lpdata->hIcon;

- ConvertWtoA(lpdata->szTip, sizeof(data.szTip), data.szTip);

- }

+ data.hWnd = lpdata->hWnd;

+ data.uID = lpdata->uID;

+ data.uFlags = lpdata->uFlags;

+ data.uCallbackMessage = lpdata->uCallbackMessage;

+ data.hIcon = lpdata->hIcon;

+ ConvertWtoA(lpdata->szTip, sizeof(data.szTip), data.szTip);



return ::Shell_NotifyIconA(dwMessage, &data);

}