Commit in reactos/subsys/system/explorer on MAIN
Makefile.MinGW+1-11.16 -> 1.17
Makefile.Wine+1-11.9 -> 1.10
explorer.dsp+9-91.50 -> 1.51
doc/TODO.txt-11.36 -> 1.37
taskbar/traynotify.cpp+97-151.37 -> 1.38
       /traynotify.h+10-21.14 -> 1.15
+118-29
6 modified files
tool tip texts for notification icons

reactos/subsys/system/explorer
Makefile.MinGW 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- Makefile.MinGW	12 Mar 2004 21:12:27 -0000	1.16
+++ Makefile.MinGW	14 Mar 2004 16:39:27 -0000	1.17
@@ -8,7 +8,7 @@
 CXX = g++
 LINK = g++
 
-CFLAGS	= -DWIN32 -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -fexceptions -Wall
+CFLAGS	= -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -fexceptions -Wall
 RCFLAGS	= -DWIN32 -D__WINDRES__
 LFLAGS	= -Wl,--subsystem,windows
 

reactos/subsys/system/explorer
Makefile.Wine 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- Makefile.Wine	7 Feb 2004 15:00:28 -0000	1.9
+++ Makefile.Wine	14 Mar 2004 16:39:27 -0000	1.10
@@ -5,7 +5,7 @@
 MODULE    = explorer.exe
 APPMODE   = gui
 IMPORTS   = shell32 comctl32 ole32 user32 gdi32 kernel32 advapi32 oleaut32
-EXTRADEFS = -D__WINE__ -D_WIN32_IE=0x0501 -D_WIN32_WINNT=0x0501 -D__MINGW32__
+EXTRADEFS = -D__WINE__ -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -D__MINGW32__
 #EXTRA_OBJS = explorer_intres.res
 EXTRALIBS = $(LIBUUID)
 

reactos/subsys/system/explorer
explorer.dsp 1.50 -> 1.51
diff -u -r1.50 -r1.51
--- explorer.dsp	12 Mar 2004 21:12:27 -0000	1.50
+++ explorer.dsp	14 Mar 2004 16:39:27 -0000	1.51
@@ -49,7 +49,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /O1 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O1 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /YX /FD /c
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
 # ADD RSC /l 0x407 /d "NDEBUG"
 BSC32=bscmake.exe
@@ -74,7 +74,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x407 /d "_DEBUG"
 # ADD RSC /l 0x407 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -100,7 +100,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_ROS_" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /YX /FD /c
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
 # ADD RSC /l 0x407 /d "NDEBUG"
 BSC32=bscmake.exe
@@ -126,7 +126,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /YX /FD /c
 # ADD BASE RSC /l 0x407 /d "NDEBUG"
 # ADD RSC /l 0x407 /d "NDEBUG"
 BSC32=bscmake.exe
@@ -152,7 +152,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "UNICODE" /D "_ROS_" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x407 /d "_DEBUG"
 # ADD RSC /l 0x407 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -178,7 +178,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_ROS_" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "_NO_COMUTIL" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "_NO_COMUTIL" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x407 /d "_DEBUG"
 # ADD RSC /l 0x407 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -205,7 +205,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_ROS_" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x407 /d "_DEBUG"
 # ADD RSC /l 0x407 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -232,7 +232,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /D "_DEBUG" /D "UNICODE" /D "WIN32" /D "_ROS_" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MT /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FD /c
+# ADD CPP /nologo /MT /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FD /c
 # ADD BASE RSC /l 0x407 /d "_DEBUG"
 # ADD RSC /l 0x407 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -259,7 +259,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D "_ROS_" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FD /c
-# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0501 /D _WIN32_WINNT=0x0501 /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D _WIN32_IE=0x0600 /D _WIN32_WINNT=0x0501 /FD /c
 # ADD BASE RSC /l 0x407 /d "_DEBUG"
 # ADD RSC /l 0x407 /d "_DEBUG"
 BSC32=bscmake.exe

reactos/subsys/system/explorer/doc
TODO.txt 1.36 -> 1.37
diff -u -r1.36 -r1.37
--- TODO.txt	14 Mar 2004 14:44:23 -0000	1.36
+++ TODO.txt	14 Mar 2004 16:39:28 -0000	1.37
@@ -1,5 +1,4 @@
 - read "DESCRIPT.ION" files to display file descriptions
-- tool tip texts for notification icons
 - hiding of notification icons
 - context menus for quick launch bar
 - detect display mode changes and adjust desktop bar size

