From 400d2e50f52fe113f2130db6062fef4a970a1042 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 Feb 2013 04:56:32 +0000 Subject: hooking loading/unloading events git-svn-id: http://svn.miranda-ng.org/main/trunk@3676 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'plugins/SecureIM/src/main.cpp') 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); -- cgit v1.2.3