From 4bb5a1db945eb4027279213201e91da33351fb7e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Jul 2012 14:46:18 +0000 Subject: MS_SYSTEM_GETCONTACTINFO in UserInfoEx is made persistent git-svn-id: http://svn.miranda-ng.org/main/trunk@812 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/init.cpp | 123 +++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 63 deletions(-) (limited to 'plugins/UserInfoEx/init.cpp') diff --git a/plugins/UserInfoEx/init.cpp b/plugins/UserInfoEx/init.cpp index c146193354..514260af99 100644 --- a/plugins/UserInfoEx/init.cpp +++ b/plugins/UserInfoEx/init.cpp @@ -292,74 +292,71 @@ extern "C" INT __declspec(dllexport) Unload(VOID) **/ extern "C" INT __declspec(dllexport) Load(void) { + mir_getLP(&pluginInfo); + if ( !CoreCheck()) + return 1; + + // init common controls INITCOMMONCONTROLSEX ccEx; + ccEx.dwSize = sizeof(ccEx); + ccEx.dwICC = ICC_WIN95_CLASSES|ICC_DATE_CLASSES; + InitCommonControlsEx(&ccEx); + ZeroMemory(&myGlobals, sizeof(MGLOBAL)); - mir_getLP(&pluginInfo); - if (CoreCheck()) + // init clist interface + pcli = (CLIST_INTERFACE*)CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)0); + + // init new miranda timezone interface + mir_getTMI(&tmi); + + // init freeimage interface + INT_PTR result = CALLSERVICE_NOTFOUND; + if(ServiceExists(MS_IMG_GETINTERFACE)) + result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP); + + if(FIP == NULL || result != S_OK) { + MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Flags Module will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0); + return 1; + } + + if (IsWinVerVistaPlus()) { - // init common controls - ccEx.dwSize = sizeof(ccEx); - ccEx.dwICC = ICC_WIN95_CLASSES|ICC_DATE_CLASSES; - InitCommonControlsEx(&ccEx); - - ZeroMemory(&myGlobals, sizeof(MGLOBAL)); - - // init clist interface - pcli = (CLIST_INTERFACE*)CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)0); - - // init new miranda timezone interface - mir_getTMI(&tmi); - - // init freeimage interface - INT_PTR result = CALLSERVICE_NOTFOUND; - if(ServiceExists(MS_IMG_GETINTERFACE)) - result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP); - - if(FIP == NULL || result != S_OK) { - MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Flags Module will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0); - return 1; - } - - if (IsWinVerVistaPlus()) - { - HMODULE hDwmApi = LoadLibraryA("dwmapi.dll"); - if (hDwmApi) - dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled"); - } - - // check for dbx_tree - myGlobals.UseDbxTree = ServiceExists("DBT/Entity/GetRoot"); - - // load icon library - IcoLib_LoadModule(); - - SvcFlagsLoadModule(); - tmi.getTimeZoneTime ? SvcTimezoneLoadModule() : SvcTimezoneLoadModule_old(); - SvcContactInfoLoadModule(); - SvcEMailLoadModule(); - SvcRefreshContactInfoLoadModule(); - - CtrlContactLoadModule(); - // load my button class - CtrlButtonLoadModule(); - // initializes the Ex/Import Services - SvcExImport_LoadModule(); - // load the UserInfoPropertySheet module - DlgContactInfoLoadModule(); - - // Anniversary stuff - DlgAnniversaryListLoadModule(); - SvcReminderLoadModule(); - - // Now the module is loaded! Start initializing certain things - ghModulesLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - ghTopToolBarLoaded = HookEvent(ME_TTB_MODULELOADED, OnTopToolBarLoaded); - ghModernToolBarLoaded = HookEvent(ME_TB_MODULELOADED, OnModernToolBarLoaded); - ghShutdownHook = HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); - return 0; + HMODULE hDwmApi = LoadLibraryA("dwmapi.dll"); + if (hDwmApi) + dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled"); } - return 1; + + // check for dbx_tree + myGlobals.UseDbxTree = ServiceExists("DBT/Entity/GetRoot"); + + // load icon library + IcoLib_LoadModule(); + + SvcFlagsLoadModule(); + tmi.getTimeZoneTime ? SvcTimezoneLoadModule() : SvcTimezoneLoadModule_old(); + SvcContactInfoLoadModule(); + SvcEMailLoadModule(); + SvcRefreshContactInfoLoadModule(); + + CtrlContactLoadModule(); + // load my button class + CtrlButtonLoadModule(); + // initializes the Ex/Import Services + SvcExImport_LoadModule(); + // load the UserInfoPropertySheet module + DlgContactInfoLoadModule(); + + // Anniversary stuff + DlgAnniversaryListLoadModule(); + SvcReminderLoadModule(); + + // Now the module is loaded! Start initializing certain things + ghModulesLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + ghTopToolBarLoaded = HookEvent(ME_TTB_MODULELOADED, OnTopToolBarLoaded); + ghModernToolBarLoaded = HookEvent(ME_TB_MODULELOADED, OnModernToolBarLoaded); + ghShutdownHook = HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); + return 0; } /** -- cgit v1.2.3