int LoadCLCModule(void) { bModuleInitialized = true; g_IconWidth = g_iIconSX; g_IconHeight = g_iIconSY; hClcWindowList = WindowList_Create(); hShowInfoTipEvent = CreateHookableEvent(ME_CLC_SHOWINFOTIP); hHideInfoTipEvent = CreateHookableEvent(ME_CLC_HIDEINFOTIP); CreateServiceFunction(MS_CLC_SETINFOTIPHOVERTIME, SetInfoTipHoverTime); CreateServiceFunction(MS_CLC_GETINFOTIPHOVERTIME, GetInfoTipHoverTime); InitFileDropping(); arEvents.insert(HookEvent(ME_SYSTEM_MODULESLOADED, ClcModulesLoaded)); arEvents.insert(HookEvent(ME_PROTO_ACCLISTCHANGED, ClcAccountsChanged)); arEvents.insert(HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ClcSettingChanged)); arEvents.insert(HookEvent(ME_DB_CONTACT_ADDED, ClcContactAdded)); arEvents.insert(HookEvent(ME_DB_CONTACT_DELETED, ClcContactDeleted)); arEvents.insert(HookEvent(ME_CLIST_CONTACTICONCHANGED, ClcContactIconChanged)); arEvents.insert(HookEvent(ME_SKIN_ICONSCHANGED, ClcIconsChanged)); arEvents.insert(HookEvent(ME_PROTO_ACK, ClcProtoAck)); InitCustomMenus(); return 0; }
static int OnModulesLoded(WPARAM wParam, LPARAM lParam) { HookEvent(ME_CLIST_CONTACTICONCHANGED, OnContactIconChanged); HookEvent(ME_SKIN_ICONSCHANGED, OnSkinIconsChanged); HookEvent(ME_CLUI_CONTACTDRAGGING, OnContactDrag); HookEvent(ME_CLUI_CONTACTDROPPED, OnContactDrop); HookEvent(ME_CLUI_CONTACTDRAGSTOP, OnContactDragStop); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged); HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted); HookEvent(ME_OPT_INITIALISE, OnOptionsInitialize); HookEvent(ME_CLIST_STATUSMODECHANGE, OnStatusModeChange); HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu); hwndMiranda = (HWND)CallService(MS_CLUI_GETHWND, 0, 0); mir_subclassWindow(hwndMiranda, newMirandaWndProc); // No thumbs yet bEnableTip = ServiceExists("mToolTip/ShowTip"); RegisterWindowClass(); InitFileDropping(); GetScreenRect(); LoadDBSettings(); CreateBackgroundBrush(); CreateThumbsFont(); LoadContacts(); LoadMenus(); if (fcOpt.bToTop) { fcOpt.ToTopTime = (fcOpt.ToTopTime<1)?1:fcOpt.ToTopTime; fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime; ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc); } return 0; }