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


C++ DBGetContactSettingWord函数代码示例

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


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

示例1: DoStartupProcess

void DoStartupProcess() {
	if(checking) return;

	if(OldXMLDataExists(MC_PLUGINS) && OldXMLDataExists(MC_LOCALIZATION)) {
		if(options.check_on_startup) {
			SYSTEMTIME now;
			GetSystemTime(&now);

			if(options.check_once) {
				if(DBGetContactSettingWord(0, MODULE, "LastUpdateDay", 32) == 32) {
					CallService(MS_UPDATE_CHECKFORUPDATES, 0, 0);
				} else {
					if(now.wDay != DBGetContactSettingWord(0, MODULE, "LastUpdateDay", now.wDay)
						|| now.wMonth != DBGetContactSettingWord(0, MODULE, "LastUpdateMonth", now.wMonth)
						|| now.wYear != DBGetContactSettingWord(0, MODULE, "LastUpdateYear", now.wYear))
					{
						CallService(MS_UPDATE_CHECKFORUPDATES, 0, 0);
					} else {
						if(LoadOldXMLData(MC_PLUGINS, false)) {
							ScanPlugins(0, 0);
							FreeXMLData(MC_PLUGINS);
						}
						if(LoadOldXMLData(MC_LOCALIZATION, false)) {
							ScanLangpacks(0, 0);
							FreeXMLData(MC_LOCALIZATION);
						}

						RestoreStatus();
					}
				}
			} else {
				CallService(MS_UPDATE_CHECKFORUPDATES, 0, 0);
			}
		} else {
			if(LoadOldXMLData(MC_PLUGINS, false)) {
				ScanPlugins(0, 0);
				FreeXMLData(MC_PLUGINS);
			}
			if(LoadOldXMLData(MC_LOCALIZATION, false)) {
				ScanLangpacks(0, 0);
				FreeXMLData(MC_LOCALIZATION);
			}

			RestoreStatus();
		}
	} else {
		if(options.check_on_startup) CallService(MS_UPDATE_CHECKFORUPDATES, 0, 0);
		else RestoreStatus();
	}

}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:51,代码来源:services.cpp

示例2: logoff_contacts

void logoff_contacts(BOOL bCleanup) {
	HANDLE hContact;
	char *szProto;
	DBVARIANT dbv={0};

	LOG(("logoff_contacts: Logging off contacts."));
	for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
		szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
		if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME))
		{
			if (DBGetContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE)
				DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE);

			DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "CallId");
			if (DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==1)
			{
				if (DBGetContactSettingTString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue;
				RemChat (dbv.ptszVal);
				DBFreeVariant(&dbv);
			}
			if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv) == 0)
			{
				if (bCleanup) SkypeSend ("ALTER APPLICATION libpurple_typing DISCONNECT %s", dbv.pszVal);
				DBFreeVariant(&dbv);
				DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "Typing_Stream");
			}

		}
	}
	if (bCleanup && (protocol>=5 || bIsImoproxy)) SkypeSend ("DELETE APPLICATION libpurple_typing");
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:31,代码来源:contacts.c

示例3: hkRestoreStatus

INT_PTR hkRestoreStatus(WPARAM wParam,LPARAM lParam)
{
	int nStatus = DBGetContactSettingWord(NULL, "CList", "Status", ID_STATUS_OFFLINE);
    CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0);

	return 0;
}
开发者ID:dineshkummarc,项目名称:miranda-im-v0.9.47-src,代码行数:7,代码来源:keyboard.c

示例4: TlenOnModulesLoaded

