Esempio n. 1
0
void LoadExtraIconsModule()
{
	DWORD ret = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS2, 0);
	clistFirstSlot = HIWORD(ret);
	clistSlotCount = LOWORD(ret);

	// Services
	CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, svcExtraIcon_Add);

	hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
	hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
	hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);

	// Icons
	Icon_Register(g_hInst, LPGEN("Contact list"), iconList, _countof(iconList));

	// Hooks
	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);

	HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, ClistExtraListRebuild);
	HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ClistExtraImageApply);
	HookEvent(ME_CLIST_EXTRA_CLICK, ClistExtraClick);

	DefaultExtraIcons_Load();
}
Esempio n. 2
0
int LoadChatModule(void)
{
	InitializeCriticalSection(&cs);

	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
	HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);

	CreateServiceFunction(MS_GC_REGISTER, Service_Register);
	CreateServiceFunction(MS_GC_NEWSESSION, Service_NewChat);
	CreateServiceFunction(MS_GC_EVENT, Service_AddEvent);
	CreateServiceFunction(MS_GC_GETEVENTPTR, Service_GetAddEventPtr);
	CreateServiceFunction(MS_GC_GETINFO, Service_GetInfo);
	CreateServiceFunction(MS_GC_GETSESSIONCOUNT, Service_GetCount);

	CreateServiceFunction("GChat/DblClickEvent", EventDoubleclicked);
	CreateServiceFunction("GChat/PrebuildMenuEvent", PrebuildContactMenuSvc);
	CreateServiceFunction("GChat/JoinChat", JoinChat);
	CreateServiceFunction("GChat/LeaveChat", LeaveChat);
	CreateServiceFunction("GChat/GetInterface", SvcGetChatManager);

	ci.hSendEvent = CreateHookableEvent(ME_GC_EVENT);
	ci.hBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
	hHookEvent = CreateHookableEvent(ME_GC_HOOK_EVENT);

	HookEvent(ME_FONT_RELOAD, FontsChanged);
	HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);

	bInited = true;
	return 0;
}
Esempio n. 3
0
void LoadPluginOptions()
{
	bOldMode = db_get_b(NULL, "Options", "OldPluginSettings", false) != 0;

	hevLoadModule = CreateHookableEvent(ME_SYSTEM_MODULELOAD);
	hevUnloadModule = CreateHookableEvent(ME_SYSTEM_MODULEUNLOAD);
}
extern "C" FONTSERVICE_API int Load(PLUGINLINK *link)
{
	pluginLink=link;
    memset(&memoryManagerInterface, 0, sizeof(memoryManagerInterface));
    memoryManagerInterface.cbSize = sizeof(memoryManagerInterface);
    CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM) & memoryManagerInterface);

	HookEvent(ME_OPT_INITIALISE, OptInit);

	CreateServiceFunction(MS_FONT_REGISTER, RegisterFont);
	CreateServiceFunction(MS_FONT_GET, GetFont);

	CreateServiceFunction(MS_COLOUR_REGISTER, RegisterColour);
	CreateServiceFunction(MS_COLOUR_GET, GetColour);

	CreateServiceFunction(MS_FONT_REGISTERW, RegisterFontW);
	CreateServiceFunction(MS_FONT_GETW, GetFontW);

	CreateServiceFunction(MS_COLOUR_REGISTERW, RegisterColourW);
	CreateServiceFunction(MS_COLOUR_GETW, GetColourW);

	hFontReloadEvent = CreateHookableEvent(ME_FONT_RELOAD);
	hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);

	if(ServiceExists(MS_LANGPACK_GETCODEPAGE))
		code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);

	// do last for silly dyna plugin
	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
	return 0;
}
Esempio n. 5
0
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;
}
Esempio n. 6
0
int ModulesLoaded(WPARAM, LPARAM)
{
	HookEvent(ME_OPT_INITIALISE, OptInitialise);

	hHookDisplayDataAlert = CreateHookableEvent(ME_DISPLAYDATA_ALERT);
	HookEvent(ME_DISPLAYDATA_ALERT, DataWndAlertCommand);

	hHookAlertPopup = CreateHookableEvent(ME_POPUP_ALERT);
	HookEvent(ME_POPUP_ALERT, PopupAlert);

	hHookErrorPopup = CreateHookableEvent(ME_POPUP_ERROR);
	HookEvent(ME_POPUP_ERROR, ErrorMsgs);

	hHookAlertOSD = CreateHookableEvent(ME_OSD_ALERT);
	HookEvent(ME_OSD_ALERT, OSDAlert);

	FontSettings();
	h_font = CreateFontIndirect(&lf);

	// get data on startup
	if ( db_get_b(NULL, MODULENAME, UPDATE_ONSTART_KEY, 0))
		mir_forkthread(StartUpdate, NULL);

	return 0;
}
Esempio n. 7
0
static void TSAPI InitAPI()
{
	CreateServiceFunction(MS_MSG_SENDMESSAGE,     SendMessageCommand);
	CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand_W);
	CreateServiceFunction(MS_MSG_GETWINDOWAPI,    GetWindowAPI);
	CreateServiceFunction(MS_MSG_GETWINDOWCLASS,  GetWindowClass);
	CreateServiceFunction(MS_MSG_GETWINDOWDATA,   GetWindowData);
	CreateServiceFunction(MS_MSG_SETSTATUSTEXT,   SetStatusText);

	CreateServiceFunction("SRMsg/ReadMessage",    ReadMessageCommand);
	CreateServiceFunction("SRMsg/TypingMessage",  TypingMessageCommand);
	CreateServiceFunction(MS_TABMSG_SETUSERPREFS, SetUserPrefs);
	CreateServiceFunction(MS_TABMSG_TRAYSUPPORT,  Service_OpenTrayMenu);
	CreateServiceFunction(MS_TABMSG_SLQMGR,       CSendLater::svcQMgr);

	CreateServiceFunction(MS_MSG_MOD_GETWINDOWFLAGS, GetMessageWindowFlags);
	CreateServiceFunction(MS_MSG_MOD_MESSAGEDIALOGOPENED, MessageWindowOpened);

	SI_InitStatusIcons();
	CB_InitCustomButtons();

	/*
	 * the event API
	 */

	PluginConfig.m_event_MsgWin = CreateHookableEvent(ME_MSG_WINDOWEVENT);
	PluginConfig.m_event_MsgPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP);
	PluginConfig.m_event_WriteEvent = CreateHookableEvent(ME_MSG_PRECREATEEVENT);
}
Esempio n. 8
0
void LoadExtraIconsModule()
{
	DWORD ret = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS2, 0);
	clistFirstSlot = HIWORD(ret);
	clistSlotCount = LOWORD(ret);

	// Services
	CreateServiceFunction(MS_EXTRAICON_REGISTER, &ExtraIcon_Register);
	CreateServiceFunction(MS_EXTRAICON_SET_ICON, &ExtraIcon_SetIcon);
	CreateServiceFunction(MS_EXTRAICON_SET_ICON_BY_NAME, &ExtraIcon_SetIconByName);

	CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, &svcExtraIcon_Add);

	hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
	hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
	hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);

	// Icons
	Icon_Register(NULL, "Contact List", iconList, SIZEOF(iconList));

	// Hooks
	HookEvent(ME_SYSTEM_MODULESLOADED, &ModulesLoaded);

	HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, &ClistExtraListRebuild);
	HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &ClistExtraImageApply);
	HookEvent(ME_CLIST_EXTRA_CLICK, &ClistExtraClick);

	DefaultExtraIcons_Load();
}
Esempio n. 9
0
extern "C" int __declspec(dllexport) Load(void) 
{
	mir_getLP(&pluginInfoEx);

	// initialize global variables
	InitVar();

	// load options and set defaults
	LoadOptions();

	// reset the weather data at startup for individual contacts
	EraseAllInfo();

	// load weather update data
	LoadWIData(true);

	// set status to online if "Do not display weather condition as protocol status" is enabled
	old_status = status = ID_STATUS_OFFLINE;

	// add an event on weather update and error
	hHookWeatherUpdated = CreateHookableEvent(ME_WEATHER_UPDATED);
	hHookWeatherError = CreateHookableEvent(ME_WEATHER_ERROR);

	// initialize options and network
	HookEvent(ME_OPT_INITIALISE, OptInit);
	HookEvent(ME_SYSTEM_MODULESLOADED, WeatherInit);
	HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
	HookEvent(ME_CLIST_DOUBLECLICKED, BriefInfo);
	HookEvent(ME_WEATHER_UPDATED, WeatherPopup);
	HookEvent(ME_WEATHER_ERROR, WeatherError);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, WeatherShutdown);
	HookEvent(ME_CLIST_PREBUILDCONTACTMENU, BuildContactMenu);

	hDataWindowList = WindowList_Create();
	hWindowList = WindowList_Create();

	hUpdateMutex = CreateMutex(NULL, FALSE, NULL);

	// register weather protocol
	PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
	pd.szName = WEATHERPROTONAME;
	pd.type = (opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL;
	CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);

	// initialize weather protocol services
	InitServices();

	// add sound event
	SkinAddNewSoundExT("weatherupdated", _T(WEATHERPROTONAME), LPGENT("Weather Condition Changed"));
	SkinAddNewSoundExT("weatheralert", _T(WEATHERPROTONAME), LPGENT("Weather Alert Issued"));

	// window needed for popup commands
	TCHAR SvcFunc[100];
	mir_sntprintf(SvcFunc, SIZEOF(SvcFunc), _T("%s__PopupWindow"), _T(WEATHERPROTONAME));
	hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
		CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
	SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
	return 0; 
}
Esempio n. 10
0
int LoadFontserviceModule( void )
{
	code_page = LangPackGetDefaultCodePage();

	HookEvent(ME_OPT_INITIALISE, OptInit);
	HookEvent(ME_MODERNOPT_INITIALIZE, FontsModernOptInit);

	CreateServiceFunction(MS_FONT_REGISTER, RegisterFont);
	CreateServiceFunction(MS_FONT_GET, GetFont);

	CreateServiceFunction(MS_COLOUR_REGISTER, RegisterColour);
	CreateServiceFunction(MS_COLOUR_GET, GetColour);

	CreateServiceFunction(MS_EFFECT_REGISTER, RegisterEffect);
	CreateServiceFunction(MS_EFFECT_GET, GetEffect);

#if defined( _UNICODE )
	CreateServiceFunction(MS_FONT_REGISTERW, RegisterFontW);
	CreateServiceFunction(MS_FONT_GETW, GetFontW);

	CreateServiceFunction(MS_COLOUR_REGISTERW, RegisterColourW);
	CreateServiceFunction(MS_COLOUR_GETW, GetColourW);

	CreateServiceFunction(MS_EFFECT_REGISTERW, RegisterEffectW);
	CreateServiceFunction(MS_EFFECT_GETW, GetEffectW);
#endif

	hFontReloadEvent = CreateHookableEvent(ME_FONT_RELOAD);
	hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);

	// cretae generic fonts
	FontIDT fontid = {0};

	fontid.cbSize = sizeof(FontID);
	strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
	_tcsncpy(fontid.group, _T("General"), SIZEOF(fontid.group));

	_tcsncpy(fontid.name, _T("Headers"), SIZEOF(fontid.name));
	fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
	strncpy(fontid.prefix, "Header", SIZEOF(fontid.prefix));
	fontid.order = 0;
	CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0);

	_tcsncpy(fontid.name, _T("Generic text"), SIZEOF(fontid.name));
	fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
	strncpy(fontid.prefix, "Generic", SIZEOF(fontid.prefix));
	fontid.order = 0;
	CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0);

	_tcsncpy(fontid.name, _T("Small text"), SIZEOF(fontid.name));
	fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
	strncpy(fontid.prefix, "Small", SIZEOF(fontid.prefix));
	fontid.order = 0;
	CallService(MS_FONT_REGISTERT, (WPARAM)&fontid, 0);

	// do last for silly dyna plugin
	HookEvent(ME_SYSTEM_PRESHUTDOWN,   OnPreShutdown);
	return 0;
}
Esempio n. 11
0
static HRESULT CreateHookableEvents()
{
	g_CluiData.hEventBkgrChanged = CreateHookableEvent(ME_BACKGROUNDCONFIG_CHANGED);
	g_CluiData.hEventStatusBarShowToolTip = CreateHookableEvent(ME_CLIST_FRAMES_SB_SHOW_TOOLTIP);
	g_CluiData.hEventStatusBarHideToolTip = CreateHookableEvent(ME_CLIST_FRAMES_SB_HIDE_TOOLTIP);
	g_CluiData.hEventSkinServicesCreated = CreateHookableEvent(ME_SKIN_SERVICESCREATED);
	return S_OK;
}
void LoadExtraImageFunc()
{
	CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON,SetIconForExtraColumn); 
	CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON,AddIconToExtraImageList); 

	hExtraImageListRebuilding=CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
	hExtraImageApplying=CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
	hExtraImageClick=CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
	HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
}
void CAVSessionController::Initialize(void)
{
    MTLASSERT(0 == m_hCallStateChanged);

    char eventName[300];
    mir_snprintf(eventName, sizeof(eventName), "%s%s", g_env.ProtocolName(), ME_SIPRTC_CALL_STATE_CHANGED);
    m_hCallStateChanged = CreateHookableEvent(eventName);
    mir_snprintf(eventName, sizeof(eventName), "%s%s", g_env.ProtocolName(), PE_VOICE_CALL_STATE);
    m_hVoiceStateEvent = CreateHookableEvent(eventName);
}
Esempio n. 14
0
void Core_Mainloop_Init()
{
	hMainLoopInnerBefore = CreateHookableEvent(EVENT_CORE_MAINLOOP_BEFORE);
	hMainLoopInnerAfter = CreateHookableEvent(EVENT_CORE_MAINLOOP_AFTER);

	if (hMainLoopInnerBefore && hMainLoopInnerAfter) {
		SetHookInitializer(hMainLoopInnerBefore, HookFunctions);
		SetHookInitializer(hMainLoopInnerAfter, HookFunctions);
	}
}
Esempio n. 15
0
int InitContacts(void)
{
	CreateServiceFunction(MS_DB_CONTACT_GETCOUNT,GetContactCount);
	CreateServiceFunction(MS_DB_CONTACT_FINDFIRST,FindFirstContact);
	CreateServiceFunction(MS_DB_CONTACT_FINDNEXT,FindNextContact);
	CreateServiceFunction(MS_DB_CONTACT_DELETE,DeleteContact);
	CreateServiceFunction(MS_DB_CONTACT_ADD,AddContact);
	CreateServiceFunction(MS_DB_CONTACT_IS,IsDbContact);
	hContactDeletedEvent=CreateHookableEvent(ME_DB_CONTACT_DELETED);
	hContactAddedEvent=CreateHookableEvent(ME_DB_CONTACT_ADDED);
	return 0;
}
Esempio n. 16
0
void CB_InitCustomButtons()
{
	dwSepCount = M.GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);

	hButtonsBarAddButton = CreateServiceFunction(MS_BB_ADDBUTTON, CB_AddButton);
	hButtonsBarRemoveButton = CreateServiceFunction(MS_BB_REMOVEBUTTON, CB_RemoveButton);
	hButtonsBarModifyButton = CreateServiceFunction(MS_BB_MODIFYBUTTON, CB_ModifyButton);
	hButtonsBarGetButtonState = CreateServiceFunction(MS_BB_GETBUTTONSTATE, CB_GetButtonState);
	hButtonsBarSetButtonState = CreateServiceFunction(MS_BB_SETBUTTONSTATE, CB_SetButtonState);

	hHookToolBarLoadedEvt = CreateHookableEvent(ME_MSG_TOOLBARLOADED);
	hHookButtonPressedEvt = CreateHookableEvent(ME_MSG_BUTTONPRESSED);
}
Esempio n. 17
0
int LoadFontserviceModule(void)
{
	code_page = Langpack_GetDefaultCodePage();

	CreateServiceFunction("Font/Register", RegisterFont);
	CreateServiceFunction("Font/RegisterW", RegisterFontW);
	CreateServiceFunction(MS_FONT_GET, GetFont);
	CreateServiceFunction(MS_FONT_GETW, GetFontW);

	CreateServiceFunction("Colour/Register", RegisterColour);
	CreateServiceFunction("Colour/RegisterW", RegisterColourW);
	CreateServiceFunction(MS_COLOUR_GET, GetColour);
	CreateServiceFunction(MS_COLOUR_GETW, GetColourW);

	CreateServiceFunction("Effect/Register", RegisterEffect);
	CreateServiceFunction("Effect/RegisterW", RegisterEffectW);
	CreateServiceFunction(MS_EFFECT_GET, GetEffect);
	CreateServiceFunction(MS_EFFECT_GETW, GetEffectW);

	CreateServiceFunction(MS_FONT_RELOAD, ReloadFonts);
	CreateServiceFunction(MS_COLOUR_RELOAD, ReloadColours);

	hFontReloadEvent = CreateHookableEvent(ME_FONT_RELOAD);
	hColourReloadEvent = CreateHookableEvent(ME_COLOUR_RELOAD);

	// create generic fonts
	FontIDT fontid = { sizeof(fontid) };
	strncpy(fontid.dbSettingsGroup, "Fonts", sizeof(fontid.dbSettingsGroup));
	_tcsncpy_s(fontid.group, LPGENT("General"), _TRUNCATE);

	_tcsncpy_s(fontid.name, LPGENT("Headers"), _TRUNCATE);
	fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
	strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
	FontRegisterT(&fontid);

	_tcsncpy_s(fontid.name, LPGENT("Generic text"), _TRUNCATE);
	fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
	strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
	FontRegisterT(&fontid);

	_tcsncpy_s(fontid.name, LPGENT("Small text"), _TRUNCATE);
	fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
	strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
	FontRegisterT(&fontid);

	// do last for silly dyna plugin
	HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
	return 0;
}
Esempio n. 18
0
int LoadSendRecvMessageModule(void)
{
	if (LoadLibraryA("Msftedit.dll") == NULL) {
		if (IDYES != MessageBox(0, TranslateTS(tszError), TranslateT("Information"), MB_YESNO | MB_ICONINFORMATION))
			return 1;
		return 0;
	}

	InitGlobals();
	RichUtil_Load();
	InitOptions();

	HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, MessageSettingChanged);
	HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
	HookEvent(ME_SYSTEM_MODULESLOADED, SplitmsgModulesLoaded);
	HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);
	HookEvent(ME_PROTO_CONTACTISTYPING, TypingMessage);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreshutdownSendRecv);
	HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);

	CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
	CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W);
	CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI);
	CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass);
	CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData);
	CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);
	CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);

	hHookWinEvt = CreateHookableEvent(ME_MSG_WINDOWEVENT);
	hHookWinPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP);
	hHookWinWrite = CreateHookableEvent(ME_MSG_PRECREATEEVENT);

	SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (focused window)"));
	SkinAddNewSoundEx("RecvMsgInactive", LPGEN("Instant messages"), LPGEN("Incoming (unfocused window)"));
	SkinAddNewSoundEx("AlertMsg", LPGEN("Instant messages"), LPGEN("Incoming (new session)"));
	SkinAddNewSoundEx("SendMsg", LPGEN("Instant messages"), LPGEN("Outgoing"));
	SkinAddNewSoundEx("SendError", LPGEN("Instant messages"), LPGEN("Message send error"));
	SkinAddNewSoundEx("TNStart", LPGEN("Instant messages"), LPGEN("Contact started typing"));
	SkinAddNewSoundEx("TNStop", LPGEN("Instant messages"), LPGEN("Contact stopped typing"));

	hCurSplitNS = LoadCursor(NULL, IDC_SIZENS);
	hCurSplitWE = LoadCursor(NULL, IDC_SIZEWE);
	hCurHyperlinkHand = LoadCursor(NULL, IDC_HAND);
	if (hCurHyperlinkHand == NULL)
		hCurHyperlinkHand = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_HYPERLINKHAND));

	InitStatusIcons();
	return 0;
}
Esempio n. 19
0
void InitPlugin()
{
	//DebugBreak();
	logFile = fopen(logFileName, "w");
	fprintf(logFile, "NWN Client Extender 0.1 - Test plugin\n");
	fprintf(logFile, "(c) 2010 by virusman\n");
	fflush(logFile);
	if(pluginLink){
		hAppendMsg = CreateHookableEvent("NWClient/GUI/AppendToMsgBuffer");
		hClientPostInit = CreateHookableEvent("NWClient/ExoApp/Initialized");
		CreateServiceFunction("NWClient/GUI/AppendToMsgBuffer", ShowLogMessage);
	}
	HookFunctions();

}
Esempio n. 20
0
void InitShutdownSvc(void)
{
	/* Shutdown Dialog */
	hwndShutdownDlg = NULL;
	SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENT("Alerts"), LPGENT("Automatic Shutdown Countdown"));

	/* Events */
	hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
	hEventShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_SHUTDOWN);

	/* Services */
	CreateServiceFunction(MS_AUTOSHUTDOWN_SHUTDOWN, ServiceShutdown);
	CreateServiceFunction(MS_AUTOSHUTDOWN_ISTYPEENABLED, ServiceIsTypeEnabled);
	CreateServiceFunction(MS_AUTOSHUTDOWN_GETTYPEDESCRIPTION, ServiceGetTypeDescription);
}
Esempio n. 21
0
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
	char text[_MAX_PATH];
	char *p, *q;
	GetModuleFileName(hInst, text, sizeof(text));
	p = strrchr(text, '\\');
	p++;
	q = strrchr(p, '.');
	*q = '\0';
	muccModuleName = _strdup(p);
	_strupr(muccModuleName);

	pluginLink = link;
	/*
	**	HookEvent(ME_OPT_INITIALISE, TlenOptInit);
	*/
	HookEvent(ME_OPT_INITIALISE, MUCCOptInit);
	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);

	CreateServiceFunction(MS_MUCC_QUERY_RESULT, MUCCQueryResult);
	CreateServiceFunction(MS_MUCC_NEW_WINDOW, MUCCNewWindow);
	CreateServiceFunction(MS_MUCC_EVENT, MUCCEvent);
	hHookEvent = CreateHookableEvent(ME_MUCC_EVENT);

	LoadIcons();
	return 0;
}
Esempio n. 22
0
HANDLE CJabberProto::JCreateHookableEvent( const char* szService )
{
	char str[ MAXMODULELABELLENGTH ];
	strcpy( str, m_szModuleName );
	strcat( str, szService );
	return CreateHookableEvent( str );
}
Esempio n. 23
0
CDropbox::CDropbox() : transfers(1, HandleKeySortT)
{
	PROTOCOLDESCRIPTOR pd = { 0 };
	pd.cbSize = sizeof(pd);
	pd.szName = MODULE;
	pd.type = PROTOTYPE_VIRTUAL;
	Proto_RegisterModule(&pd);

	HookEvent(ME_PROTO_ACK, OnProtoAck);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
	HookEventObj(ME_SYSTEM_MODULESLOADED, GlobalEvent<&CDropbox::OnModulesLoaded>, this);

	hFileSentEventHook = CreateHookableEvent(ME_DROPBOX_SENT);

	CreateServiceFunctionObj(MS_DROPBOX_SEND_FILE, GlobalService<&CDropbox::SendFileToDropbox>, this);

	CreateProtoServiceFunction(MODULE, PS_GETCAPS, ProtoGetCaps);
	CreateProtoServiceFunction(MODULE, PS_GETNAME, ProtoGetName);
	CreateProtoServiceFunction(MODULE, PS_LOADICON, ProtoLoadIcon);
	CreateProtoServiceFunctionObj(PS_GETSTATUS, GlobalService<&CDropbox::ProtoGetStatus>, this);
	CreateProtoServiceFunctionObj(PSS_FILE, GlobalService<&CDropbox::ProtoSendFile>, this);
	CreateProtoServiceFunctionObj(PSS_FILECANCEL, GlobalService<&CDropbox::ProtoCancelFile>, this);
	CreateProtoServiceFunctionObj(PSS_MESSAGE, GlobalService<&CDropbox::ProtoSendMessage>, this);
	CreateProtoServiceFunction(MODULE, PSR_MESSAGE, ProtoReceiveMessage);

	InitializeMenus();

	hFileProcess = hMessageProcess = 1;
}
Esempio n. 24
0
int InitStatusIcons()
{
	HookEvent(ME_MSG_ICONSCHANGED, OnSrmmIconChanged);

	hHookIconPressedEvt = CreateHookableEvent(ME_MSG_ICONPRESSED);
	return 0;
}
Esempio n. 25
0
int CMsnProto::OnModulesLoaded(WPARAM, LPARAM)
{
	if (msnHaveChatDll) 
	{
		GCREGISTER gcr = {0};
		gcr.cbSize = sizeof(GCREGISTER);
		gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR | GC_TCHAR;
		gcr.iMaxText = 0;
		gcr.nColors = 16;
		gcr.pColors = (COLORREF*)crCols;
		gcr.ptszModuleDispName = m_tszUserName;
		gcr.pszModule = m_szModuleName;
		CallServiceSync(MS_GC_REGISTER, 0, (LPARAM)&gcr);

		HookProtoEvent(ME_GC_EVENT, &CMsnProto::MSN_GCEventHook);
		HookProtoEvent(ME_GC_BUILDMENU, &CMsnProto::MSN_GCMenuHook);

		char szEvent[200];
		mir_snprintf(szEvent, sizeof szEvent, "%s\\ChatInit", m_szModuleName);
		hInitChat = CreateHookableEvent(szEvent);
		HookProtoEvent(szEvent, &CMsnProto::MSN_ChatInit);
	}

	HookProtoEvent(ME_IDLE_CHANGED, &CMsnProto::OnIdleChanged);
	InitPopups();
	return 0;
}
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
	char text[_MAX_PATH];
	char *p, *q;

	int wdsize = GetCurrentDirectory(0, NULL);
	workingDir = new TCHAR[wdsize];
	GetCurrentDirectory(wdsize, workingDir);
	Utils::convertPath(workingDir);

	GetModuleFileNameA(hInstance, text, sizeof(text));
	p = strrchr(text, '\\');
	p++;
	q = strrchr(p, '.');
	*q = '\0';
	ieviewModuleName = _strdup(p);
	_strupr(ieviewModuleName);

	pluginLink = link;

	HookEvent(ME_OPT_INITIALISE, IEViewOptInit);
	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);

	CreateServiceFunction(MS_IEVIEW_WINDOW, HandleIEWindow);
	CreateServiceFunction(MS_IEVIEW_EVENT, HandleIEEvent);
	CreateServiceFunction(MS_IEVIEW_EVENT, HandleIENavigate);

	hHookOptionsChanged = CreateHookableEvent(ME_IEVIEW_OPTIONSCHANGED);

	return 0;
}
Esempio n. 27
0
CDropbox::CDropbox()
{
	PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
	pd.szName = MODULE;
	pd.type = PROTOTYPE_VIRTUAL;
	CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);

	HookEventObj(ME_PROTO_ACK, OnProtoAck, this);
	HookEventObj(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown, this);
	HookEventObj(ME_SYSTEM_MODULESLOADED, OnModulesLoaded, this);

	hFileSentEventHook = CreateHookableEvent(ME_DROPBOX_SENT);

	CreateServiceFunctionObj(MS_DROPBOX_SEND_FILE, SendFileToDropbox, this);

	CreateProtoServiceFunction(MODULE, PS_GETCAPS, ProtoGetCaps);
	CreateProtoServiceFunctionObj(PSS_FILEW, ProtoSendFile, this);
	CreateProtoServiceFunctionObj(PSS_MESSAGE, ProtoSendMessage, this);
	CreateProtoServiceFunctionObj(PSR_MESSAGE, ProtoReceiveMessage, this);

	InitializeIcons();
	InitializeMenus();

	commands["help"] = CDropbox::CommandHelp;
	commands["content"] = CDropbox::CommandContent;
	commands["share"] = CDropbox::CommandShare;
	commands["delete"] = CDropbox::CommandDelete;

	hFileProcess = hMessageProcess = 1;
	hDefaultContact = hTransferContact = 0;
}
Esempio n. 28
0
void CreatePluginServices()
{
	// general
	CreateServiceFunction(PLUG "/Ping", PluginPing);
	CreateServiceFunction(PLUG "/DblClick", DblClick);

	// list
	CreateServiceFunction(PLUG "/ClearPingList", ClearPingList);
	CreateServiceFunction(PLUG "/GetPingList", GetPingList);
	CreateServiceFunction(PLUG "/SetPingList", SetPingList);
	CreateServiceFunction(PLUG "/SetAndSavePingList", SetAndSavePingList);
	CreateServiceFunction(PLUG "/LoadPingList", LoadPingList);
	CreateServiceFunction(PLUG "/SavePingList", SavePingList);

	reload_event_handle = CreateHookableEvent(PLUG "/ListReload");

	//log
	CreateServiceFunction(PLUG "/Log", Log);
	CreateServiceFunction(PLUG "/ViewLogData", ViewLogData);
	CreateServiceFunction(PLUG "/GetLogFilename", GetLogFilename);
	CreateServiceFunction(PLUG "/SetLogFilename", SetLogFilename);

	// menu
	CreateServiceFunction(PLUG "/DisableAll", PingDisableAll);
	CreateServiceFunction(PLUG "/EnableAll", PingEnableAll);
	CreateServiceFunction(PLUG "/ToggleEnabled", ToggleEnabled);
	CreateServiceFunction(PLUG "/ShowGraph", ShowGraph);
	CreateServiceFunction(PLUG "/Edit", EditContact);

}
Esempio n. 29
0
int LoadAutoAwayModule(void)
{
	hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED,InitVariables);
	hIdleEvent = CreateHookableEvent(ME_IDLE_CHANGED);
	hHooks[1] = HookEvent(ME_OPT_INITIALISE,AutoAwayOptInitialise);
	MyGetLastInputInfo=(BOOL (WINAPI *)(PLASTINPUTINFO)) GetProcAddress( GetModuleHandleA("user32"),"GetLastInputInfo" );
	// load settings into live ones
	idleOpts = idleOptsPerm=db_get_dw(NULL, AA_MODULE,AA_IDLEOPTIONS,idleOptsDefault);
