From dfe1e876c6d8ad77a66ae242482e8cc2b6be48c3 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 7 Aug 2010 21:17:36 +0300 Subject: working.... --- init.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index d03c951..75ae28a 100644 --- a/init.cpp +++ b/init.cpp @@ -68,6 +68,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) } int LoadKey(WPARAM w, LPARAM l); +int ToggleEncryption(WPARAM w, LPARAM l); extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { @@ -76,15 +77,23 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mir_getMMI(&mmi); mir_getUTFI(&utfi); CreateServiceFunction("/LoadPubKey",LoadKey); - CLISTMENUITEM mi; - ZeroMemory(&mi,sizeof(mi)); + CreateServiceFunction("/ToggleEncryption",ToggleEncryption); + CLISTMENUITEM mi = {0}; mi.cbSize=sizeof(mi); mi.position=-0x7FFFFFFF; mi.flags=0; mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - mi.pszName="Load public key"; + mi.pszName="Load GPG public key"; mi.pszService="/LoadPubKey"; hLoadPubKey = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi); + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFe; + mi.flags=0; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.pszName="Toggle GPG encryption"; + mi.pszService="/ToggleEncryption"; + hLoadPubKey = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi); return 0; } @@ -107,5 +116,13 @@ extern "C" int __declspec(dllexport) Unload(void) int LoadKey(WPARAM w, LPARAM l) { + HANDLE hContact = (HANDLE)w; + MessageBox(0, _T("Load GPG key function called"), _T("INFO"), MB_OK); + return 0; +} +int ToggleEncryption(WPARAM w, LPARAM l) +{ + HANDLE hContact = (HANDLE)w; + MessageBox(0, _T("Toggle GPG encryption function called"), _T("INFO"), MB_OK); return 0; } \ No newline at end of file -- cgit v1.2.3