summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yapp/message_pump.cpp3
-rw-r--r--yapp/message_pump.h1
-rw-r--r--yapp/notify_imp.cpp9
-rw-r--r--yapp/popups2.cpp6
-rw-r--r--yapp/popwin.cpp5
-rw-r--r--yapp/popwin.h3
6 files changed, 15 insertions, 12 deletions
diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp
index 426d0ab..a03dae3 100644
--- a/yapp/message_pump.cpp
+++ b/yapp/message_pump.cpp
@@ -125,6 +125,9 @@ DWORD CALLBACK MessagePumpThread(LPVOID param) {
BroadcastMessage(PUM_KILLNOTIFY, (WPARAM)hNotify, 0);
}
break;
+ case MUM_NMAVATAR:
+ RepositionWindows();
+ break;
default:
{
TranslateMessage(&hwndMsg);
diff --git a/yapp/message_pump.h b/yapp/message_pump.h
index 487c17e..52f7970 100644
--- a/yapp/message_pump.h
+++ b/yapp/message_pump.h
@@ -9,6 +9,7 @@ void PostMPMessage(UINT msg, WPARAM, LPARAM);
#define MUM_NMUPDATE (WM_USER + 0x013)
#define MUM_NMREMOVE (WM_USER + 0x014)
+#define MUM_NMAVATAR (WM_USER + 0x015)
// given a popup data pointer, and a handle to an event, this function
// will post a message to the message queue which will set the hwnd value
diff --git a/yapp/notify_imp.cpp b/yapp/notify_imp.cpp
index 9dc0b2e..89fde14 100644
--- a/yapp/notify_imp.cpp
+++ b/yapp/notify_imp.cpp
@@ -30,6 +30,12 @@ int Popup2Update(WPARAM wParam, LPARAM lParam) {
return 0;
}
+int AvatarChanged(WPARAM wParam, LPARAM lParam) {
+ PostMPMessage(MUM_NMAVATAR, (WPARAM)0, (LPARAM)0);
+ return 0;
+}
+
+
INT_PTR svcPopup2Update(WPARAM wParam, LPARAM lParam) {
return Popup2Update(wParam, lParam);
}
@@ -102,10 +108,12 @@ int NotifyOptionsInitialize(WPARAM wParam,LPARAM lParam)
}
HANDLE hEventNotifyOptInit, hEventNotifyModulesLoaded;
+HANDLE hAvChangeEvent;
int NotifyModulesLoaded(WPARAM wParam,LPARAM lParam)
{
hEventNotifyOptInit = HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
+ hAvChangeEvent = HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
return 0;
}
@@ -129,6 +137,7 @@ void DeinitNotify() {
UnhookEvent(hhkUpdate);
UnhookEvent(hhkRemove);
+ UnhookEvent(hAvChangeEvent);
UnhookEvent(hEventNotifyOptInit);
UnhookEvent(hEventNotifyModulesLoaded);
diff --git a/yapp/popups2.cpp b/yapp/popups2.cpp
index 134e648..a800af7 100644
--- a/yapp/popups2.cpp
+++ b/yapp/popups2.cpp
@@ -30,9 +30,6 @@ HFONT hFontFirstLine = 0, hFontSecondLine = 0, hFontTime = 0;
COLORREF colFirstLine = RGB(255, 0, 0), colSecondLine = 0, colTime = RGB(0, 0, 255), colBorder = RGB(0, 0, 0),
colSidebar = RGB(128, 128, 128), colTitleUnderline = GetSysColor(COLOR_3DSHADOW);
-// hooked here so it's in the main thread
-HANDLE hAvChangeEvent = 0;
-
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -309,8 +306,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
hFontTime = CreateFontIndirect(&lf);
}
- hAvChangeEvent = HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
-
LoadModuleDependentOptions();
if(GetModuleHandle(_T("neweventnotify")))
@@ -322,7 +317,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
}
int PreShutdown(WPARAM wParam, LPARAM lParam) {
- if(hAvChangeEvent) UnhookEvent(hAvChangeEvent);
DeinitMessagePump();
DeinitNotify();
return 0;
diff --git a/yapp/popwin.cpp b/yapp/popwin.cpp
index 8ef25fd..64496c8 100644
--- a/yapp/popwin.cpp
+++ b/yapp/popwin.cpp
@@ -740,11 +740,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
-int AvatarChanged(WPARAM wParam, LPARAM lParam) {
- RepositionWindows();
- return 0;
-}
-
void InitWindowStack() {
hUserDll = LoadLibrary(_T("user32.dll"));
if (hUserDll) {
diff --git a/yapp/popwin.h b/yapp/popwin.h
index d532108..63038c4 100644
--- a/yapp/popwin.h
+++ b/yapp/popwin.h
@@ -19,7 +19,8 @@ void InitWindowStack();
void DeinitWindowStack();
void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam);
-int AvatarChanged(WPARAM wParam, LPARAM lParam); // exposed so hook/unhook is in main thread
+
+void RepositionWindows();
LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);