//	if ((idleOptsPerm&IdleSuppressIdleMenu)==0) AddIdleMenu();
//	idleCheckPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLECHECK, 0);
//	idleMethodPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLEMETHOD, 0);
//	idleGLIPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLEGLI, 1);
//	idleTimeFirstPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLETIME1ST, 10);
//	idleTimeSecondPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLETIME2ND, 30);
//	idleTimeFirstOnPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLETIME1STON, 0);
//	idleTimeSecondOnPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLETIME2NDON, 0);
//	idleOnSaverPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLEONSAVER, 0);
//	idleOnLockPerm = db_get_b(NULL, IDLEMODULE, IDL_IDLEONLOCK, 0);
//	idlePrivatePerm = db_get_b(NULL, IDLEMODULE, IDL_IDLEPRIVATE, 0);
	hService[0] = CreateServiceFunction(MS_IDLE_GETIDLEINFO, IdleGetInfo);

	hHooks[2] = HookEvent(ME_SYSTEM_SHUTDOWN,AutoAwayShutdown);
	hHooks[3] = HookEvent(ME_IDLE_CHANGED, AutoAwayEvent);
	hHooks[4] = HookEvent(ME_CLIST_STATUSMODECHANGE,StatusModeChangeEvent);
	hHooks[5] = HookEvent(ME_PROTO_ACK, ProtoAckEvent);

	hService[1] = CreateServiceFunction(AA_IDLE_BENOTIDLESERVICE,(MIRANDASERVICE)idleServiceNotIdle);
	hService[2] = CreateServiceFunction(AA_IDLE_BESHORTIDLESERVICE,(MIRANDASERVICE)idleServiceShortIdle);
	hService[3] = CreateServiceFunction(AA_IDLE_BELONGIDLESERVICE,(MIRANDASERVICE)idleServiceLongIdle);
	hService[4] = CreateServiceFunction(AA_IDLE_RECONNECTSERVICE,(MIRANDASERVICE)reconnectService);
	return 0;
}
Esempio n. 30
0
void InitServices() {

	InitializeCriticalSection(&list_cs);

	int i = 0;
	hService[i++] = CreateServiceFunction(MS_UPDATE_REGISTER, Register);
	hService[i++] = CreateServiceFunction(MS_UPDATE_REGISTERFL, RegisterFL);
	hService[i++] = CreateServiceFunction(MS_UPDATE_UNREGISTER, Unregister);
	hService[i++] = CreateServiceFunction(MS_UPDATE_CHECKFORUPDATESTRGR, CheckForUpdatesTrgr);
	hService[i++] = CreateServiceFunction(MS_UPDATE_CHECKFORUPDATES, CheckForUpdates);
	hService[i++] = CreateServiceFunction(MS_UPDATE_SETUPDATEOPTIONS, SetUpdateOptions);
	hService[i++] = CreateServiceFunction(MS_UPDATE_GETUPDATEOPTIONS, GetUpdateOptions);
	hService[i++] = CreateServiceFunction(MS_UPDATE_ENUMERATE, EnumerateUpdates);
	hService[i++] = CreateServiceFunction(MS_UPDATE_ENABLESTATUSCONTROL, EnableStatusControl);
	hService[i++] = CreateServiceFunction(MS_UPDATE_MENURESTART, Restart);
	hService[i++] = CreateServiceFunction(MS_UPDATE_MENUUPDATEANDEXIT, UpdateAndExit);
	hService[i++] = CreateServiceFunction(MS_UPDATE_MENUCHECKFORUPDATES, CheckForUpdates);
	hService[i++] = CreateServiceFunction(MS_UPDATE_ISUPDATESUPPORTED, IsUpdateSupported);

	hStartupDone = CreateHookableEvent(ME_UPDATE_STARTUPDONE);

	hEventPreShutDown = HookEvent(ME_SYSTEM_PRESHUTDOWN, ServicesPreShutdown);

	daily_timer_id = SetTimer(0, 0, 24 * 60 * 60 * 1000, CheckTimerProcDaily);

	hEventServicesModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ServicesModulesLoaded);
}