reactos/subsys/system/explorer/taskbar
traynotify.cpp 1.37 -> 1.38
diff -u -r1.37 -r1.38
--- traynotify.cpp	14 Mar 2004 14:44:23 -0000	1.37
+++ traynotify.cpp	14 Mar 2004 16:39:28 -0000	1.38
@@ -57,6 +57,7 @@
 	_hIcon = 0;
 	_dwState = 0;
 	_uCallbackMessage = 0;
+	_version = 0;
 }
 
 
@@ -77,22 +78,37 @@
 		_hIcon = (HICON) CopyImage(pnid->hIcon, IMAGE_ICON, 16, 16, 0);
 	}
 
-#ifdef NIF_STATE	// currently (as of 21.08.2003) missing in MinGW headers
+#ifdef NIF_STATE	// as of 21.08.2003 missing in MinGW headers
 	if (pnid->uFlags & NIF_STATE)
 		_dwState = (_dwState&~pnid->dwStateMask) | (pnid->dwState&pnid->dwStateMask);
 #endif
 
-	///@todo store and display tool tip texts
+	 // store tool tip text
+	if (pnid->uFlags & NIF_TIP)
+		 // UNICODE version of NOTIFYICONDATA structure
+		if (pnid->cbSize == sizeof(NOTIFYICONDATAW) ||				// _WIN32_IE = 0x600
+			pnid->cbSize == sizeof(NOTIFYICONDATAW)-sizeof(GUID) ||	// _WIN32_IE = 0x500
+			pnid->cbSize == sizeof(NOTIFYICONDATAW)-sizeof(GUID)-(128-64)*sizeof(WCHAR))// _WIN32_IE < 0x500
+			_tipText = (LPCWSTR)pnid->szTip;
+		 // ANSI version of NOTIFYICONDATA structure
+		else if (pnid->cbSize == sizeof(NOTIFYICONDATAA) ||			// _WIN32_IE = 0x600
+			pnid->cbSize == sizeof(NOTIFYICONDATAA)-sizeof(GUID) ||	// _WIN32_IE = 0x500
+			pnid->cbSize == sizeof(NOTIFYICONDATAA)-sizeof(GUID)-(128-64)*sizeof(CHAR))	// _WIN32_IE < 0x400
+			_tipText = (LPCSTR)pnid->szTip;
 
 	return *this;
 }
 
 
 NotifyArea::NotifyArea(HWND hwnd)
- :	super(hwnd)
+ :	super(hwnd),
+	_tooltip(hwnd)
 {
 	_next_idx = 0;
 	_clock_width = 0;
+	_show_hidden = false;
+
+	_tooltip.add(_hwnd, _hwnd);
 }
 
 LRESULT NotifyArea::Init(LPCREATESTRUCT pcs)
@@ -212,14 +228,15 @@
 						PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
 					else {
 						 // allow SetForegroundWindow() in client process
-						DWORD processId;
-						GetWindowThreadProcessId(entry._hWnd, &processId);
-
-						 // bind dynamically to AllowSetForegroundWindow() to be compatible to WIN98
-						static DynamicFct<BOOL(WINAPI*)(DWORD dwProcessId)> AllowSetForegroundWindow(TEXT("USER32"), "AllowSetForegroundWindow");
+						DWORD pid;
 
-						if (AllowSetForegroundWindow)
-							(*AllowSetForegroundWindow)(processId);
+						if (GetWindowThreadProcessId(entry._hWnd, &pid)) {
+							 // bind dynamically to AllowSetForegroundWindow() to be compatible to WIN98
+							static DynamicFct<BOOL(WINAPI*)(DWORD)> AllowSetForegroundWindow(TEXT("USER32"), "AllowSetForegroundWindow");
+
+							if (AllowSetForegroundWindow)
+								(*AllowSetForegroundWindow)(pid);
+						}
 
 						SendMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg);
 					}
@@ -235,6 +252,27 @@
 	return 0;
 }
 
+int NotifyArea::Notify(int id, NMHDR* pnmh)
+{
+	if (pnmh->code == TTN_GETDISPINFO) {
+		LPNMTTDISPINFO pdi = (LPNMTTDISPINFO)pnmh;
+
+		Point pt(GetMessagePos());
+		ScreenToClient(_hwnd, &pt);
+
+		NotifyIconSet::iterator found = IconHitTest(pt);
+
+		if (found != _sorted_icons.end()) {
+			NotifyInfo& entry = const_cast<NotifyInfo&>(*found);	// Why does GCC 3.3 need this additional const_cast ?!
+
+			if (!entry._tipText.empty())
+				_tcscpy(pdi->szText, entry._tipText);
+		}
+	}
+
+	return 0;
+}
+
 void NotifyArea::CancelModes()
 {
 	PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0);
