本文整理汇总了C++中ProtoCallService函数的典型用法代码示例。如果您正苦于以下问题:C++ ProtoCallService函数的具体用法?C++ ProtoCallService怎么用?C++ ProtoCallService使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ProtoCallService函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetCachedStatusMsg
BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
{
if (p == NULL)
return 0;
p->bStatusMsgValid = STATUSMSG_NOTFOUND;
MCONTACT hContact = p->hContact;
DBVARIANT dbv = {0};
INT_PTR result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
if ( !result && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if ( !szProto)
szProto = GetContactProto(hContact);
if (szProto) {
if ( !result )
db_free( &dbv );
if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
else if ( !(result = cfg::getTString(hContact, szProto, "XStatusMsg", &dbv)) && lstrlen(dbv.ptszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
if (p->bStatusMsgValid == STATUSMSG_NOTFOUND) { // no status msg, consider xstatus name (if available)
if ( !result )
db_free( &dbv );
result = cfg::getTString(hContact, szProto, "XStatusName", &dbv);
if ( !result && lstrlen(dbv.ptszVal) > 1) {
int iLen = lstrlen(dbv.ptszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (iLen + 2) * sizeof(TCHAR));
_tcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
}
else {
int xStatus;
WPARAM xStatus2;
TCHAR xStatusName[128];
CUSTOM_STATUS cst = { sizeof(cst) };
cst.flags = CSSF_MASK_STATUS;
cst.status = &xStatus;
if (ProtoServiceExists(szProto, PS_GETCUSTOMSTATUSEX) && !ProtoCallService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst) && xStatus > 0) {
cst.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
cst.wParam = &xStatus2;
cst.ptszName = xStatusName;
if ( !CallProtoService(szProto, PS_GETCUSTOMSTATUSEX, hContact, (LPARAM)&cst)) {
TCHAR *szwXstatusName = TranslateTS(xStatusName);
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(szwXstatusName) + 2) * sizeof(TCHAR));
_tcsncpy(p->statusMsg, szwXstatusName, lstrlen(szwXstatusName) + 1);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
}
}
}
}
if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
p->statusMsg = (TCHAR *)realloc(p->statusMsg, (lstrlen(dbv.ptszVal) + 2) * sizeof(TCHAR));
for (int i = 0; dbv.ptszVal[i]; i++) {
if (dbv.ptszVal[i] == (TCHAR)0x0d)
continue;
p->statusMsg[j] = dbv.ptszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.ptszVal[i];
j++;
}
p->statusMsg[j] = 0;
}
if ( !result )
db_free( &dbv );
if (p->bStatusMsgValid != STATUSMSG_NOTFOUND) {
WORD infoTypeC2[12];
ZeroMemory(infoTypeC2, sizeof(WORD) * 12);
int iLen = min(lstrlenW(p->statusMsg), 10);
GetStringTypeW(CT_CTYPE2, p->statusMsg, iLen, infoTypeC2);
p->dwCFlags &= ~ECF_RTLSTATUSMSG;
for (int i = 0; i < 10; i++) {
if (infoTypeC2[i] == C2_RIGHTTOLEFT) {
p->dwCFlags |= ECF_RTLSTATUSMSG;
break;
}
}
}
if (p->hTimeZone == NULL)
TZ_LoadTimeZone(hContact, p, szProto);
return p->bStatusMsgValid;
}
开发者ID:fatty-,项目名称:miranda-ng,代码行数:91,代码来源:clcitems.cpp
示例17: AuthDeny
int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
{
return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)StrConvA(szReason));
}
开发者ID:martok,项目名称:miranda-ng,代码行数:4,代码来源:protoint.cpp
示例18: AuthRecv
int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
开发者ID:martok,项目名称:miranda-ng,代码行数:5,代码来源:protoint.cpp
示例19: AddToListByEvent
MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
{
return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
}
开发者ID:martok,项目名称:miranda-ng,代码行数:4,代码来源:protoint.cpp
示例20: Authorize
int __cdecl Authorize(HANDLE hDbEvent)
{
return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
}
开发者ID:martok,项目名称:miranda-ng,代码行数:4,代码来源:protoint.cpp
注:本文中的ProtoCallService函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论