diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-02-11 23:12:17 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-02-11 23:12:17 +0000 |
commit | 6dcf1d3495e2e11183a4eaf7c04982da1df1acf9 (patch) | |
tree | c0af5274c9cb8371bf7f81739b7735d02c41c213 | |
parent | 21c835f71979bcf78ca95879354dfee9e90443c5 (diff) |
use threadex function to ensure thread creation
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@118 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | message_notify/MessageNotify.mdsp | 6 | ||||
-rw-r--r-- | message_notify/messagenotify.cpp | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/message_notify/MessageNotify.mdsp b/message_notify/MessageNotify.mdsp index d49a6a2..5b26eff 100644 --- a/message_notify/MessageNotify.mdsp +++ b/message_notify/MessageNotify.mdsp @@ -95,7 +95,7 @@ extraResourceOptions= 1=resource.rc
[Other]
[History]
-options.cpp,5183
-popups.cpp,6075
common.h,643
-messagenotify.cpp,696
+popups.cpp,6075
+options.cpp,5169
+messagenotify.cpp,1088
diff --git a/message_notify/messagenotify.cpp b/message_notify/messagenotify.cpp index cde42b1..c3d5132 100644 --- a/message_notify/messagenotify.cpp +++ b/message_notify/messagenotify.cpp @@ -27,7 +27,7 @@ DWORD focusTimerId = 0; PLUGININFO pluginInfo={
sizeof(PLUGININFO),
"Message Notify",
- PLUGIN_MAKE_VERSION(0,1,3,0),
+ PLUGIN_MAKE_VERSION(0,1,3,1),
"Show a popup when a message is received",
"Scott Ellis",
"mail@scottellis.com.au",
@@ -258,9 +258,12 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { cd->blobsize = 0;
// spawn a thread to deal with the copied data
- if(thread_api)
- CallService(MS_SYSTEM_FORK_THREAD, (WPARAM)sttCheckWindowProc, (LPARAM)(VOID *)cd);
- else {
+ if(thread_api) {
+ FORK_THREADEX_PARAMS tparam = {0};
+ tparam.arg = (VOID *)cd;
+ tparam.pFunc = sttCheckWindowProc;
+ CallService(MS_SYSTEM_FORK_THREAD_EX, 0, (LPARAM)&tparam);
+ } else {
cd->hEvent = CreateEvent(0, 0, 0, 0);
CloseHandle((HANDLE)_beginthreadex(0, 0, sttCheckWindowProc, (VOID *)cd, 0, 0));
WaitForSingleObject(cd->hEvent, INFINITE);
@@ -360,7 +363,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
- thread_api = (ServiceExists(MS_SYSTEM_FORK_THREAD) != 0);
+ thread_api = (ServiceExists(MS_SYSTEM_FORK_THREAD_EX) != 0);
InitWindowList();
|