soc.2009.vulture: d329ac3b: Flash window on message receipt.

gdick at soc.pidgin.im gdick at soc.pidgin.im
Tue Jun 16 17:05:34 EDT 2009


-----------------------------------------------------------------
Revision: d329ac3b7e5acd660c2f4c80d287c3ec73439284
Ancestor: c56f879b4f37d4352ad4417d6f6aec4e57ec58fc
Author: gdick at soc.pidgin.im
Date: 2009-06-16T20:24:58
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/d329ac3b7e5acd660c2f4c80d287c3ec73439284

Modified files:
        vulture/Makefile.mingw vulture/vultureconv.c

ChangeLog: 

Flash window on message receipt.

-------------- next part --------------
============================================================
--- vulture/Makefile.mingw	3ae1d65d4d4dac005dc158093ac5bcc1f0310517
+++ vulture/Makefile.mingw	8720a9da3fa955e817384453773dbf35ff96571f
@@ -26,9 +26,9 @@ DEFINES += -DUNICODE \
 
 DEFINES += -DUNICODE \
 			-D_UNICODE \
-			-D_WIN32_WINNT=0x0400 \
-			-D_WIN32_WINDOWS=0x0400 \
-			-DWINVER=0x0400 \
+			-D_WIN32_WINNT=0x0500 \
+			-D_WIN32_WINDOWS=0x0500 \
+			-DWINVER=0x0500 \
 			-D_WIN32_IE=0x0500
 
 ##
============================================================
--- vulture/vultureconv.c	b25a661d8a7cf28dd40611ce5d91e3a8a4a15be0
+++ vulture/vultureconv.c	8f7019f47f555b1248cd340fa7a2ccf87f0b8260
@@ -174,6 +174,7 @@ static LRESULT CALLBACK ConvContainerWnd
 				EnableAppropriateConvWindow(lpccd);
 
 				ResizeActiveConversationWindow(hwnd, hwndTabs);
+				RecalcTabIndices(hwndTabs);
 			}
 
 			break;
@@ -248,6 +249,13 @@ static LRESULT CALLBACK ConvContainerWnd
 		return 0;
 
 
+	case WM_ACTIVATE:
+		if(LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE)
+			FlashWindow(hwnd, FALSE);
+
+		break;
+
+
 	case WM_CLOSE:
 		{
 			HWND hwndTabs;
@@ -504,7 +512,8 @@ static void RepositionConvControls(HWND 
 
 
 /**
- * Displays a received message in a conversation window.
+ * Displays a received message in a conversation window, and handles
+ * highlighting.
  *
  * @param	lpvcwrite	Conversation message data structure.
  */
@@ -514,6 +523,8 @@ void VultureWriteConversation(VULTURE_CO
 	int cchTime;
 	LPTSTR szTime;
 	HWND hwndRichEdit = GetDlgItem(lpvcwrite->lpvconv->hwndConv, IDC_RICHEDIT_CONV);
+	CONVCONTAINERDATA *lpccd;
+	HWND hwndTabs;
 
 	charrange.cpMin = charrange.cpMax = -1;
 	SendMessage(hwndRichEdit, EM_EXSETSEL, 0, (LPARAM)&charrange);
@@ -530,6 +541,27 @@ void VultureWriteConversation(VULTURE_CO
 	SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)TEXT(": "));
 	SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)lpvcwrite->szMessage);
 	SendMessage(hwndRichEdit, EM_REPLACESEL, 0, (LPARAM)TEXT("\n"));
+
+	if(GetForegroundWindow() != lpvcwrite->lpvconv->hwndContainer)
+	{
+#if (WINVER >= 0x0500)
+		FLASHWINFO flashwinfo;
+
+		SystemParametersInfo(SPI_GETFOREGROUNDFLASHCOUNT, 0, &flashwinfo.uCount, 0);
+		flashwinfo.cbSize = sizeof(flashwinfo);
+		flashwinfo.dwFlags = FLASHW_ALL;
+		flashwinfo.dwTimeout = 0;
+		flashwinfo.hwnd = lpvcwrite->lpvconv->hwndContainer;
+		FlashWindowEx(&flashwinfo);
+#else
+		FlashWindow(lpvcwrite->lpvconv->hwndContainer, TRUE);
+#endif
+	}
+
+	lpccd = (CONVCONTAINERDATA*)GetWindowLongPtr(lpvcwrite->lpvconv->hwndContainer, GWLP_USERDATA);
+	hwndTabs = GetDlgItem(lpccd->hwndTabDlg, IDC_TAB_CONVERSATIONS);
+	if(lpvcwrite->lpvconv->iTabIndex != TabCtrl_GetCurSel(hwndTabs))
+		TabCtrl_HighlightItem(hwndTabs, lpvcwrite->lpvconv->iTabIndex, TRUE);
 }
 
 


More information about the Commits mailing list