int TlenOnModulesLoaded(void *ptr, WPARAM wParam, LPARAM lParam) {

    char str[128];
    TlenProtocol *proto = (TlenProtocol *)ptr;
    /* Set all contacts to offline */
    HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
    while (hContact != NULL) {
        char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
        if(szProto!=NULL && !strcmp(szProto, proto->iface.m_szModuleName)) {
            if (DBGetContactSettingWord(hContact, proto->iface.m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
                DBWriteContactSettingWord(hContact, proto->iface.m_szModuleName, "Status", ID_STATUS_OFFLINE);
            }
        }
        hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
    }
    TlenMUCInit(proto);
    sprintf(str, "%s", Translate("Incoming mail"));
    SkinAddNewSoundEx("TlenMailNotify", proto->iface.m_szProtoName, str);
    sprintf(str, "%s", Translate("Alert"));
    SkinAddNewSoundEx("TlenAlertNotify", proto->iface.m_szProtoName, str);
    sprintf(str, "%s", Translate("Voice chat"));
    SkinAddNewSoundEx("TlenVoiceNotify", proto->iface.m_szProtoName, str);

    HookEventObj_Ex(ME_USERINFO_INITIALISE, proto, TlenUserInfoInit);

    return 0;
}
开发者ID:BackupTheBerlios,项目名称:mtlen-svn,代码行数:27,代码来源:tlen.c

示例5: CList_PrebuildContactMenu

int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
    HANDLE hContact = (HANDLE)wParam;
    if ( hContact ) {
        char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);

        CLISTMENUITEM clmi = {0};
        clmi.cbSize = sizeof( CLISTMENUITEM );
        clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;

        if ( szProto ) {
            // display this menu item only for chats
            if ( M->GetByte(hContact, szProto, "ChatRoom", 0 )) {
                // still hide it for offline protos
                if ( CallProtoService( szProto, PS_GETSTATUS, 0, 0 ) != ID_STATUS_OFFLINE ) {
                    clmi.flags &= ~CMIF_HIDDEN;
                    clmi.flags |= CMIM_NAME;

                    if ( DBGetContactSettingWord( hContact, szProto, "Status", 0 ) == ID_STATUS_OFFLINE )
                        clmi.pszName = ( char* )LPGEN("Join chat");
                    else
                        clmi.pszName = ( char* )LPGEN("Open chat window");
                }
            }
        }
        CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hJoinMenuItem, ( LPARAM )&clmi );

        clmi.flags &= ~(CMIM_NAME | CMIF_DEFAULT);
        clmi.flags |= CMIF_NOTOFFLINE;
        CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hLeaveMenuItem, ( LPARAM )&clmi );
    }
    return 0;
}
开发者ID:raoergsls,项目名称:miranda,代码行数:33,代码来源:clist.cpp

示例6: AwayMsgPreBuildMenu

