extern "C" int __declspec(dllexport) CListInitialise() { int rc = 0; OutputDebugStringA("CListInitialise ClistMW\r\n"); mir_getLP( &pluginInfo ); mir_getCLI(); PreloadCLCModule(); pcli->hInst = g_hInst; pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu; pcli->pfnCalcEipPosition = CalcEipPosition; pcli->pfnCheckCacheItem = CheckPDNCE; pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged; pcli->pfnCompareContacts = CompareContacts; pcli->pfnCreateClcContact = fnCreateClcContact; pcli->pfnCreateCacheItem = fnCreateCacheItem; pcli->pfnFindItem = FindItem; pcli->pfnFreeCacheItem = FreeDisplayNameCacheItem; pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting; pcli->pfnGetRowsPriorTo = GetRowsPriorTo; pcli->pfnGetRowByIndex = GetRowByIndex; pcli->pfnHitTest = HitTest; pcli->pfnPaintClc = PaintClc; pcli->pfnRebuildEntireList = RebuildEntireList; pcli->pfnRecalcScrollBar = RecalcScrollBar; pcli->pfnScrollTo = ScrollTo; saveIconFromStatusMode = pcli->pfnIconFromStatusMode; pcli->pfnIconFromStatusMode = cli_IconFromStatusMode; saveAddGroup = pcli->pfnAddGroup; pcli->pfnAddGroup = AddGroup; saveAddInfoItemToGroup = pcli->pfnAddInfoItemToGroup; pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup; saveAddItemToGroup = pcli->pfnAddItemToGroup; pcli->pfnAddItemToGroup = AddItemToGroup; saveRemoveItemFromGroup = pcli->pfnRemoveItemFromGroup; pcli->pfnRemoveItemFromGroup = RemoveItemFromGroup; saveFreeContact = pcli->pfnFreeContact; pcli->pfnFreeContact = FreeContact; saveFreeGroup = pcli->pfnFreeGroup; pcli->pfnFreeGroup = FreeGroup; saveContactListControlWndProc = pcli->pfnContactListControlWndProc; pcli->pfnContactListControlWndProc = ContactListControlWndProc; saveTrayIconProcessMessage = pcli->pfnTrayIconProcessMessage; pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage; saveContactListWndProc = pcli->pfnContactListWndProc; pcli->pfnContactListWndProc = ContactListWndProc; saveLoadClcOptions = pcli->pfnLoadClcOptions; pcli->pfnLoadClcOptions = LoadClcOptions; saveSortCLC = pcli->pfnSortCLC; pcli->pfnSortCLC = SortCLC; memset(&SED,0,sizeof(SED)); CreateServiceFunction(CLUI_SetDrawerService,SetDrawer); rc = LoadContactListModule(); if (rc == 0) rc = LoadCLCModule(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); BGModuleLoad(); OutputDebugStringA("CListInitialise ClistMW...Done\r\n"); return rc; }
int __declspec(dllexport) CListInitialise(PLUGINLINK * link) { int rc=0; pluginLink=link; #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // get the internal malloc/free() //__try { /* { SYSTEMTIME utime,ctime; TIME_ZONE_INFORMATION timezone={0},tzi={0}; DWORD tz=GetTimeZoneInformation(&tzi); int a=(tz==TIME_ZONE_ID_STANDARD)?0:1; char tim[256]; char bu[255]; int hour=-3; GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_STIMEFORMAT,bu,sizeof(bu)); timezone.Bias=(hour-a)*60; GetSystemTime(&utime); SystemTimeToTzSpecificLocalTime(&timezone,&utime,&ctime); GetTimeFormat((LCID)LOCALE_USER_DEFAULT,TIME_NOSECONDS,&ctime,bu,&tim,sizeof(tim)); a=a; }*/ TRACE("CListInitialise ClistMW\r\n"); memset(&memoryManagerInterface,0,sizeof(memoryManagerInterface)); memoryManagerInterface.cbSize = sizeof(memoryManagerInterface); CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&memoryManagerInterface); memset(&SED,0,sizeof(SED)); CreateServiceFunction(CLUI_SetDrawerService,SetDrawer); ///test/// LoadSkinModule(); rc=LoadContactListModule(); if (rc==0) rc=LoadCLCModule(); HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded); LoadMoveToGroup(); //BGModuleLoad(); //CallTest(); TRACE("CListInitialise ClistMW...Done\r\n"); } // //__except (exceptFunction(GetExceptionInformation()) ) //{ // return 0; //} return rc; }
int __declspec(dllexport) CListInitialise(PLUGINLINK * link) { int rc = 0; pluginLink = link; #ifdef _DEBUG _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // get the internal malloc/free() memset(&memoryManagerInterface, 0, sizeof(memoryManagerInterface)); memoryManagerInterface.cbSize = sizeof(memoryManagerInterface); CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM) &memoryManagerInterface); rc = LoadContactListModule(); if (rc == 0) rc = LoadCLCModule(); HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded); HookEvent(ME_SYSTEM_MODULESLOADED, MenuModulesLoaded); return rc; }
extern "C" int __declspec(dllexport) CListInitialise() { mir_getLP( &pluginInfo ); mir_getCLI(); mir_getTMI(&tmi); API::onInit(); RegisterCLUIFrameClasses(); ZeroMemory((void *)&cfg::dat, sizeof(cfg::dat)); int iCount = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0); iCount += 20; if (iCount < 300) iCount = 300; cfg::init(); cfg::dat.hMenuNotify = CreatePopupMenu(); cfg::dat.wNextMenuID = 1; cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150); cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0); cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4); cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder); cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24); cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0); cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0); cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0); cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT); cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT); cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0); cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0); cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1); cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0); cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0); cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0); cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1); cfg::dat.boldHideOffline = -1; cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0; cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0); cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1); cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1); cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0); cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0); cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1); cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1); cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0); DWORD sortOrder = cfg::getDword("CList", "SortOrder", SORTBY_NAME); cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder)); cfg::dat.sortOrder[1] = HIBYTE(LOWORD(sortOrder)); cfg::dat.sortOrder[2] = LOBYTE(HIWORD(sortOrder)); if (cfg::dat.bFirstRun) cfg::writeByte("CLUI", "firstrun", 0); ReloadThemedOptions(); Reload3dBevelColors(); cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN); cfg::dat.dwFlags |= (cfg::getByte("CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0); cfg::dat.soundsOff = cfg::getByte("Skin", "UseSound", 1) ? 0 : 1; CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)cfg::dat.tszProfilePath); _tcslwr(cfg::dat.tszProfilePath); PreloadContactListModule(); // get the clist interface pcli->hInst = g_hInst; pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu; pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged; pcli->pfnCompareContacts = CompareContacts; pcli->pfnCreateClcContact = CreateClcContact; pcli->pfnCreateEvent = fnCreateEvent; pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage; pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting; pcli->pfnGetRowBottomY = RowHeight::getItemBottomY; pcli->pfnGetRowHeight = RowHeight::getHeight; pcli->pfnGetRowTopY = RowHeight::getItemTopY; pcli->pfnGetRowTotalHeight = RowHeight::getTotalHeight; pcli->pfnGetWindowVisibleState = GetWindowVisibleState; pcli->pfnHitTest = HitTest; pcli->pfnLoadContactTree = LoadContactTree; pcli->pfnOnCreateClc = OnCreateClc; pcli->pfnPaintClc = PaintClc; pcli->pfnRebuildEntireList = RebuildEntireList; pcli->pfnRowHitTest = RowHeight::hitTest; pcli->pfnScrollTo = ScrollTo; pcli->pfnTrayCalcChanged = TrayCalcChanged; pcli->pfnSetHideOffline = SetHideOffline; pcli->pfnShowHide = ShowHide; saveAddContactToGroup = pcli->pfnAddContactToGroup; pcli->pfnAddContactToGroup = AddContactToGroup; saveAddEvent = pcli->pfnAddEvent; pcli->pfnAddEvent = AddEvent; saveRemoveEvent = pcli->pfnRemoveEvent; pcli->pfnRemoveEvent = RemoveEvent; saveAddGroup = pcli->pfnAddGroup; pcli->pfnAddGroup = AddGroup; saveAddInfoItemToGroup = pcli->pfnAddInfoItemToGroup; pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup; saveContactListControlWndProc = pcli->pfnContactListControlWndProc; pcli->pfnContactListControlWndProc = ContactListControlWndProc; saveContactListWndProc = pcli->pfnContactListWndProc; pcli->pfnContactListWndProc = ContactListWndProc; saveIconFromStatusMode = pcli->pfnIconFromStatusMode; pcli->pfnIconFromStatusMode = fnIconFromStatusMode; saveLoadClcOptions = pcli->pfnLoadClcOptions; pcli->pfnLoadClcOptions = LoadClcOptions; saveProcessExternalMessages = pcli->pfnProcessExternalMessages; pcli->pfnProcessExternalMessages = ProcessExternalMessages; saveRecalcScrollBar = pcli->pfnRecalcScrollBar; pcli->pfnRecalcScrollBar = RecalcScrollBar; saveTrayIconProcessMessage = pcli->pfnTrayIconProcessMessage; pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage; int rc = LoadContactListModule(); if (rc == 0) rc = LoadCLCModule(); LoadCLUIModule(); LoadButtonModule(); HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded); return rc; }
int LoadDefaultModules(void) { // load order is very important for these if (LoadSystemModule()) return 1; if (LoadLangPackModule()) return 1; // langpack will be a system module in the new order so this is moved here if (CheckRestart()) return 1; if (LoadUtilsModule()) return 1; //order not important for this, but no dependencies and no point in pluginising if (LoadIcoTabsModule()) return 1; if (LoadHeaderbarModule()) return 1; if (LoadDbintfModule()) return 1; if (LoadEventsModule()) return 1; // load database drivers & service plugins without executing their Load() if (LoadNewPluginsModuleInfos()) return 1; switch (LoadDefaultServiceModePlugin()) { case SERVICE_CONTINUE: // continue loading Miranda normally case SERVICE_ONLYDB: // load database and go to the message cycle break; case SERVICE_MONOPOLY: // unload database and go to the message cycle return 0; default: // smth went wrong, terminating return 1; } // the database will select which db plugin to use, or fail if no profile is selected if (LoadDatabaseModule()) return 1; // database is available here if (LoadButtonModule()) return 1; if (LoadIcoLibModule()) return 1; if (LoadSkinIcons()) return 1; // if (LoadErrorsModule()) return 1; switch (LoadServiceModePlugin()) { case SERVICE_CONTINUE: // continue loading Miranda normally break; case SERVICE_ONLYDB: // load database and go to the message cycle return 0; case SERVICE_MONOPOLY: // unload database and go to the message cycle UnloadDatabase(); return 0; default: // smth went wrong, terminating return 1; } if (LoadSkinSounds()) return 1; if (LoadSkinHotkeys()) return 1; if (LoadFontserviceModule()) return 1; if (LoadSrmmModule()) return 1; if (LoadChatModule()) return 1; if (LoadDescButtonModule()) return 1; if (LoadOptionsModule()) return 1; if (LoadNetlibModule()) return 1; if (LoadSslModule()) return 1; if (LoadProtocolsModule()) return 1; LoadDbAccounts(); // retrieves the account array from a database if (LoadContactsModule()) return 1; if (LoadContactListModule()) return 1; // prepare contact list interface if (LoadAddContactModule()) return 1; if (LoadMetacontacts()) return 1; if (LoadNewPluginsModule()) return 1; // will call Load(void) on everything, clist will load first Langpack_SortDuplicates(); if (LoadAccountsModule()) return 1; //order becomes less important below here if (LoadFindAddModule()) return 1; if (LoadIgnoreModule()) return 1; if (LoadVisibilityModule()) return 1; if (LoadStdPlugins()) return 1; return 0; }
extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link) { int rc = 0; DBVARIANT dbv; int i; char szProfilePath[MAX_PATH]; pluginLink = link; #ifdef _DEBUG _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif mir_getMMI(&mmi); mir_getLI(&li); mir_getTMI(&tmi); mir_getLP( &pluginInfo ); API::onInit(); LoadCLCButtonModule(); RegisterCLUIFrameClasses(); ZeroMemory((void*) &cfg::dat, sizeof(cfg::dat)); int iCount = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0); iCount += 20; if( iCount < 300 ) iCount = 300; cfg::eCache = reinterpret_cast<TExtraCache *>(malloc(sizeof(TExtraCache) * iCount)); ZeroMemory(cfg::eCache, sizeof(struct TExtraCache) * iCount); cfg::nextCacheEntry = 0; cfg::maxCacheEntry = iCount; cfg::init(); cfg::dat.toolbarVisibility = cfg::getDword("CLUI", "TBVisibility", DEFAULT_TB_VISIBILITY); cfg::dat.hMenuButtons = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 3); cfg::dat.hMenuNotify = CreatePopupMenu(); cfg::dat.wNextMenuID = 1; cfg::dat.sortTimer = cfg::getDword("CLC", "SortTimer", 150); cfg::dat.szNoEvents = TranslateTS(szNoevents); cfg::dat.avatarBorder = (COLORREF)cfg::getDword("CLC", "avatarborder", 0); cfg::dat.avatarRadius = (COLORREF)cfg::getDword("CLC", "avatarradius", 4); cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder); cfg::dat.avatarSize = cfg::getWord("CList", "AvatarSize", 24); cfg::dat.dualRowMode = cfg::getByte("CLC", "DualRowMode", 0); cfg::dat.avatarPadding = cfg::getByte("CList", "AvatarPadding", 0); cfg::dat.isTransparent = cfg::getByte("CList", "Transparent", 0); cfg::dat.alpha = cfg::getByte("CList", "Alpha", SETTING_ALPHA_DEFAULT); cfg::dat.autoalpha = cfg::getByte("CList", "AutoAlpha", SETTING_ALPHA_DEFAULT); cfg::dat.fadeinout = cfg::getByte("CLUI", "FadeInOut", 0); cfg::dat.autosize = cfg::getByte("CLUI", "AutoSize", 0); cfg::dat.dwExtraImageMask = cfg::getDword("CLUI", "ximgmask", 0); cfg::dat.bNoOfflineAvatars = cfg::getByte("CList", "NoOfflineAV", 1); cfg::dat.bFullTransparent = cfg::getByte("CLUI", "fulltransparent", 0); cfg::dat.bDblClkAvatars = cfg::getByte("CLC", "dblclkav", 0); cfg::dat.bEqualSections = cfg::getByte("CLUI", "EqualSections", 0); cfg::dat.bCenterStatusIcons = cfg::getByte("CLC", "si_centered", 1); cfg::dat.boldHideOffline = -1; cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0; cfg::dat.bNoTrayTips = cfg::getByte("CList", "NoTrayTips", 0); cfg::dat.bShowLocalTime = cfg::getByte("CLC", "ShowLocalTime", 1); cfg::dat.bShowLocalTimeSelective = cfg::getByte("CLC", "SelectiveLocalTime", 1); cfg::dat.bDontSeparateOffline = cfg::getByte("CList", "DontSeparateOffline", 0); cfg::dat.bShowXStatusOnSbar = cfg::getByte("CLUI", "xstatus_sbar", 0); cfg::dat.bLayeredHack = cfg::getByte("CLUI", "layeredhack", 1); cfg::dat.bFirstRun = cfg::getByte("CLUI", "firstrun", 1); cfg::dat.langPackCP = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); cfg::dat.realTimeSaving = cfg::getByte("CLUI", "save_pos_always", 0); DWORD sortOrder = cfg::getDword("CList", "SortOrder", SORTBY_NAME); cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder)); cfg::dat.sortOrder[1] = HIBYTE(LOWORD(sortOrder)); cfg::dat.sortOrder[2] = LOBYTE(HIWORD(sortOrder)); if(cfg::dat.bFirstRun) cfg::writeByte("CLUI", "firstrun", 0); if(!cfg::getString(NULL, "CLUI", "exIconOrder", &dbv)) { if(lstrlenA(dbv.pszVal) < EXICON_COUNT) { for(i = 1; i <= EXICON_COUNT; i++) cfg::dat.exIconOrder[i - 1] = i; } else { for(i = 0; i < EXICON_COUNT; i++) if(dbv.pszVal[i] < EXICON_COUNT+1 && dbv.pszVal[i] >0) cfg::dat.exIconOrder[i] = dbv.pszVal[i]; else cfg::dat.exIconOrder[i] = i+1; } DBFreeVariant(&dbv); } else { for(i = 1; i <= EXICON_COUNT; i++) cfg::dat.exIconOrder[i - 1] = i; } ReloadThemedOptions(); FLT_ReadOptions(); Reload3dBevelColors(); himlExtraImages = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 30, 2); ImageList_SetIconSize(himlExtraImages, cfg::dat.exIconScale, cfg::dat.exIconScale); cfg::dat.dwFlags = cfg::getDword("CLUI", "Frameflags", CLUI_FRAME_SHOWTOPBUTTONS | CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN); cfg::dat.dwFlags |= (cfg::getByte("CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0); cfg::dat.soundsOff = cfg::getByte("CLUI", "NoSounds", 0); CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szProfilePath); #if defined(_UNICODE) MultiByteToWideChar(CP_ACP, 0, szProfilePath, MAX_PATH, cfg::dat.tszProfilePath, MAX_PATH); cfg::dat.tszProfilePath[MAX_PATH - 1] = 0; #else mir_sntprintf(cfg::dat.tszProfilePath, MAX_PATH, "%s", szProfilePath); #endif _tcslwr(cfg::dat.tszProfilePath); if(cfg::getByte("Skin", "UseSound", 0) != cfg::dat.soundsOff) cfg::writeByte("Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1)); // get the clist interface pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst); if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) { LBL_Error: MessageBoxA( NULL, "This plugin requires Miranda IM 0.8.0.9 or later", "Fatal error", MB_OK ); return 1; } if ( pcli->version < 6 ) // don't join it with the previous if() goto LBL_Error; pcli->pfnBuildGroupPopupMenu = BuildGroupPopupMenu; pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged; pcli->pfnCompareContacts = CompareContacts; pcli->pfnCreateClcContact = CreateClcContact; pcli->pfnCreateEvent = fnCreateEvent; pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage; pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting; pcli->pfnGetRowBottomY = RowHeight::getItemBottomY; pcli->pfnGetRowHeight = RowHeight::getHeight; pcli->pfnGetRowTopY = RowHeight::getItemTopY; pcli->pfnGetRowTotalHeight = RowHeight::getTotalHeight; pcli->pfnGetWindowVisibleState = GetWindowVisibleState; pcli->pfnHitTest = HitTest; pcli->pfnLoadContactTree = LoadContactTree; pcli->pfnOnCreateClc = LoadCLUIModule; pcli->pfnPaintClc = PaintClc; pcli->pfnRebuildEntireList = RebuildEntireList; pcli->pfnRowHitTest = RowHeight::hitTest; pcli->pfnScrollTo = ScrollTo; pcli->pfnTrayIconUpdateBase = TrayIconUpdateBase; pcli->pfnSetHideOffline = SetHideOffline; pcli->pfnShowHide = ShowHide; saveAddContactToGroup = pcli->pfnAddContactToGroup; pcli->pfnAddContactToGroup = AddContactToGroup; saveRemoveItemFromGroup = pcli->pfnRemoveItemFromGroup; pcli->pfnRemoveItemFromGroup = RemoveItemFromGroup; saveAddEvent = pcli->pfnAddEvent; pcli->pfnAddEvent = AddEvent; saveRemoveEvent = pcli->pfnRemoveEvent; pcli->pfnRemoveEvent = RemoveEvent; saveAddGroup = pcli->pfnAddGroup; pcli->pfnAddGroup = AddGroup; saveAddInfoItemToGroup = pcli->pfnAddInfoItemToGroup; pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup; saveContactListControlWndProc = pcli->pfnContactListControlWndProc; pcli->pfnContactListControlWndProc = ContactListControlWndProc; saveContactListWndProc = pcli->pfnContactListWndProc; pcli->pfnContactListWndProc = ContactListWndProc; saveIconFromStatusMode = pcli->pfnIconFromStatusMode; pcli->pfnIconFromStatusMode = fnIconFromStatusMode; saveLoadClcOptions = pcli->pfnLoadClcOptions; pcli->pfnLoadClcOptions = LoadClcOptions; saveProcessExternalMessages = pcli->pfnProcessExternalMessages; pcli->pfnProcessExternalMessages = ProcessExternalMessages; saveRecalcScrollBar = pcli->pfnRecalcScrollBar; pcli->pfnRecalcScrollBar = RecalcScrollBar; saveTrayIconProcessMessage = pcli->pfnTrayIconProcessMessage; pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage; rc = LoadContactListModule(); if (rc == 0) rc = LoadCLCModule(); HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded); return rc; }
int CMPlugin::Load() { Clist_GetInterface(); coreCli = g_clistApi; API::onInit(); memset(&cfg::dat, 0, sizeof(cfg::dat)); int iCount = db_get_contact_count(); iCount += 20; if (iCount < 300) iCount = 300; cfg::dat.hMenuNotify = CreatePopupMenu(); cfg::dat.wNextMenuID = 1; cfg::dat.sortTimer = db_get_dw(NULL, "CLC", "SortTimer", 150); cfg::dat.avatarBorder = (COLORREF)db_get_dw(NULL, "CLC", "avatarborder", 0); cfg::dat.avatarRadius = (COLORREF)db_get_dw(NULL, "CLC", "avatarradius", 4); cfg::dat.hBrushAvatarBorder = CreateSolidBrush(cfg::dat.avatarBorder); cfg::dat.avatarSize = db_get_w(NULL, "CList", "AvatarSize", 24); cfg::dat.dualRowMode = db_get_b(NULL, "CLC", "DualRowMode", 0); cfg::dat.avatarPadding = db_get_b(NULL, "CList", "AvatarPadding", 0); cfg::dat.isTransparent = db_get_b(NULL, "CList", "Transparent", 0); cfg::dat.alpha = db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT); cfg::dat.autoalpha = db_get_b(NULL, "CList", "AutoAlpha", SETTING_ALPHA_DEFAULT); cfg::dat.fadeinout = db_get_b(NULL, "CLUI", "FadeInOut", 0); cfg::dat.autosize = db_get_b(NULL, "CLUI", "AutoSize", 0); cfg::dat.bNoOfflineAvatars = db_get_b(NULL, "CList", "NoOfflineAV", 1); cfg::dat.bFullTransparent = db_get_b(NULL, "CLUI", "fulltransparent", 0); cfg::dat.bDblClkAvatars = db_get_b(NULL, "CLC", "dblclkav", 0); cfg::dat.bEqualSections = db_get_b(NULL, "CLUI", "EqualSections", 0); cfg::dat.bCenterStatusIcons = db_get_b(NULL, "CLC", "si_centered", 1); cfg::dat.boldHideOffline = -1; cfg::dat.bSecIMAvail = ServiceExists("SecureIM/IsContactSecured") ? 1 : 0; cfg::dat.bNoTrayTips = db_get_b(NULL, "CList", "NoTrayTips", 0); cfg::dat.bShowLocalTime = db_get_b(NULL, "CLC", "ShowLocalTime", 1); cfg::dat.bShowLocalTimeSelective = db_get_b(NULL, "CLC", "SelectiveLocalTime", 1); cfg::dat.bDontSeparateOffline = db_get_b(NULL, "CList", "DontSeparateOffline", 0); cfg::dat.bShowXStatusOnSbar = db_get_b(NULL, "CLUI", "xstatus_sbar", 0); cfg::dat.bLayeredHack = db_get_b(NULL, "CLUI", "layeredhack", 1); cfg::dat.bFirstRun = db_get_b(NULL, "CLUI", "firstrun", 1); cfg::dat.langPackCP = Langpack_GetDefaultCodePage(); cfg::dat.realTimeSaving = db_get_b(NULL, "CLUI", "save_pos_always", 0); DWORD sortOrder = db_get_dw(NULL, "CList", "SortOrder", SORTBY_NAME); cfg::dat.sortOrder[0] = LOBYTE(LOWORD(sortOrder)); cfg::dat.sortOrder[1] = HIBYTE(LOWORD(sortOrder)); cfg::dat.sortOrder[2] = LOBYTE(HIWORD(sortOrder)); if (cfg::dat.bFirstRun) db_set_b(NULL, "CLUI", "firstrun", 0); ReloadThemedOptions(); Reload3dBevelColors(); cfg::dat.dwFlags = db_get_dw(NULL, "CLUI", "Frameflags", CLUI_FRAME_STATUSICONS | CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_BUTTONSFLAT | CLUI_FRAME_CLISTSUNKEN); cfg::dat.dwFlags |= (db_get_b(NULL, "CLUI", "ShowSBar", 1) ? CLUI_FRAME_SBARSHOW : 0); cfg::dat.soundsOff = db_get_b(NULL, "Skin", "UseSound", 1) ? 0 : 1; Profile_GetPathW(MAX_PATH, cfg::dat.tszProfilePath); wcslwr(cfg::dat.tszProfilePath); // get the clist interface g_clistApi.hInst = g_plugin.getInst(); g_clistApi.pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged; g_clistApi.pfnCompareContacts = CompareContacts; g_clistApi.pfnCreateClcContact = CreateClcContact; g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage; g_clistApi.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus; g_clistApi.pfnGetDefaultFontSetting = GetDefaultFontSetting; g_clistApi.pfnGetRowBottomY = RowHeight::getItemBottomY; g_clistApi.pfnGetRowHeight = RowHeight::getHeight; g_clistApi.pfnGetRowTopY = RowHeight::getItemTopY; g_clistApi.pfnGetRowTotalHeight = RowHeight::getTotalHeight; g_clistApi.pfnGetWindowVisibleState = GetWindowVisibleState; g_clistApi.pfnHitTest = HitTest; g_clistApi.pfnOnCreateClc = OnCreateClc; g_clistApi.pfnPaintClc = PaintClc; g_clistApi.pfnRebuildEntireList = RebuildEntireList; g_clistApi.pfnRowHitTest = RowHeight::hitTest; g_clistApi.pfnScrollTo = ScrollTo; g_clistApi.pfnSetHideOffline = SetHideOffline; g_clistApi.pfnShowHide = ShowHide; g_clistApi.pfnAddContactToGroup = AddContactToGroup; g_clistApi.pfnAddEvent = AddEvent; g_clistApi.pfnRemoveEvent = RemoveEvent; g_clistApi.pfnAddGroup = AddGroup; g_clistApi.pfnAddInfoItemToGroup = AddInfoItemToGroup; g_clistApi.pfnContactListControlWndProc = ContactListControlWndProc; g_clistApi.pfnContactListWndProc = ContactListWndProc; g_clistApi.pfnIconFromStatusMode = IconFromStatusMode; g_clistApi.pfnLoadClcOptions = LoadClcOptions; g_clistApi.pfnProcessExternalMessages = ProcessExternalMessages; g_clistApi.pfnRecalcScrollBar = RecalcScrollBar; g_clistApi.pfnTrayIconProcessMessage = TrayIconProcessMessage; int rc = LoadContactListModule(); if (rc == 0) rc = LoadCLCModule(); LoadCLUIModule(); LoadButtonModule(); HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded); return rc; }