summaryrefslogtreecommitdiff
path: root/plugins/SecureIM/src/main.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-02-22 04:56:32 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-02-22 04:56:32 +0000
commit400d2e50f52fe113f2130db6062fef4a970a1042 (patch)
treef0d5e62c4573d75ef83542543d687c5c18c499c4 /plugins/SecureIM/src/main.cpp
parentd68ef14d25a6b9f3dcec6700e812dc5012aa59ba (diff)
hooking loading/unloading events
git-svn-id: http://svn.miranda-ng.org/main/trunk@3676 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SecureIM/src/main.cpp')
-rw-r--r--plugins/SecureIM/src/main.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index a1f8a91f02..33820e04d4 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -98,7 +98,6 @@ extern "C" __declspec(dllexport) int __cdecl Load(void)
if (bIsComCtl6) iBmpDepth = ILC_COLOR32 | ILC_MASK; // 32-bit images are supported
else iBmpDepth = ILC_COLOR24 | ILC_MASK;
- bCoreUnicode = true;
iCoreVersion = CallService(MS_SYSTEM_GETVERSION,0,0);
// load crypo++ dll
@@ -118,6 +117,8 @@ extern "C" __declspec(dllexport) int __cdecl Load(void)
// hook events
AddHookFunction(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
AddHookFunction(ME_SYSTEM_OKTOEXIT, onSystemOKToExit);
+ AddHookFunction(ME_SYSTEM_MODULELOAD, ModuleLoad);
+ AddHookFunction(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
g_hEvent[0] = CreateHookableEvent(MODULENAME"/Disabled");
g_hEvent[1] = CreateHookableEvent(MODULENAME"/Established");
@@ -145,18 +146,20 @@ extern "C" __declspec(dllexport) int __cdecl Unload()
return 0;
}
+int ModuleLoad(WPARAM wParam, LPARAM lParam)
+{
+ bPopupExists = ServiceExists(MS_POPUP_ADDPOPUPEX) != 0;
+ bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT) != 0;
+ return 0;
+}
-int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam)
+int onModulesLoaded(WPARAM wParam, LPARAM lParam)
{
#if defined(_DEBUG) || defined(NETLIB_LOG)
InitNetlib();
Sent_NetLog("onModuleLoaded begin");
#endif
- bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT)!=0;
- bPopupExists = ServiceExists(MS_POPUP_ADDPOPUPEX)!=0;
- bPopupUnicode = ServiceExists(MS_POPUP_ADDPOPUPW)!=0;
-
if ( ServiceExists(MS_FOLDERS_GET_PATH))
g_hFolders = FoldersRegisterCustomPathT(szModuleName, "Icons", _T(MIRANDA_PATH"\\icons"));
@@ -464,8 +467,8 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam)
}
-int __cdecl onSystemOKToExit(WPARAM wParam,LPARAM lParam) {
-
+int onSystemOKToExit(WPARAM wParam, LPARAM lParam)
+{
if (bSavePass) {
LPSTR tmp = gpg_get_passphrases();
DBWriteContactSettingString(0,szModuleName,"gpgSave",tmp);