diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-06-19 12:09:16 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-06-19 12:09:16 +0000 |
commit | cfc3f883b893fab0042738d1ed228467d5a7ac74 (patch) | |
tree | 254fe6a3b9e334b406fcdbda5085a1eb1fa53ce4 | |
parent | 274074928c2ea794fd88c8f25c041852aabe66c2 (diff) |
added support for utf8
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@206 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | message_notify/MessageNotify.mdsp | 8 | ||||
-rw-r--r-- | message_notify/messagenotify.cpp | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/message_notify/MessageNotify.mdsp b/message_notify/MessageNotify.mdsp index 7bb841a..9e7f15e 100644 --- a/message_notify/MessageNotify.mdsp +++ b/message_notify/MessageNotify.mdsp @@ -94,8 +94,10 @@ extraResourceOptions= [Resource]
1=resource.rc
[Other]
+1=..\..\include\m_database.h
[History]
-common.h,643
-popups.cpp,6075
options.cpp,5169
-messagenotify.cpp,518
+popups.cpp,6075
+common.h,643
+..\..\include\m_database.h,16859
+messagenotify.cpp,726
diff --git a/message_notify/messagenotify.cpp b/message_notify/messagenotify.cpp index 1e7628a..437b614 100644 --- a/message_notify/messagenotify.cpp +++ b/message_notify/messagenotify.cpp @@ -27,7 +27,7 @@ DWORD focusTimerId = 0; PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
"Message Notify",
- PLUGIN_MAKE_VERSION(0,2,1,0),
+ PLUGIN_MAKE_VERSION(0,2,2,0),
"Show a popup when a message is received",
"Scott Ellis",
"mail@scottellis.com.au",
@@ -162,6 +162,7 @@ typedef struct { HANDLE hContact;
BYTE *blob;
int blobsize;
+ int flags;
HANDLE hEvent;
} CheckWindowData;
@@ -203,7 +204,10 @@ unsigned int __stdcall sttCheckWindowProc( VOID *dwParam ) { } else {
// no, convert to unciode
wchar_t msg[MAX_SECONDLINE];
- MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, msg, MAX_SECONDLINE);
+ if(cd->flags & DBEF_UTF)
+ MultiByteToWideChar(CP_UTF8, 0, (char *) cd->blob, -1, msg, MAX_SECONDLINE);
+ else
+ MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, msg, MAX_SECONDLINE);
ShowPopupW(cd->hContact, swzContactDisplayName, msg);
}
} else {
@@ -262,6 +266,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { // copy blob data
cd->blobsize = dbei->cbBlob;
cd->blob = new BYTE[cd->blobsize];
+ cd->flags = dbei->flags;
memcpy(cd->blob, dbei->pBlob, cd->blobsize);
} else
cd->blobsize = 0;
@@ -331,12 +336,14 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { metacontacts_installed = (ServiceExists(MS_MC_GETMETACONTACT) != 0);
+ hEventDbEventAdded = HookEvent(ME_DB_EVENT_FILTER_ADD, OnDatabaseEventPreAdd);
hIdle = HookEvent(ME_IDLE_CHANGED, OnIdleChanged);
hWindowEvent = HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent);
if(options.notify_when == NOTIFY_NFORE)
StartFocusTimer();
+
return 0;
}
@@ -387,8 +394,6 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) popupWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- hEventDbEventAdded = HookEvent(ME_DB_EVENT_FILTER_ADD, OnDatabaseEventPreAdd);
-
return 0;
}
|