当前位置: 首页>>代码示例>>C++>>正文


C++ ProtoCallService函数代码示例

本文整理汇总了C++中ProtoCallService函数的典型用法代码示例。如果您正苦于以下问题:C++ ProtoCallService函数的具体用法?C++ ProtoCallService怎么用?C++ ProtoCallService使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ProtoCallService函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AuthDeny

	int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason)
	{
		if (m_iVersion > 1)
			return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, (LPARAM)szReason);

		return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, hDbEvent, _T2A(szReason));
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:7,代码来源:proto_internal.cpp

示例2: SearchBasic

	HANDLE __cdecl SearchBasic(const TCHAR* id)
	{
		if (m_iVersion > 1)
			return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)id);

		return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, _T2A(id));
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:7,代码来源:proto_internal.cpp

示例3: FileAllow

	HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
	{
		CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
		if (m_iVersion > 1)
			return (HANDLE)ProtoCallService(m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs);

		ccs.lParam = (LPARAM)mir_t2a(szPath);
		HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs);
		mir_free((char*)ccs.lParam);
		return res;
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:11,代码来源:proto_internal.cpp

示例4: AuthRequest

	int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage)
	{
		CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
		if (m_iVersion > 1)
			return (int)ProtoCallService(m_szModuleName, PSS_AUTHREQUEST, 0, (LPARAM)&ccs);

		ccs.lParam = (LPARAM)mir_t2a(szMessage);
		int res = (int)ProtoCallService(m_szModuleName, PSS_AUTHREQUEST, 0, (LPARAM)&ccs);
		mir_free((char*)ccs.lParam);
		return res;
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:11,代码来源:proto_internal.cpp

示例5: FileDeny

	int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason)
	{
		CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
		if (m_iVersion > 1)
			return (int)ProtoCallService(m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs);

		ccs.lParam = (LPARAM)mir_t2a(szReason);
		int res = (int)ProtoCallService(m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs);
		mir_free((char*)ccs.lParam);
		return res;
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:11,代码来源:proto_internal.cpp

示例6: FileResume

	int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
	{
		PROTOFILERESUME pfr = { *action, *szFilename };
		if (m_iVersion > 1)
			return (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);

		pfr.szFilename = (TCHAR*)mir_t2a(pfr.szFilename);
		int res = (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
		mir_free((TCHAR*)*szFilename);
		*action = pfr.action; *szFilename = (TCHAR*)pfr.szFilename;

		return res;
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:13,代码来源:proto_internal.cpp

示例7: SendFile

	HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
	{
		CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };

		if (m_iVersion > 1)
			return (HANDLE)ProtoCallService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);

		ccs.wParam = (WPARAM)mir_t2a(szDescription);
		ccs.lParam = (LPARAM)Proto_FilesMatrixA(ppszFiles);
		HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
		if (res == 0) FreeFilesMatrix((TCHAR***)&ccs.lParam);
		mir_free((char*)ccs.wParam);
		return res;
	}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:14,代码来源:proto_internal.cpp

示例8: SearchByName

	HANDLE __cdecl SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName)
	{
		PROTOSEARCHBYNAME psn;
		psn.pszNick = (PROTOCHAR*)mir_t2a(nick);
		psn.pszFirstName = (PROTOCHAR*)mir_t2a(firstName);
		psn.pszLastName = (PROTOCHAR*)mir_t2a(lastName);
		HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYNAME, 0, (LPARAM)&psn);
		mir_free(psn.pszNick);
		mir_free(psn.pszFirstName);
		mir_free(psn.pszLastName);
		return res;

	}
开发者ID:martok,项目名称:miranda-ng,代码行数:13,代码来源:protoint.cpp

示例9: StartSmsSend

//This function gets HWND of the window, the number, and the message.
void StartSmsSend(HWND hWndDlg,SIZE_T dwModuleIndex,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,LPWSTR lpwszMessage,SIZE_T dwMessageSize)
{
	if (ssSMSSettings.ppaSMSAccounts && dwModuleIndex!=-1 && dwModuleIndex<ssSMSSettings.dwSMSAccountsCount)
	{
		LPSTR lpszMessageUTF;
		LPWSTR lpwszMessageXMLEncoded;
		SIZE_T dwMessageUTFBuffSize,dwMessageXMLEncodedSize,dwBuffSize;
		DBEVENTINFO *pdbei;

		dwMessageXMLEncodedSize=((dwMessageSize+MAX_PATH)*sizeof(WCHAR)*6);
		lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC(dwMessageXMLEncodedSize);
		if (lpwszMessageXMLEncoded)
		{
			EncodeXML(lpwszMessage,dwMessageSize,lpwszMessageXMLEncoded,(dwMessageXMLEncodedSize/sizeof(WCHAR)),&dwMessageXMLEncodedSize);

			dwMessageUTFBuffSize=(dwMessageXMLEncodedSize+MAX_PATH);
			lpszMessageUTF=(LPSTR)MEMALLOC(dwMessageUTFBuffSize);
			if (lpszMessageUTF)
			{
				dwBuffSize=(dwPhoneSize+MAX_PATH+WideCharToMultiByte(CP_UTF8,0,lpwszMessage,dwMessageSize,lpszMessageUTF,dwMessageUTFBuffSize,NULL,NULL));
				pdbei=(DBEVENTINFO*)MEMALLOC((sizeof(DBEVENTINFO)+dwBuffSize));
				if (pdbei)
				{
					char szPhone[MAX_PHONE_LEN];
					LPSTR lpszBuff=(LPSTR)(pdbei+1);
					HANDLE hProcess;

					WideCharToMultiByte(CP_UTF8,0,lpwszPhone,dwPhoneSize,szPhone,MAX_PHONE_LEN,NULL,NULL);
					dwPhoneSize=CopyNumberA(szPhone,szPhone,dwPhoneSize);

					pdbei->timestamp=time(NULL);
					pdbei->flags=(DBEF_SENT|DBEF_UTF);
					pdbei->eventType=ICQEVENTTYPE_SMS;
					pdbei->cbBlob=(mir_snprintf(lpszBuff,dwBuffSize,"SMS To: +%s\r\n%s",szPhone,lpszMessageUTF)+4);
					pdbei->pBlob=(PBYTE)lpszBuff;
					SendSMSWindowDbeiSet(hWndDlg,pdbei);

					char *szProto = ssSMSSettings.ppaSMSAccounts[dwModuleIndex]->szModuleName;
					if ( ProtoServiceExists(szProto, MS_ICQ_SENDSMS)) {
						WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpszMessageUTF,dwMessageUTFBuffSize,NULL,NULL);
						hProcess = (HANDLE)ProtoCallService(szProto, MS_ICQ_SENDSMS, (WPARAM)szPhone,(LPARAM)lpszMessageUTF);
						SendSMSWindowHProcessSet(hWndDlg,hProcess);
					}
					else MEMFREE(pdbei);
				}
				MEMFREE(lpszMessageUTF);
			}
			MEMFREE(lpwszMessageXMLEncoded);
		}
	}
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:52,代码来源:send.cpp

