int Chat_Load() { InitializeCriticalSection(&cs); g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU)); TranslateMenu(g_hMenu); HookEvents(); CreateServiceFunctions(); CreateHookableEvents(); return 0; }
int __declspec(dllexport) Load(PLUGINLINK *link) { BOOL bFlag = FALSE; HINSTANCE hDll; #ifndef NDEBUG //mem leak detector :-) Thanks Tornado! int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // Get current flag flag |= _CRTDBG_LEAK_CHECK_DF; // Turn on leak-checking bit _CrtSetDbgFlag(flag); // Set flag to the new value #endif pluginLink = link; // set the memory & utf8 managers mir_getMMI( &memoryManagerInterface ); mir_getUTFI( &utfi ); mir_getLP( &pluginInfo ); hDll = LoadLibraryA("riched20.dll"); if ( hDll ) { char modulePath[MAX_PATH]; if (GetModuleFileNameA(hDll, modulePath, MAX_PATH)) { DWORD dummy; VS_FIXEDFILEINFO* vsInfo; UINT vsInfoSize; DWORD size = GetFileVersionInfoSizeA(modulePath, &dummy); BYTE* buffer = (BYTE*) mir_alloc(size); if (GetFileVersionInfoA(modulePath, 0, size, buffer)) if (VerQueryValueA(buffer, "\\", (LPVOID*) &vsInfo, &vsInfoSize)) if (LOWORD(vsInfo->dwFileVersionMS) != 0) bFlag= TRUE; mir_free(buffer); } } if ( !bFlag ) { if (IDYES == MessageBox(0, TranslateT("Miranda could not load the Chat plugin because Microsoft Rich Edit v 3 is missing.\nIf you are using Windows 95/98/NT or WINE please upgrade your Rich Edit control.\n\nDo you want to download an update now?."),TranslateT("Information"),MB_YESNO|MB_ICONINFORMATION)) CallService(MS_UTILS_OPENURL, 1, (LPARAM) "http://members.chello.se/matrix/re3/richupd.exe"); FreeLibrary(GetModuleHandleA("riched20.dll")); return 1; } UpgradeCheck(); g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU)); InitREOleCallback(); HookEvents(); CreateServiceFunctions(); CreateHookableEvents(); OptionsInit(); TabsInit(); return 0; }
int Chat_Load(PLUGINLINK *link) { if(M->GetByte("forceDisableMUC", 0)) { PluginConfig.m_chat_enabled = false; return(0); } g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU)); if(CreateServiceFunctions()) { HookEvents(); CreateHookableEvents(); OptionsInit(); } return 0; }
PLUGININTERFACE int CListInitialise(PLUGINLINK * link) { pluginLink=link; /* #ifdef _DEBUG _CrtSetBreakAlloc(11166); #endif */ HMODULE hKernel = GetModuleHandleA( "kernel32.dll" ); fnTryEnterCriticalSection = ( pfnTryEnterCriticalSection )GetProcAddress( hKernel, "TryEnterCriticalSection" ); HMODULE hUser = GetModuleHandleA( "user32.dll" ); fnGetMenuBarInfo = ( pfnGetMenuBarInfo )GetProcAddress( hUser, "GetMenuBarInfo" ); fnGetScrollBarInfo = ( pfnGetScrollBarInfo )GetProcAddress( hUser, "GetScrollBarInfo" ); fnMsgWaitForMultipleObjectsEx = ( pfnMsgWaitForMultipleObjectsEx )GetProcAddress( hUser, "MsgWaitForMultipleObjectsEx" ); if (( fnGetAncestor = ( pfnGetAncestor )GetProcAddress( hUser, "GetAncestor" )) == NULL ) fnGetAncestor = MyGetAncestor; g_dwMainThreadID = GetCurrentThreadId(); DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&g_hMainThread,0,FALSE,DUPLICATE_SAME_ACCESS); mir_getMMI(&mmi); mir_getUTFI(&utfi); mir_getLI(&li); mir_getTMI(&tmi); CHECKRES ( PreLoadContactListModule ( ) ); CHECKRES ( SubclassClistInterface ( ) ); CHECKRES ( CreateHookableEvents ( ) ); CHECKRES ( XPThemesLoadModule ( ) ); CHECKRES ( SkinEngineLoadModule ( ) ); CHECKRES ( BackgroundsLoadModule ( ) ); CHECKRES ( CluiLoadModule ( ) ); CHECKRES ( ClcLoadModule ( ) ); CHECKRES ( ToolbarButtonLoadModule( ) ); CHECKRES ( ToolbarLoadModule() ); TRACE( "CListInitialise Modern Contact List ... Done\r\n" ); return S_OK; }
extern "C" __declspec(dllexport) int CListInitialise() { mir_getLP(&pluginInfo); g_dwMainThreadID = GetCurrentThreadId(); g_hMirApp = GetModuleHandleA("mir_app.mir"); CHECKRES(PreLoadContactListModule()); CHECKRES(SubclassClistInterface()); CHECKRES(CreateHookableEvents()); CHECKRES(SkinEngineLoadModule()); CHECKRES(BackgroundsLoadModule()); CHECKRES(CluiLoadModule()); CHECKRES(ClcLoadModule()); CHECKRES(ToolbarButtonLoadModule()); CHECKRES(ToolbarLoadModule()); TRACE("CListInitialise Modern Contact List ... Done\r\n"); return S_OK; }