static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM)
{
	CLISTMENUITEM clmi;
	TCHAR str[128];
	char *szProto;

	szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
	ZeroMemory(&clmi,sizeof(clmi));
	clmi.cbSize = sizeof(clmi);
	clmi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;

	if ( szProto != NULL ) {
	   int chatRoom = szProto ? DBGetContactSettingByte((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
	   if ( !chatRoom ) {
			int status = DBGetContactSettingWord((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE);
			mir_sntprintf( str, SIZEOF(str), TranslateT("Re&ad %s Message"), cli.pfnGetStatusModeDescription( status, 0 ));
			clmi.ptszName = str;
			if ( CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_1, 0 ) & PF1_MODEMSGRECV ) {
				if ( CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_3, 0 ) & Proto_Status2Flag( status )) {
					clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_NOTOFFLINE | CMIM_ICON | CMIF_TCHAR;
					clmi.hIcon = LoadSkinProtoIcon(szProto, status);
	}	}	}	}

	CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hAwayMsgMenuItem, ( LPARAM )&clmi );
	IconLib_ReleaseIcon(clmi.hIcon,0);
	return 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:27,代码来源:awaymsg.cpp

示例7: CompareContacts

int CompareContacts(WPARAM wParam, LPARAM lParam)
{
    HANDLE a = (HANDLE) wParam,b = (HANDLE) lParam;
    TCHAR namea[128], *nameb;
    int statusa, statusb;
    char *szProto1, *szProto2;
    int rc;

    szProto1 = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) a, 0);
    szProto2 = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) b, 0);
    statusa = DBGetContactSettingWord((HANDLE) a, SAFESTRING(szProto1), "Status", ID_STATUS_OFFLINE);
    statusb = DBGetContactSettingWord((HANDLE) b, SAFESTRING(szProto2), "Status", ID_STATUS_OFFLINE);

    if (sortByProto) {
    /* deal with statuses, online contacts have to go above offline */
        if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) {
            return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
        }
    /* both are online, now check protocols */
        rc = strcmp(SAFESTRING(szProto1), SAFESTRING(szProto2)); /* strcmp() doesn't like NULL so feed in "" as needed */
        if (rc != 0 && (szProto1 != NULL && szProto2 != NULL))
            return rc;
    /* protocols are the same, order by display name */
    }

    if (sortByStatus) {
        int ordera, orderb;
        ordera = GetStatusModeOrdering(statusa);
        orderb = GetStatusModeOrdering(statusb);
        if (ordera != orderb)
            return ordera - orderb;
    } else {
    //one is offline: offline goes below online
        if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) {
            return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
        }
    }

    nameb = GetContactDisplayNameW(a, 0);
    _tcsncpy(namea, nameb, safe_sizeof(namea));
    namea[safe_sizeof(namea) - 1] = 0;
    nameb = GetContactDisplayNameW(b, 0);

    //otherwise just compare names
    return CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, namea, -1, nameb, -1) - 2;
    //return _tcsicmp(namea,nameb);
}
开发者ID:BackupTheBerlios,项目名称:mimplugins-svn,代码行数:47,代码来源:contact.c

示例8: InitOptions

void InitOptions() {
	hEventOptInit = HookEvent(ME_OPT_INITIALISE, OptInit);
	DBVARIANT dbv;
	if(!DBGetContactSettingTString(0, MODULE, "Host", &dbv)) { 
		options.host = strdup(dbv.pszVal);
		DBFreeVariant(&dbv);
	}
	if(!DBGetContactSettingTString(0, MODULE, "Username", &dbv)) {
		options.username = strdup(dbv.pszVal);
		DBFreeVariant(&dbv);
	}
	if(!DBGetContactSettingTString(0, MODULE, "Password", &dbv)) {
		options.password = strdup(dbv.pszVal);
		DBFreeVariant(&dbv);
	}
	if(!DBGetContactSettingTString(0, MODULE, "CIDName", &dbv)) {
		options.cid_name = strdup(dbv.pszVal);
		DBFreeVariant(&dbv);
	}
	if(!DBGetContactSettingTString(0, MODULE, "CIDNumber", &dbv)) {
		options.cid_number = strdup(dbv.pszVal);
		DBFreeVariant(&dbv);
	}

	iaxc_audio_device *dev;
	int nDevs, in, out, ring;
	iaxc_audio_devices_get(&dev, &nDevs, &in, &out, &ring);
	if(!DBGetContactSettingTString(0, MODULE, "DeviceIn", &dbv)) {
		for(int i = 0; i < nDevs; i++) {
			if((dev[i].capabilities & IAXC_AD_INPUT) && strcmp(dbv.pszVal, dev[i].name) == 0) in = i;
		}
		DBFreeVariant(&dbv);
	}
	if(!DBGetContactSettingTString(0, MODULE, "DeviceOut", &dbv)) {
		for(int i = 0; i < nDevs; i++) {
			if((dev[i].capabilities & IAXC_AD_OUTPUT) && strcmp(dbv.pszVal, dev[i].name) == 0) out = i;
		}
		DBFreeVariant(&dbv);
	}
	/*
	if(!DBGetContactSettingTString(0, MODULE, "DeviceRing", &dbv)) {
		for(int i = 0; i < nDevs; i++) {
			if((dev[i].capabilities & IAXC_AD_RING) && strcmp(dbv.pszVal, dev[i].name) == 0) ring = i;
		}
		DBFreeVariant(&dbv);
	}
	*/

	options.port = DBGetContactSettingDword(0, MODULE, "Port", 4569);
	iaxc_audio_devices_set(in, out, ring);

	options.dlgHotkey = DBGetContactSettingWord(0, MODULE, "DlgHotkey", 0);
	options.pop_dial_in = (DBGetContactSettingByte(0, MODULE, "PopupDial", 1) == 1);
	options.pop_dial_out = (DBGetContactSettingByte(0, MODULE, "PopupDialOut", 0) == 1);
	
	options.mic_boost = (DBGetContactSettingByte(0, MODULE, "MicBoost", 0) == 1);
	iaxc_mic_boost_set(options.mic_boost ? 1 : 0);
	//options.mic_boost = (iaxc_mic_boost_get() != 0);
}
开发者ID:darkscout,项目名称:sje-miranda-plugins,代码行数:59,代码来源:options.cpp

