本文整理汇总了C++中NotifyEventHooks函数的典型用法代码示例。如果您正苦于以下问题:C++ NotifyEventHooks函数的具体用法?C++ NotifyEventHooks怎么用?C++ NotifyEventHooks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NotifyEventHooks函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ReloadMyAvatar
static void ReloadMyAvatar(LPVOID lpParam)
{
char *szProto = (char *)lpParam;
mir_sleep(500);
for (int i = 0; !g_shutDown && i < g_MyAvatars.getCount(); i++) {
char *myAvatarProto = g_MyAvatars[i].szProtoname;
if (szProto[0] == 0) {
// Notify to all possibles
if (mir_strcmp(myAvatarProto, szProto)) {
if (!ProtoServiceExists(myAvatarProto, PS_SETMYAVATAR))
continue;
if (!Proto_IsAvatarsEnabled(myAvatarProto))
continue;
}
}
else if (mir_strcmp(myAvatarProto, szProto))
continue;
if (g_MyAvatars[i].hbmPic)
DeleteObject(g_MyAvatars[i].hbmPic);
if (CreateAvatarInCache(INVALID_CONTACT_ID, &g_MyAvatars[i], myAvatarProto) != -1)
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, (LPARAM)&g_MyAvatars[i]);
else
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, 0);
}
free(lpParam);
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:32,代码来源:services.cpp
示例2: MTLASSERT
void CAVSessionController::FireEvent(unsigned state)
{
MTLASSERT(m_session.IsValid());
SIPRTC_CALL call = { 0 };
call.cbSize = sizeof(call);
call.uri = m_session.GetParticipantURI();
if(m_session.GetParticipantURI().length() > 0)
call.hContact = g_env.DB().FindOrAddContact(m_session.GetParticipantURI(),
m_session.GetParticipantName(), true);
MTLASSERT(m_hCallStateChanged);
NotifyEventHooks(m_hCallStateChanged, state, (LPARAM)&call);
VOICE_CALL voiceCall = { 0 };
voiceCall.cbSize = sizeof(voiceCall);
voiceCall.szModule = g_env.ProtocolName();
voiceCall.id = "TODO";
voiceCall.flags = VOICE_CALL_CONTACT;
voiceCall.hContact = call.hContact;
switch(state)
{
case SIPRTC_CALL_IDLE: voiceCall.state = VOICE_STATE_ON_HOLD; break; // ???
case SIPRTC_CALL_INCOMING: voiceCall.state = VOICE_STATE_RINGING; break;
case SIPRTC_CALL_ANSWERING: voiceCall.state = VOICE_STATE_RINGING; break; // ???
case SIPRTC_CALL_INPROGRESS: voiceCall.state = VOICE_STATE_TALKING; break;
case SIPRTC_CALL_CONNECTED: voiceCall.state = VOICE_STATE_TALKING; break; // ???
case SIPRTC_CALL_DISCONNECTED: voiceCall.state = VOICE_STATE_ENDED; break;
case SIPRTC_CALL_HOLD: voiceCall.state = VOICE_STATE_ON_HOLD; break;
case SIPRTC_CALL_REFER: voiceCall.state = VOICE_STATE_ENDED; break; // ???
}
NotifyEventHooks(m_hVoiceStateEvent, (WPARAM)&voiceCall, 0);
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:35,代码来源:avsessioncontroller.cpp
示例3: STDMETHODIMP_
STDMETHODIMP_(HANDLE) CDataBase::AddEvent(HANDLE hContact, DBEVENTINFO *dbei)
{
if (dbei->cbSize < sizeof(DBEVENTINFO))
return (HANDLE)-1;
int tmp = NotifyEventHooks(hEventFilterAddedEvent, (WPARAM)hContact, (LPARAM)dbei);
if (tmp != 0)
return (HANDLE)tmp;
if (hContact == 0)
hContact = (HANDLE)getEntities().getRootEntity();
TDBTEvent ev = {0,0,0,0,0,0,0};
ev.cbSize = sizeof(ev);
ev.ModuleName = dbei->szModule;
ev.Timestamp = dbei->timestamp;
ev.Flags = dbei->flags;
if (ev.Flags & DBEF_SENT)
ev.Flags = ev.Flags | DBEF_READ;
ev.EventType = dbei->eventType;
ev.cbBlob = dbei->cbBlob;
ev.pBlob = dbei->pBlob;
int res = DBEventAdd((WPARAM)hContact, reinterpret_cast<LPARAM>(&ev));
if (res != DBT_INVALIDPARAM)
{
NotifyEventHooks(hEventAddedEvent, (WPARAM)hContact, res);
return (HANDLE)res;
}
return NULL;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:32,代码来源:Compatibility.cpp
示例4: ServiceShutdown
INT_PTR ServiceShutdown(WPARAM wParam, LPARAM lParam)
{
/* passing 0 as wParam is only to be used internally, undocumented */
if (!wParam) wParam = db_get_b(NULL, "AutoShutdown", "ShutdownType", SETTING_SHUTDOWNTYPE_DEFAULT);
if (!IsShutdownTypeEnabled((BYTE)wParam)) return 1; /* does shutdownType range check */
if ((BOOL)lParam && hwndShutdownDlg != NULL) return 2;
/* ask others if allowed */
if (NotifyEventHooks(hEventOkToShutdown, wParam, lParam)) {
OutputDebugStringA("automatic shutdown denied by event hook\n"); /* all ascii */
return 3;
}
/* tell others */
NotifyEventHooks(hEventShutdown, wParam, lParam);
/* show dialog */
if (lParam && db_get_b(NULL, "AutoShutdown", "ShowConfirmDlg", SETTING_SHOWCONFIRMDLG_DEFAULT))
if (CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SHUTDOWNNOW), NULL, ShutdownDlgProc, (BYTE)wParam) != NULL)
return 0;
/* show error */
DWORD dwErrCode = ShutdownNow((BYTE)wParam);
if (dwErrCode != ERROR_SUCCESS) {
char *pszErr = GetWinErrorDescription(dwErrCode);
ShowInfoMessage(NIIF_ERROR, Translate("Automatic Shutdown Error"), Translate("Inititiating the shutdown process failed!\nReason: %s"), (pszErr != NULL) ? pszErr : Translate("Unknown"));
if (pszErr != NULL)
LocalFree(pszErr);
return 4;
}
return 0;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:31,代码来源:shutdownsvc.cpp
示例5: ApplyChanges
/** Scans the \c CHANGES and call the appropriate function for each change.
*
* @param chg : Structure holding all the change info (See CHANGES).
*/
void ApplyChanges(CHANGES *chg)
{
HANDLE most_online;
int i;
// remove removed contacts
for(i = 0; i < chg->num_deleted; i++) {
Meta_Delete((WPARAM)chg->hDeletedContacts[i], 0);
if(chg->hDeletedContacts[i] == chg->hDefaultContact)
chg->hDefaultContact = 0;
if(chg->hDeletedContacts[i] == chg->hOfflineContact)
chg->hOfflineContact = 0;
}
// set contact positions
for(i = 0; i < chg->num_contacts; i++) {
if(Meta_GetContactNumber(chg->hContact[i]) != i)
Meta_SwapContacts(chg->hMeta, Meta_GetContactNumber(chg->hContact[i]), i);
}
NotifyEventHooks(hSubcontactsChanged, (WPARAM)chg->hMeta, (LPARAM)chg->hDefaultContact);
// set default
if(chg->hDefaultContact)
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "Default", Meta_GetContactNumber(chg->hDefaultContact));
else
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "Default", 0);
NotifyEventHooks(hEventDefaultChanged, (WPARAM)chg->hMeta, (LPARAM)chg->hDefaultContact);
// set offline
if(chg->hOfflineContact)
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "OfflineSend", Meta_GetContactNumber(chg->hOfflineContact));
else
DBWriteContactSettingDword(chg->hMeta, META_PROTO, "OfflineSend", (DWORD)-1);
// fix nick
most_online = Meta_GetMostOnline(chg->hMeta);
Meta_CopyContactNick(chg->hMeta, most_online);
// fix status
Meta_FixStatus(chg->hMeta);
// fix avatar
most_online = Meta_GetMostOnlineSupporting(chg->hMeta, PFLAGNUM_4, PF4_AVATARS);
if(most_online) {
PROTO_AVATAR_INFORMATION AI;
AI.cbSize = sizeof(AI);
AI.hContact = chg->hMeta;
AI.format = PA_FORMAT_UNKNOWN;
strcpy(AI.filename, "X");
if((int)CallProtoService(META_PROTO, PS_GETAVATARINFO, 0, (LPARAM)&AI) == GAIR_SUCCESS)
DBWriteContactSettingString(chg->hMeta, "ContactPhoto", "File",AI.filename);
}
if(MetaAPI_GetForceState((WPARAM)chg->hMeta, 0) != chg->force_default)
MetaAPI_ForceDefault((WPARAM)chg->hMeta, 0);
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:63,代码来源:edit.c
示例6: ehhToolbarModulesLoaded
static int ehhToolbarModulesLoaded(WPARAM wParam, LPARAM lParam)
{
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"ToolBar Background/ToolBar",0);
ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhToolBarBackgroundSettingsChanged);
tbdat.hehOptInit=ModernHookEvent(ME_OPT_INITIALISE,ehhToolbarOptInit);
ehhToolBarBackgroundSettingsChanged(0,0);
tbdat.hehSettingsChanged=ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged );
tbdat.hToolBarWindowList=(HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
CreateServiceFunction(MS_TB_ADDBUTTON,svcToolBarAddButton);
CreateServiceFunction(MS_TB_REMOVEBUTTON, svcToolBarRemoveButton);
CreateServiceFunction(MS_TB_SETBUTTONSTATE, svcToolBarSetButtonState);
CreateServiceFunction(MS_TB_SETBUTTONSTATEBYID, svcToolBarSetButtonStateById);
CreateServiceFunction(MS_TB_GETBUTTONSTATE, svcToolBarGetButtonState);
CreateServiceFunction(MS_TB_GETBUTTONSTATEBYID, svcToolBarGetButtonStateById);
HWND hwndClist=(HWND) CallService(MS_CLUI_GETHWND,0,0);
sttCreateToolBarFrame( hwndClist, ("ToolBar"), 24);
NotifyEventHooks(g_CluiData.hEventToolBarModuleLoaded, 0, 0);
return 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:26,代码来源:modern_toolbar.cpp
示例7: STDMETHODIMP_
STDMETHODIMP_(MCONTACT) CDb3Mmap::AddContact()
{
DWORD ofsNew;
log0("add contact");
DBContact dbc = { 0 };
dbc.signature = DBCONTACT_SIGNATURE;
{
mir_cslock lck(m_csDbAccess);
ofsNew = CreateNewSpace(sizeof(DBContact));
dbc.ofsNext = m_dbHeader.ofsFirstContact;
dbc.dwContactID = m_dwMaxContactId++;
m_dbHeader.ofsFirstContact = ofsNew;
m_dbHeader.contactCount++;
DBWrite(ofsNew, &dbc, sizeof(DBContact));
DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
DBFlush(0);
}
DBCachedContact *cc = m_cache->AddContactToCache(dbc.dwContactID);
cc->dwDriverData = ofsNew;
NotifyEventHooks(hContactAddedEvent, dbc.dwContactID, 0);
return dbc.dwContactID;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:26,代码来源:dbcontacts.cpp
示例8: LoadPingList
int LoadPingList(WPARAM wParam, LPARAM lParam) {
EnterCriticalSection(&list_cs);
read_ping_addresses();
LeaveCriticalSection(&list_cs);
NotifyEventHooks(reload_event_handle, 0, 0);
return 0;
}
开发者ID:darkscout,项目名称:sje-miranda-plugins,代码行数:7,代码来源:pinglist.cpp
示例9: TABSRMM_FireEvent
int TABSRMM_FireEvent(MCONTACT hContact, HWND hwnd, unsigned int type, unsigned int subType)
{
if (hContact == NULL || hwnd == NULL || !M.GetByte("_eventapi", 1))
return 0;
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
BYTE bType = dat ? dat->bType : SESSIONTYPE_IM;
MessageWindowEventData mwe = { sizeof(mwe) };
mwe.hContact = hContact;
mwe.hwndWindow = hwnd;
mwe.szModule = "tabSRMsgW";
mwe.uType = type;
mwe.hwndInput = GetDlgItem(hwnd, bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE);
mwe.hwndLog = GetDlgItem(hwnd, bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG);
if (type == MSG_WINDOW_EVT_CUSTOM) {
TABSRMM_SessionInfo se = { sizeof(se) };
se.evtCode = HIWORD(subType);
se.hwnd = hwnd;
se.extraFlags = (unsigned int)(LOWORD(subType));
se.local = (void*)dat->sendBuffer;
mwe.local = (void*) & se;
}
return NotifyEventHooks(PluginConfig.m_event_MsgWin, 0, (LPARAM)&mwe);
}
开发者ID:slotwin,项目名称:miranda-ng,代码行数:27,代码来源:msgs.cpp
示例10: LoadPingList
INT_PTR LoadPingList(WPARAM wParam, LPARAM lParam)
{
mir_cslock lck(list_cs);
read_ping_addresses();
NotifyEventHooks(reload_event_handle, 0, 0);
return 0;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:7,代码来源:pinglist.cpp
示例11: AddContact
static INT_PTR AddContact(WPARAM wParam,LPARAM lParam)
{
struct DBContact dbc;
DWORD ofsNew;
log0("add contact");
EnterCriticalSection(&csDbAccess);
ofsNew=CreateNewSpace(sizeof(struct DBContact));
dbc.signature=DBCONTACT_SIGNATURE;
dbc.eventCount=0;
dbc.ofsFirstEvent=dbc.ofsLastEvent=0;
dbc.ofsFirstSettings=0;
dbc.ofsNext=dbHeader.ofsFirstContact;
dbc.ofsFirstUnreadEvent=0;
dbc.timestampFirstUnread=0;
dbHeader.ofsFirstContact=ofsNew;
dbHeader.contactCount++;
DBWrite(ofsNew,&dbc,sizeof(struct DBContact));
DBWrite(0,&dbHeader,sizeof(dbHeader));
DBFlush(0);
AddToCachedContactList((HANDLE)ofsNew, -1);
LeaveCriticalSection(&csDbAccess);
NotifyEventHooks(hContactAddedEvent,(WPARAM)ofsNew,0);
return (INT_PTR)ofsNew;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:27,代码来源:dbcontacts.c
示例12: msgQueue_processack
void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *szErr)
{
TMsgQueue *p = msgQueue_find(hContact, id);
if (p == NULL)
return;
if (!success) {
MessageFailureProcess(p, szErr);
return;
}
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF | (p->flags & PREF_RTL ? DBEF_RTL : 0);
dbei.szModule = GetContactProto(hContact);
dbei.timestamp = time(0);
dbei.cbBlob = (DWORD)(mir_strlen(p->szMsg) + 1);
dbei.pBlob = (PBYTE)p->szMsg;
MessageWindowEvent evt = { sizeof(evt), id, hContact, &dbei };
NotifyEventHooks(hHookWinWrite, 0, (LPARAM)&evt);
p->szMsg = (char*)dbei.pBlob;
db_event_add(hContact, &dbei);
mir_free(p->szMsg);
mir_free(p);
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:29,代码来源:cmdlist.cpp
示例13: STDMETHODIMP_
STDMETHODIMP_(BOOL) CDbxKyoto::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
{
if (hDbEvent == 0) return -1;
DBCachedContact *cc = m_cache->GetCachedContact(contactID);
if (cc == NULL)
return -1;
mir_cslock lck(m_csDbAccess);
VisitorCopyRec visitor;
if (!m_dbEvents.accept((LPCSTR)&hDbEvent, sizeof(MEVENT), &visitor, false))
return -1;
DBEvent *dbe = (DBEvent*)visitor.vbuf_;
if (dbe->dwSignature != DBEVENT_SIGNATURE)
return -1;
if (dbe->markedRead())
return dbe->flags;
DBEventSortingKey key2 = { contactID, dbe->timestamp, hDbEvent };
dbe->flags |= DBEF_READ;
m_dbEvents.set((LPCSTR)&hDbEvent, sizeof(MEVENT), visitor.vbuf_, visitor.vsiz_);
FindNextUnread(cc, key2);
m_dbContacts.set((LPCSTR)&contactID, sizeof(int), (LPCSTR)&cc->dbc, sizeof(cc->dbc));
NotifyEventHooks(hEventMarkedRead, contactID, (LPARAM)hDbEvent);
return dbe->flags;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:31,代码来源:dbevents.cpp
示例14: FilterRecvMessage
INT_PTR FilterRecvMessage(WPARAM wParam, LPARAM lParam)
{
int res = NotifyEventHooks(hRecvMessage, wParam, lParam);
if (res) return res;
Proto_ChainRecv(wParam, (CCSDATA*)lParam);
return 0;
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:7,代码来源:m_protocols.cpp
示例15: MSN_StartStopTyping
void CMsnProto::MSN_ChatStart(ThreadData* info)
{
if (info->mChatID[0] != 0)
return;
MSN_StartStopTyping(info, false);
NotifyEventHooks(hInitChat, (WPARAM)info, 0);
// add all participants onto the list
GCDEST gcd = { m_szModuleName, { NULL }, GC_EVENT_JOIN };
gcd.ptszID = info->mChatID;
GCEVENT gce = {0};
gce.cbSize = sizeof(GCEVENT);
gce.dwFlags = GC_TCHAR | GCEF_ADDTOLOG;
gce.pDest = &gcd;
gce.ptszStatus = TranslateT("Others");
gce.time = time(NULL);
gce.bIsMe = FALSE;
for (int j=0; j < info->mJoinedContactsWLID.getCount(); j++)
{
HANDLE hContact = MSN_HContactFromEmail(info->mJoinedContactsWLID[j]);
TCHAR *wlid = mir_a2t(info->mJoinedContactsWLID[j]);
gce.ptszNick = GetContactNameT(hContact);
gce.ptszUID = wlid;
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(wlid);
}
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:33,代码来源:msn_chat.cpp
示例16: SmileyDownloadThread
void __cdecl SmileyDownloadThread(void*)
{
bool needext = false;
HANDLE hHttpDwnl = NULL;
WaitForSingleObject(g_hDlMutex, 3000);
while (!Miranda_Terminated() && dlQueue.getCount()) {
ReleaseMutex(g_hDlMutex);
if (_taccess(dlQueue[0].fname.c_str(), 0) != 0) {
InternetDownloadFile(T2A_SM(dlQueue[0].url.c_str()), T2A_SM(dlQueue[0].fname.c_str()), hHttpDwnl);
WaitForSingleObject(g_hDlMutex, 3000);
CMString fname(dlQueue[0].fname);
if (dlQueue[0].needext) { fname += GetImageExt(fname); needext = true; }
_trename(dlQueue[0].fname.c_str(), fname.c_str());
}
else WaitForSingleObject(g_hDlMutex, 3000);
dlQueue.remove(0);
}
dlQueue.destroy();
if (hHttpDwnl) Netlib_CloseHandle(hHttpDwnl);
threadRunning = false;
ReleaseMutex(g_hDlMutex);
if (!Miranda_Terminated()) {
if (needext)
CallServiceSync(MS_SMILEYADD_RELOAD, 0, 0);
else
NotifyEventHooks(hEvent1, 0, 0);
}
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:31,代码来源:download.cpp
示例17: CheckIconClick
void CheckIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags) {
StatusIconClickData sicd;
struct StatusIconListNode *current = status_icon_list;
int iconNum = (pt.x - r.left) / (GetSystemMetrics(SM_CXSMICON) + gap);
char buff[256];
int flags;
while(current && iconNum >= 0) {
sprintf(buff, "SRMMStatusIconFlags%d", current->sid.dwId);
flags = DBGetContactSettingByte(hContact, current->sid.szModule, buff, current->sid.flags);
if(!(flags & MBF_HIDDEN)) iconNum--;
if(iconNum >= 0)
current = current->next;
}
if(current) {
sicd.cbSize = sizeof(StatusIconClickData);
ClientToScreen(hwndFrom, &pt);
sicd.clickLocation = pt;
sicd.dwId = current->sid.dwId;
sicd.szModule = current->sid.szModule;
sicd.flags = click_flags;
NotifyEventHooks(hHookIconPressedEvt, (WPARAM)hContact, (LPARAM)&sicd);
}
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:26,代码来源:statusicon.c
示例18: fnSetAllExtraIcons
void fnSetAllExtraIcons(MCONTACT hContact)
{
if (cli.hwndContactTree == 0)
return;
g_mutex_bSetAllExtraIconsCycle = 1;
bool hcontgiven = (hContact != 0);
if (!bImageCreated)
cli.pfnReloadExtraIcons();
SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
if (hContact == NULL)
hContact = db_find_first();
for (; hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry* pdnce = (ClcCacheEntry*)cli.pfnGetCacheEntry(hContact);
if (pdnce == NULL)
continue;
NotifyEventHooks(hEventExtraImageApplying, hContact, 0);
if (hcontgiven)
break;
}
g_mutex_bSetAllExtraIconsCycle = 0;
cli.pfnInvalidateRect(cli.hwndContactTree, NULL, FALSE);
Sleep(0);
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:30,代码来源:extraicons.cpp
示例19: Meta_ForceDefault
/** Set/unset (i.e. toggle) contact to force use of default contact
*
* Set the given contact to be the default one for the metacontact to which it is linked.
*
* @param wParam : \c HANDLE to the MetaContact to be set as default
* @param lParam : \c HWND to the clist window
(This means the function has been called via the contact menu).
*/
INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam)
{
if(DBGetContactSettingDword((HANDLE)wParam,META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
{ // the wParam is a MetaContact
BOOL current = DBGetContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", 0);
current = !current;
DBWriteContactSettingByte((HANDLE)wParam, META_PROTO, "ForceDefault", (BYTE)current);
DBWriteContactSettingDword((HANDLE)wParam, META_PROTO, "ForceSend", 0);
if(current) NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, DBGetContactSettingDword((HANDLE)wParam, META_PROTO, "Default", -1)));
else NotifyEventHooks(hEventUnforceSend, wParam, 0);
}
return 0;
}
开发者ID:darkscout,项目名称:sje-miranda-plugins,代码行数:24,代码来源:meta_menu.c
示例20: ContactSettingChanged
int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
MCONTACT hContact = (MCONTACT) wParam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
logmsg("ContactSettingChanged1");
if(hContact==NULL || mir_strcmp(cws->szSetting,"Status")) return 0;
WORD newStatus = cws->value.wVal;
WORD oldStatus = DBGetContactSettingRangedWord(hContact,"UserOnline","OldStatus2",ID_STATUS_OFFLINE, ID_STATUS_MIN, ID_STATUS_MAX);
if (oldStatus == newStatus) return 0;
logmsg("ContactSettingChanged2");
db_set_w(hContact,"UserOnline","OldStatus2", newStatus);
if(CallService(MS_IGNORE_ISIGNORED,wParam,IGNOREEVENT_USERONLINE)) return 0;
DWORD dwStatuses = MAKELPARAM(oldStatus, newStatus);
NotifyEventHooks(hHookContactStatusChanged, wParam, (LPARAM)dwStatuses);
return 0;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:25,代码来源:events.cpp
注:本文中的NotifyEventHooks函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论