int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam) { char* mods[3] = { "Chat", "ChatFonts" }; CallService( "DBEditorpp/RegisterModule", (WPARAM)mods, 2 ); RegisterChatFonts(); OptionsInit(); LoadIcons(); { CLISTMENUITEM mi = { 0 }; mi.cbSize = sizeof(mi); mi.position = -2000090001; mi.flags = CMIF_DEFAULT | CMIF_ICONFROMICOLIB; mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN ); mi.pszName = LPGEN("&Join"); mi.pszService = "GChat/JoinChat"; hJoinMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi); mi.position = -2000090000; mi.flags = CMIF_NOTOFFLINE | CMIF_ICONFROMICOLIB; mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_LEAVE ); mi.pszName = LPGEN("&Leave"); mi.pszService = "GChat/LeaveChat"; hLeaveMenuItem = ( HANDLE )CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi); } CList_SetAllOffline(TRUE, NULL); return 0; }
int Service_Register(WPARAM wParam, LPARAM lParam) { GCREGISTER *gcr = (GCREGISTER *)lParam; MODULEINFO * mi = NULL; if (gcr== NULL) return GC_REGISTER_ERROR; if (gcr->cbSize != SIZEOF_STRUCT_GCREGISTER_V1) return GC_REGISTER_WRONGVER; #ifndef _UNICODE if (gcr->dwFlags & GC_UNICODE) return GC_REGISTER_NOUNICODE; #endif EnterCriticalSection(&cs); mi = MM_AddModule( gcr->pszModule ); if ( mi ) { mi->pszModDispName = mir_strdup( gcr->pszModuleDispName ); mi->bBold = gcr->dwFlags&GC_BOLD; mi->bUnderline = gcr->dwFlags&GC_UNDERLINE ; mi->bItalics = gcr->dwFlags&GC_ITALICS ; mi->bColor = gcr->dwFlags&GC_COLOR ; mi->bBkgColor = gcr->dwFlags&GC_BKGCOLOR ; mi->bAckMsg = gcr->dwFlags&GC_ACKMSG ; mi->bChanMgr = gcr->dwFlags&GC_CHANMGR ; mi->iMaxText= gcr->iMaxText; mi->nColorCount = gcr->nColors; if ( gcr->nColors > 0) { mi->crColors = mir_alloc(sizeof(COLORREF) * gcr->nColors); memcpy(mi->crColors, gcr->pColors, sizeof(COLORREF) * gcr->nColors); } mi->OnlineIconIndex = -1; mi->hOnlineIcon = NULL; mi->hOnlineTalkIcon = NULL; mi->OfflineIconIndex = -1; mi->hOfflineIcon = NULL; mi->hOfflineTalkIcon = NULL; mi->pszHeader = Log_CreateRtfHeader(mi); CheckColorsInModule((char*)gcr->pszModule); CList_SetAllOffline(TRUE); LeaveCriticalSection(&cs); return 0; } LeaveCriticalSection(&cs); return GC_REGISTER_ERROR; }
static INT_PTR Service_Register(WPARAM wParam, LPARAM lParam) { GCREGISTER *gcr = (GCREGISTER *)lParam; MODULEINFO * mi = NULL; if (gcr== NULL) return GC_REGISTER_ERROR; if (gcr->cbSize != SIZEOF_STRUCT_GCREGISTER_V1) return GC_REGISTER_WRONGVER; #ifndef _UNICODE if (gcr->dwFlags & GC_UNICODE) return GC_REGISTER_NOUNICODE; #endif EnterCriticalSection(&cs); mi = MM_AddModule( gcr->pszModule ); if ( mi ) { mi->ptszModDispName = a2tf( gcr->ptszModuleDispName, gcr->dwFlags ); mi->bBold = gcr->dwFlags&GC_BOLD; mi->bUnderline = gcr->dwFlags&GC_UNDERLINE ; mi->bItalics = gcr->dwFlags&GC_ITALICS ; mi->bColor = gcr->dwFlags&GC_COLOR ; mi->bBkgColor = gcr->dwFlags&GC_BKGCOLOR ; mi->bFontSize = gcr->dwFlags&GC_FONTSIZE; mi->bAckMsg = gcr->dwFlags&GC_ACKMSG ; mi->bChanMgr = gcr->dwFlags&GC_CHANMGR ; mi->bSingleFormat = gcr->dwFlags&GC_SINGLEFORMAT; mi->iMaxText= gcr->iMaxText; mi->nColorCount = gcr->nColors; if ( gcr->nColors > 0) { mi->crColors = mir_alloc(sizeof(COLORREF) * gcr->nColors); memcpy(mi->crColors, gcr->pColors, sizeof(COLORREF) * gcr->nColors); } CheckColorsInModule((char*)gcr->pszModule); CList_SetAllOffline(TRUE, gcr->pszModule); LeaveCriticalSection(&cs); return 0; } LeaveCriticalSection(&cs); return GC_REGISTER_ERROR; }
int Chat_Unload(void) { DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX); CList_SetAllOffline(TRUE, NULL); mir_free( pszActiveWndID ); mir_free( pszActiveWndModule ); DestroyHookableEvents(); DestroyMenu(g_hMenu); FreeIcons(); OptionsUnInit(); DeleteCriticalSection(&cs); return 0; }
int Chat_Unload(void) { if (!PluginConfig.m_chat_enabled) return 0; DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX); DBWriteContactSettingWord(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY); CList_SetAllOffline(TRUE, NULL); mir_free(pszActiveWndID); mir_free(pszActiveWndModule); DestroyMenu(g_hMenu); DestroyServiceFunctions(); DestroyHookableEvents(); FreeIcons(); OptionsUnInit(); UnhookEvents(); return 0; }
int __declspec(dllexport) Unload(void) { DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX); DBWriteContactSettingWord(NULL, "Chat", "SplitterY", (WORD)g_Settings.iSplitterY); DBWriteContactSettingDword(NULL, "Chat", "roomx", g_Settings.iX); DBWriteContactSettingDword(NULL, "Chat", "roomy", g_Settings.iY); DBWriteContactSettingDword(NULL, "Chat", "roomwidth" , g_Settings.iWidth); DBWriteContactSettingDword(NULL, "Chat", "roomheight", g_Settings.iHeight); CList_SetAllOffline(TRUE, NULL); mir_free( pszActiveWndID ); mir_free( pszActiveWndModule ); DestroyMenu(g_hMenu); DestroyServiceFunctions(); DestroyHookableEvents(); FreeIcons(); OptionsUnInit(); FreeLibrary(GetModuleHandleA("riched20.dll")); UnhookEvents(); return 0; }
int Chat_ModulesLoaded(WPARAM wParam,LPARAM lParam) { char* mods[3] = { "Chat", "ChatFonts" }; CallService( "DBEditorpp/RegisterModule", (WPARAM)mods, 2 ); AddIcons(); RegisterFonts(); LoadIcons(); // g_hIconsChanged2 = HookEvent(ME_SKIN2_ICONSCHANGED, Chat_IconsChanged); if ( ServiceExists( MS_SMILEYADD_SHOWSELECTION )) { SmileyAddInstalled = TRUE; g_hSmileyOptionsChanged = HookEvent(ME_SMILEYADD_OPTIONSCHANGED, SmileyOptionsChanged); } if ( ServiceExists( MS_POPUP_ADDPOPUPEX )) PopUpInstalled = TRUE; if ( ServiceExists( MS_IEVIEW_WINDOW )) IEviewInstalled = TRUE; CList_SetAllOffline(TRUE); return 0; }