示例9: GetStatusForContact

int GetStatusForContact(HANDLE hContact,char *szProto)
{
	int status = ID_STATUS_OFFLINE;
	if (szProto)
		status = DBGetContactSettingWord((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE);

	return (status);
}
开发者ID:dineshkummarc,项目名称:miranda-im-v0.9.47-src,代码行数:8,代码来源:clistsettings.c

示例10: import_ping_address

void import_ping_address(int index, PINGADDRESS &pa) {
	DBVARIANT dbv;
	char buf[256];
	mir_snprintf(buf, 256, "Address%d", index);
	if(!DBGetContactSetting(0, "PingPlug", buf, &dbv)) {
		strncpy(pa.pszName, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
		DBFreeVariant(&dbv);
	} else
		strcpy(pa.pszName, Translate("Unknown Address"));

	mir_snprintf(buf, 256, "Label%d", index);
	if(!DBGetContactSetting(0, "PingPlug", buf, &dbv)) {
		strncpy(pa.pszLabel, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
		DBFreeVariant(&dbv);
	} else
		strcpy(pa.pszLabel, Translate("Unknown"));

	mir_snprintf(buf, 256, "Port%d", index);
	pa.port = (int)DBGetContactSettingDword(0, "PingPlug", buf, -1);

	mir_snprintf(buf, 256, "Proto%d", index);
	if(!DBGetContactSetting(0, "PingPlug", buf, &dbv)) {
		strncpy(pa.pszProto, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
		DBFreeVariant(&dbv);
		mir_snprintf(buf, 256, "Status%d", index);
		pa.set_status = DBGetContactSettingWord(0, "PingPlug", buf, ID_STATUS_ONLINE);
		mir_snprintf(buf, 256, "Status2%d", index);
		pa.get_status = DBGetContactSettingWord(0, "PingPlug", buf, ID_STATUS_OFFLINE);
	} else
		pa.pszProto[0] = '\0';


	pa.responding = false;
	pa.round_trip_time = 0;
	pa.miss_count = 0;
	pa.index = index;
	pa.pszCommand[0] = '\0';
	pa.pszParams[0] = '\0';

	pa.item_id = 0;
	mir_snprintf(buf, 256, "Enabled%d", index);
	if(DBGetContactSettingByte(0, "PingPlug", buf, 1) == 1)
		pa.status = PS_NOTRESPONDING;
	else
		pa.status = PS_DISABLED;
}
开发者ID:darkscout,项目名称:sje-miranda-plugins,代码行数:46,代码来源:utils.cpp

示例11: getContactStatus

int getContactStatus(HANDLE hContact) {

	pSupPro ptr = getSupPro(hContact);
	if (ptr)
		return DBGetContactSettingWord(hContact, ptr->name, "Status", ID_STATUS_OFFLINE);

	return -1;
}
开发者ID:aventado,项目名称:secureimplugin,代码行数:8,代码来源:crypt_check.cpp

示例12: GetContactStatus

int GetContactStatus(HANDLE hContact)
{
	char* szProto = reinterpret_cast<char*>(CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0));
	if(szProto == NULL) 
		return ID_STATUS_OFFLINE;
	
	return DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE);
}
开发者ID:gnobal,项目名称:MirandaRelayPlugin,代码行数:8,代码来源:Common.cpp

示例13: LoadGroups

static void LoadGroups(vector<ExtraIconGroup *> &groups)
{
	unsigned int count = DBGetContactSettingWord(NULL, MODULE_NAME "Groups", "Count", 0);
	for (unsigned int i = 0; i < count; ++i)
	{
		char setting[512];
		mir_snprintf(setting, MAX_REGS(setting), "%d_count", i);
		unsigned int items = DBGetContactSettingWord(NULL, MODULE_NAME "Groups", setting, 0);
		if (items < 1)
			continue;

		mir_snprintf(setting, MAX_REGS(setting), "__group_%d", i);
		ExtraIconGroup *group = new ExtraIconGroup(setting);

		for (unsigned int j = 0; j < items; ++j)
		{
			mir_snprintf(setting, MAX_REGS(setting), "%d_%d", i, j);

			DBVARIANT dbv = { 0 };
			if (!DBGetContactSettingString(NULL, MODULE_NAME "Groups", setting, &dbv))
			{
				if (!IsEmpty(dbv.pszVal))
				{
					BaseExtraIcon *extra = GetExtraIconByName(dbv.pszVal);
					if (extra != NULL)
					{
						group->items.push_back(extra);

						if (extra->getSlot() >= 0)
							group->setSlot(extra->getSlot());
					}
				}
				DBFreeVariant(&dbv);
			}
		}

		if (group->items.size() < 2)
		{
			delete group;
			continue;
		}

		groups.push_back(group);
	}
}
开发者ID:Robyer,项目名称:miranda-plugins,代码行数:45,代码来源:extraicons.cpp

示例14: RestoreStatus

void RestoreStatus() {
	//NotifyEventHooks(hStartupDone, 0, 0);
	// do this in a seperate thread, in case we're called from an event hook to prevent double-lock on core hook critical section (csHooks)
	CallFunctionAsync(sttNotifyStartup, NULL);

	if(options.start_offline) {
		// restore global status - only works on startup since we remove the SavedGlobalStatus parameter
		WORD clist_status = DBGetContactSettingWord(0, "CList", "Status", ID_STATUS_OFFLINE),
			saved_global_status = DBGetContactSettingWord(0, MODULE, "SavedGlobalStatus", clist_status);
		if(clist_status == ID_STATUS_OFFLINE && saved_global_status != clist_status) {
#ifdef DEBUG_POPUPS
			PUShowMessage("Updater: restoring status", SM_NOTIFY);
#endif
			CallService(MS_CLIST_SETSTATUSMODE, (WPARAM)saved_global_status, 0);		
		}
	}
	DBDeleteContactSetting(0, MODULE, "SavedGlobalStatus");
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:18,代码来源:services.cpp

示例15: m_hExtraIcons

CExtraImages::CExtraImages()
			 : m_hExtraIcons(ExtraIcon_Register(ICON_STR_QUOTE,QUOTES_PROTOCOL_NAME,Quotes_MakeIconName(ICON_STR_MAIN).c_str())),
			   m_bExtraImagesInit(false),
			   m_nSlot(DBGetContactSettingWord(NULL,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_EXTRA_IMAGE_SLOT,EXTRA_ICON_ADV1))
{
	m_ahExtraImages[eiUp] = INVALID_IMAGE_HANDLE;
	m_ahExtraImages[eiDown] = INVALID_IMAGE_HANDLE;
	m_ahExtraImages[eiNotChanged] = INVALID_IMAGE_HANDLE;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:9,代码来源:ExtraImages.cpp


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