From a2a729a7e8a044b657363e4c74e0456d1b521e46 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 4 Apr 2013 21:00:23 +0000 Subject: preparing contacts menu item git-svn-id: http://svn.miranda-ng.org/main/trunk@4308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/XSoundNotify/res/XSoundNotify.rc | Bin 4662 -> 6416 bytes plugins/XSoundNotify/src/resource.h | Bin 1642 -> 1742 bytes plugins/XSoundNotify/src/xsn_main.cpp | 26 ++++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/XSoundNotify/res/XSoundNotify.rc b/plugins/XSoundNotify/res/XSoundNotify.rc index 228edca1dd..ca35e52332 100644 Binary files a/plugins/XSoundNotify/res/XSoundNotify.rc and b/plugins/XSoundNotify/res/XSoundNotify.rc differ diff --git a/plugins/XSoundNotify/src/resource.h b/plugins/XSoundNotify/src/resource.h index 41704f71cc..ff362610a7 100644 Binary files a/plugins/XSoundNotify/src/resource.h and b/plugins/XSoundNotify/src/resource.h differ diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 06c0c82231..a920f298ac 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -47,7 +47,7 @@ bool isReceiveMessage(LPARAM event) return !(((info.eventType != EVENTTYPE_MESSAGE) && !(info.flags & DBEF_READ)) || (info.flags & DBEF_SENT)); } -INT processEvent(WPARAM wParam, LPARAM lParam) +INT ProcessEvent(WPARAM wParam, LPARAM lParam) { if (!isReceiveMessage(lParam)) return 0; @@ -281,12 +281,34 @@ INT OptInit(WPARAM wParam, LPARAM lParam) return 0; } +INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) +{ + return 0; +} + +int OnLoadInit(WPARAM wParam, LPARAM lParam) +{ + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(mi); + mi.position = -0x7FFFFFFF; + mi.flags = CMIF_TCHAR; + mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.ptszName = LPGENT("Custom contact sound"); + mi.pszService = "XSoundNotify/ContactMenuCommand"; + Menu_AddContactMenuItem(&mi); + + return 0; +} + extern "C" int __declspec(dllexport) Load() { mir_getLP(&pluginInfo); + CreateServiceFunction("XSoundNotify/ContactMenuCommand", ShowDialog); + HookEvent(ME_OPT_INITIALISE, OptInit); - HookEvent(ME_DB_EVENT_ADDED, processEvent); + HookEvent(ME_DB_EVENT_ADDED, ProcessEvent); + HookEvent(ME_SYSTEM_MODULESLOADED, OnLoadInit); return 0; } -- cgit v1.2.3