本文整理汇总了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();
}
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例11: getContactStatus
int getContactStatus(HANDLE hContact) {
pSupPro ptr = getSupPro(hContact);
if (ptr)
return DBGetContactSettingWord(hContact, ptr->name, "Status", ID_STATUS_OFFLINE);
return -1;
}
示例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);
}
示例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);
}
}
示例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");
}
示例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;
}