@@ -248,13 +286,18 @@
 	switch(notify_code) {
 	  case NIM_ADD:
 	  case NIM_MODIFY:
-		if ((int)pnid->uID >= 0) {	///@todo fix for windows task manager
+		if ((int)pnid->uID >= 0) {	///@todo This is a fix for Windows Task Manager.
 			NotifyInfo& entry = _icon_map[pnid] = pnid;
 
 			 // a new entry?
 			if (entry._idx == -1)
 				entry._idx = ++_next_idx;
 
+#if NOTIFYICON_VERSION>=3	// as of 21.08.2003 missing in MinGW headers
+			if (DetermineHideState(entry))
+				entry._dwState |= NIS_HIDDEN;
+#endif
+
 			Refresh();	///@todo call only if really changes occurred
 
 			return TRUE;
@@ -273,12 +316,19 @@
 		}
 		break;}
 
-#if NOTIFYICON_VERSION>=3	// currently (as of 21.08.2003) missing in MinGW headers
+#if NOTIFYICON_VERSION>=3	// as of 21.08.2003 missing in MinGW headers
 	  case NIM_SETFOCUS:
+		SetForegroundWindow(_hwnd);
 		return TRUE;
 
 	  case NIM_SETVERSION:
-		return FALSE;	///@todo
+		NotifyIconMap::iterator found = _icon_map.find(pnid);
+
+		if (found != _icon_map.end()) {
+			found->second._version = pnid->UNION_MEMBER(uVersion);
+			return TRUE;
+		} else
+			return FALSE;
 #endif
 	}
 
@@ -293,8 +343,8 @@
 	for(NotifyIconMap::const_iterator it=_icon_map.begin(); it!=_icon_map.end(); ++it) {
 		const NotifyInfo& entry = it->second;
 
-#ifdef NIF_STATE	// currently (as of 21.08.2003) missing in MinGW headers
-		if (!(entry._dwState & NIS_HIDDEN))
+#ifdef NIF_STATE	// as of 21.08.2003 missing in MinGW headers
+		if (_show_hidden || !(entry._dwState & NIS_HIDDEN))
 #endif
 			_sorted_icons.insert(entry);
 	}
@@ -367,6 +417,38 @@
 	return it;
 }
 
+#if NOTIFYICON_VERSION>=3	// as of 21.08.2003 missing in MinGW headers
+bool NotifyArea::DetermineHideState(NotifyInfo& entry)
+{
+/*
+	DWORD pid;
+
+	if (GetWindowThreadProcessId(entry._hWnd, &pid)) {
+
+		//@@ look for executable path
+
+	}
+*/
+	TCHAR title[MAX_PATH];
+
+	if (GetWindowText(entry._hWnd, title, MAX_PATH)) {
+		if (_tcsstr(title, TEXT("Task Manager")))
+			return false;
+
+		if (_tcsstr(title, TEXT("AntiVir")))
+			return true;
+
+		if (_tcsstr(title, TEXT("Apache")))
+			return true;
+
+		if (_tcsstr(title, TEXT("FRITZ!web")))
+			return true;
+	}
+
+	return false;
+}
+#endif
+
 
 ClockWindow::ClockWindow(HWND hwnd)
  :	super(hwnd),

reactos/subsys/system/explorer/taskbar
traynotify.h 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- traynotify.h	14 Jan 2004 20:21:16 -0000	1.14
+++ traynotify.h	14 Mar 2004 16:39:28 -0000	1.15
@@ -67,6 +67,8 @@
 	HICON	_hIcon;
 	DWORD	_dwState;
 	UINT	_uCallbackMessage;
+	UINT	_version;
+	String	_tipText;
 };
 
 typedef map<NotifyIconIndex, NotifyInfo> NotifyIconMap;
@@ -86,15 +88,20 @@
 	LRESULT	ProcessTrayNotification(int notify_code, NOTIFYICONDATA* pnid);
 
 protected:
+	WindowHandle _hwndClock;
+	int		_clock_width;
+
 	NotifyIconMap _icon_map;
 	NotifyIconSet _sorted_icons;
 	int		_next_idx;
 
-	WindowHandle _hwndClock;
-	int		_clock_width;
+	ToolTip	_tooltip;
+
+	bool	_show_hidden;
 
 	LRESULT Init(LPCREATESTRUCT pcs);
 	LRESULT	WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
+	int		Notify(int id, NMHDR* pnmh);
 
 	void	Refresh();
 	void	Paint();
@@ -102,6 +109,7 @@
 	void	CancelModes();
 
 	NotifyIconSet::iterator IconHitTest(const POINT& pos);
+	bool	DetermineHideState(NotifyInfo& entry);
 };
 
 
CVSspam 0.2.8