示例10: MIRANDA_HOOK_EVENT

MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
{
	HANDLE hDbEvent = (HANDLE)lParam;

	DBEVENTINFO dbei = {0};
	dbei.cbSize = sizeof(dbei);
	dbei.cbBlob = db_event_getBlobSize(hDbEvent);
	if (-1 == dbei.cbBlob)
		return 0;

	mir_ptr<BYTE> blob((LPBYTE)mir_alloc(dbei.cbBlob));
	dbei.pBlob = blob;
	db_event_get(hDbEvent, &dbei);

	// if event is in protocol that is not despammed
	if (plSets->ProtoDisabled(dbei.szModule))
		return 0;

	// event is an auth request
	if (!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST) {
		MCONTACT hcntct = DbGetAuthEventContact(&dbei);

		// if request is from unknown or not marked Answered contact
		//and if I don't sent message to this contact
		if (db_get_b(hcntct, "CList", "NotOnList", 0) && !db_get_b(hcntct, pluginName, answeredSetting, 0) && !IsExistMyMessage(hcntct)) {
			if (!plSets->HandleAuthReq.Get()) {
				char *buf = mir_utf8encodeW(variables_parse(plSets->AuthRepl.Get(), hcntct).c_str());
				CallContactService(hcntct, PSS_MESSAGE, PREF_UTF, (LPARAM)buf);
				mir_free(buf);
			}

			// ...send message
			char *AuthRepl = mir_u2a(variables_parse(plSets->AuthRepl.Get(), hcntct).c_str());
			ProtoCallService(dbei.szModule, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)AuthRepl);
			mir_free(AuthRepl);

			db_set_b(hcntct, "CList", "NotOnList", 1);
			db_set_b(hcntct, "CList", "Hidden", 1);
			if (!plSets->HistLog.Get())
				db_event_delete(0, hDbEvent);
			return 1;
		}
	}
	return 0;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:45,代码来源:events.cpp

示例11: ChangeAllProtoStatuses

static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg)
{
	for (int i=0; i < protoCount; i++)
	{
		unsigned status = CallProtoService(proto[i]->szModuleName,PS_GETSTATUS,0,0);
		if (
			(g_wMask & OPT_ONLINEONLY) ? // check "Change only if current status is Online" option
			((status == ID_STATUS_ONLINE) || (status == ID_STATUS_FREECHAT)) // process only "online" and "free for chat"
			:
			((status > ID_STATUS_OFFLINE) && (status < ID_STATUS_IDLE) && (status != ID_STATUS_INVISIBLE))) // process all existing statuses except for "invisible" & "offline"
		{
			if (g_wMask & OPT_SETONLINEBACK){ // need to save old statuses & status messages
				oldStatus[i] = status;
				if (ProtoServiceExists(proto[i]->szModuleName, PS_GETMYAWAYMSG))
					oldStatusMsg[i] = (TCHAR*)ProtoCallService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
				else
					oldStatusMsg[i] = GetDefStatusMsg(status, proto[i]->szModuleName);
			}
			SetStatus(proto[i]->szModuleName, statusMode, msg);
		}
	}
	return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:23,代码来源:BossKey.cpp

示例12: SetStatus

	int __cdecl SetStatus(int iNewStatus)
	{
		return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
	}
开发者ID:martok,项目名称:miranda-ng,代码行数:4,代码来源:protoint.cpp

示例13: SendMsg

	int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg)
	{
		CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg };
		return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
	}
开发者ID:martok,项目名称:miranda-ng,代码行数:5,代码来源:protoint.cpp

示例14: SendContacts

	int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList)
	{
		CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
		return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
	}
开发者ID:martok,项目名称:miranda-ng,代码行数:5,代码来源:protoint.cpp

示例15: FileCancel

	int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer)
	{
		CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
		return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
	}
开发者ID:martok,项目名称:miranda-ng,代码行数:5,代码来源:protoint.cpp


注:本文中的ProtoCallService函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。