예제 #1
0
int __declspec(dllexport) Load(PLUGINLINK *link)
{
    PROTOCOLDESCRIPTOR pd;

    pluginLink = link;
    mir_getMMI( &mmi );
    mir_getMD5I( &md5i );
    mir_getSHA1I( &sha1i );
    mir_getUTFI( &utfi );

    DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);

    srand((unsigned) time(NULL));

    TlenRegisterIcons();

    // Register protocol module
    ZeroMemory(&pd, sizeof(PROTOCOLDESCRIPTOR));
    pd.cbSize = sizeof(PROTOCOLDESCRIPTOR);
    pd.szName = "TLEN";
    pd.fnInit = ( pfnInitProto )tlenProtoInit;
    pd.fnUninit = ( pfnUninitProto )tlenProtoUninit;
    pd.type = PROTOTYPE_PROTOCOL;
    CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) &pd);

    return 0;
}
예제 #2
0
extern "C" int __declspec( dllexport ) Load( PLUGINLINK *link )
{
    pluginLink = link;

    // set the memory, lists & utf8 managers
    mir_getMMI( &mmi );
    mir_getLI( &li );
    mir_getUTFI( &utfi );
    mir_getMD5I( &md5i );
    mir_getSHA1I( &sha1i );
    mir_getXI( &xi );
    mir_getTMI( &tmi );
    mir_getLP( &pluginInfo );

    CallService( MS_UTILS_GETCOUNTRYLIST, ( WPARAM )&g_cbCountries, ( LPARAM )&g_countries );

    setlocale(LC_ALL, "");
    mir_snprintf( szVersion, sizeof( szVersion ), Translate("Jabber protocol plugin for Miranda IM (%s)"), __DATE__ );

    pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)hInst);

    // Register protocol module
    PROTOCOLDESCRIPTOR pd;
    ZeroMemory( &pd, sizeof( PROTOCOLDESCRIPTOR ));
    pd.cbSize = sizeof( PROTOCOLDESCRIPTOR );
    pd.szName = "JABBER";
    pd.fnInit = ( pfnInitProto )jabberProtoInit;
    pd.fnUninit = ( pfnUninitProto )jabberProtoUninit;
    pd.type = PROTOTYPE_PROTOCOL;
    CallService( MS_PROTO_REGISTERMODULE, 0, ( LPARAM )&pd );

    // Load some fuctions
    HMODULE hDll;
    if ( hDll = GetModuleHandleA( "gdi32.dll" ))
        JabberAlphaBlend = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION)) GetProcAddress(hDll, "GdiAlphaBlend");
    if ( JabberAlphaBlend == NULL && ( hDll = LoadLibraryA("msimg32.dll" )))
        JabberAlphaBlend = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION)) GetProcAddress(hDll, "AlphaBlend");

    if ( IsWinVerXPPlus() ) {
        if ( hDll = GetModuleHandleA("uxtheme")) {
            JabberDrawThemeParentBackground = (HRESULT (WINAPI *)(HWND,HDC,RECT *))GetProcAddress(hDll, "DrawThemeParentBackground");
            JabberIsThemeActive = (BOOL (WINAPI *)())GetProcAddress(hDll, "IsThemeActive");
        }
    }

    g_IconsInit();
    g_MenuInit();
    hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
    hModulesLoadedTB = HookEvent(ME_TB_MODULELOADED, g_OnModernToolbarInit);
    JabberUserInfoInit();

    return 0;
}