本文整理汇总了C++中DBWriteContactSettingByte函数的典型用法代码示例。如果您正苦于以下问题:C++ DBWriteContactSettingByte函数的具体用法?C++ DBWriteContactSettingByte怎么用?C++ DBWriteContactSettingByte使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DBWriteContactSettingByte函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: svcEnableDisableMenuCommand
//===== EnableDisableMenuCommand =====
INT_PTR svcEnableDisableMenuCommand(WPARAM wp, LPARAM lp)
{
int iResult = 0;
int iResultRoot = 0;
CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
if (PopUpOptions.ModuleIsEnabled)
{ //The module is enabled.
//The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
PopUpOptions.ModuleIsEnabled = FALSE;
DBWriteContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", FALSE);
mi.ptszName = LPGENT("Enable &popup module");
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF,0);
} else
{ //The module is disabled.
//The action to do is enable popups (show enabled), then write "disable popup" in the new item.
PopUpOptions.ModuleIsEnabled = TRUE;
DBWriteContactSettingByte(NULL, MODULNAME, "ModuleIsEnabled", TRUE);
mi.ptszName = LPGENT("Disable &popup module");
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_ON,0);
}
mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
iResult = CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
mi.flags = CMIM_ICON;
iResultRoot = CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuRoot,(LPARAM)&mi);
TTBLoaded(0,0);
ToolbarSet(0,0);
if(iResult && iResultRoot)
return 1;
else
return 0;
}
示例2: Meta_Assign
void Meta_Assign(HANDLE hSub, HANDLE hMeta) {
metaMap[hMeta].add(hSub);
DBWriteContactSettingDword(hSub, MODULE, "ParentMetaID", DBGetContactSettingDword(hMeta, MODULE, META_ID, -1));
DBWriteContactSettingDword(hSub, MODULE, "Handle", (DWORD)hMeta);
DBWriteContactSettingByte(hSub, MODULE, "IsSubcontact", 1);
if(MetaEnabled()) {
if(!meta_group_hack_disabled)
DBWriteContactSettingByte(hSub, "CList", "Hidden", 1);
} else // shouldn't happen, as the menu option is hidden when metas are disabled...
DBWriteContactSettingByte(hMeta, "CList", "Hidden", 1);
CallService(MS_IGNORE_IGNORE, (WPARAM)hSub, (WPARAM)IGNOREEVENT_USERONLINE);
DBVARIANT dbv;
if(DBGetContactSettingUTF8String(hMeta, "CList", "MyHandle", &dbv)) {
if(!DBGetContactSettingUTF8String(hSub, "CList", "MyHandle", &dbv)) {
DBWriteContactSettingUTF8String(hMeta, "CList", "MyHandle", dbv.pszVal);
DBFreeVariant(&dbv);
}
} else
DBFreeVariant(&dbv);
if(DBGetContactSettingUTF8String(hMeta, MODULE, "Nick", &dbv)) {
char *subProto = ContactProto(hSub);
if(subProto) {
if(!DBGetContactSettingUTF8String(hSub, subProto, "Nick", &dbv)) {
DBWriteContactSettingUTF8String(hMeta, MODULE, "Nick", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
} else
DBFreeVariant(&dbv);
FireSubcontactsChanged(hMeta);
}
示例3: add_contact
HANDLE add_contact(char *name, DWORD flags) {
HANDLE hContact;
// already on list?
if (hContact=find_contact(name)) {
if (!(flags & PALF_TEMPORARY) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 1)) {
DBDeleteContactSetting( hContact, "CList", "NotOnList" );
DBDeleteContactSetting( hContact, "CList", "Hidden" );
}
LOG(("add_contact: Found %s", name));
return hContact; // already there, return handle
}
// no, so add
LOG(("add_contact: Adding %s", name));
hContact=(HANDLE)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0);
if (hContact) {
if (CallServiceSync(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)SKYPE_PROTONAME)!=0) {
LOG(("add_contact: Ouch! MS_PROTO_ADDTOCONTACT failed for some reason"));
CallServiceSync(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
return NULL;
}
if (name[0]) DBWriteContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, name);
if (flags & PALF_TEMPORARY ) {
DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
}
if (name[0]) {
SkypeSend("GET USER %s DISPLAYNAME", name);
} else {LOG(("add_contact: Info: The contact added has no name."));}
} else {LOG(("add_contact: Ouch! MS_DB_CONTACT_ADD failed for some reason"));}
LOG(("add_contact succeeded"));
return hContact;
}
示例4: sprintf
void CConfig::SaveFontSettings(int iFont)
{
if(iFont > FONT_SETTINGS -1 || iFont < 0)
return;
char szSetting[128];
// Height
sprintf(szSetting,"Font%dHeight",iFont);
DBWriteContactSettingByte(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfHeight);
// Style
int style = 0;
if(m_logfont[iFont].lfWeight == FW_BOLD)
style |= FONTF_BOLD;
if(m_logfont[iFont].lfItalic)
style |= FONTF_ITALIC;
sprintf(szSetting,"Font%dStyle",iFont);
DBWriteContactSettingByte(NULL, "MirandaG15", szSetting, style);
// Charset
sprintf(szSetting,"Font%dCharset",iFont);
DBWriteContactSettingByte(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfCharSet);
// Name
sprintf(szSetting,"Font%dName",iFont);
DBWriteContactSettingTString(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfFaceName);
UpdateFontSettings(iFont);
}
示例5: MenuItem_DeleteContact
static int MenuItem_DeleteContact(WPARAM wParam,LPARAM lParam)
{
//see notes about deleting contacts on PF1_SERVERCLIST servers in m_protosvc.h
int action;
if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
{
// Ask user for confirmation, and if the contact should be archived (hidden, not deleted)
action = DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DELETECONTACT), (HWND)lParam, AskForConfirmationDlgProc, wParam);
}
else
{
action = IDYES;
}
switch(action) {
// Delete contact
case IDYES:
{
char *szProto;
szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto != NULL)
{
// Check if protocol uses server side lists
DWORD caps;
caps = (DWORD)CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps&PF1_SERVERCLIST)
{
int status;
status = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status<ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES))
{
// Set a flag so we remember to delete the contact when the protocol goes online the next time
DBWriteContactSettingByte((HANDLE)wParam, "CList", "Delete", 1);
MessageBoxA(NULL, Translate("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), Translate("Delete Contact"), MB_OK);
return 0;
}
}
}
CallService(MS_DB_CONTACT_DELETE, wParam, 0);
break;
}
// Archive contact
case IDC_HIDE:
{
DBWriteContactSettingByte((HANDLE)wParam,"CList","Hidden",1);
break;
}
}
return 0;
}
示例6: saveCollapseState
static void saveCollapseState( HWND hwndTree )
{
HTREEITEM hti;
TVITEM tvi;
hti = TreeView_GetRoot( hwndTree );
while( hti != NULL ) {
HTREEITEM ht;
tvi.mask = TVIF_STATE | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM;
tvi.hItem = hti;
tvi.stateMask = (DWORD)-1;
TreeView_GetItem( hwndTree, &tvi );
if( tvi.cChildren > 0 ) {
TreeItem *treeItem = (TreeItem *)tvi.lParam;
if ( tvi.state & TVIS_EXPANDED )
DBWriteContactSettingByte(NULL, "KeyBindingsUI", treeItem->paramName, TVIS_EXPANDED );
else
DBWriteContactSettingByte(NULL, "KeyBindingsUI", treeItem->paramName, 0 );
}
ht = TreeView_GetChild( hwndTree, hti );
if( ht == NULL ) {
ht = TreeView_GetNextSibling( hwndTree, hti );
while( ht == NULL ) {
hti = TreeView_GetParent( hwndTree, hti );
if( hti == NULL ) break;
ht = TreeView_GetNextSibling( hwndTree, hti );
} }
hti = ht;
} }
示例7: SaveUpdateOptions
void SaveUpdateOptions(char *szComponentName, UpdateOptions *update_options) {
char buff[256];
sprintf(buff, "Enable%s", szComponentName);
DBWriteContactSettingByte(0, MODULE, buff, update_options->enabled ? 1 : 0);
if(!update_options->fixed) {
sprintf(buff, "UseBeta%s", szComponentName);
DBWriteContactSettingByte(0, MODULE, buff, update_options->use_beta ? 1 : 0);
}
}
示例8: SetHideOffline
int SetHideOffline(WPARAM wParam,LPARAM lParam)
{
switch((int)wParam) {
case 0: DBWriteContactSettingByte(NULL,"CList","HideOffline",0); break;
case 1: DBWriteContactSettingByte(NULL,"CList","HideOffline",1); break;
case -1: DBWriteContactSettingByte(NULL,"CList","HideOffline",(BYTE)!DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)); break;
}
TRACE("PRE-LoadTree");
LoadContactTree();
TRACE("SetHideOffline Done\r\n");
return 0;
}
示例9: ICQserverImport
static void ICQserverImport()
{
// Clear last update stamp
DBDeleteContactSetting(NULL, szICQModuleName[ iICQAccount ], "SrvLastUpdate");
DBDeleteContactSetting(NULL, szICQModuleName[ iICQAccount ], "SrvRecordCount");
// Enable contacts downloading
DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "UseServerCList", 1);
DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "AddServerNew", 1);
DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "UseServerNicks", 1);
DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "ServerAddRemove", 1);
}
示例10: SkypeProfile_Save
void SkypeProfile_Save(SkypeProfile *pstProf)
{
DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "Gender", pstProf->Sex);
DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "HomePhone", pstProf->HomePhone);
DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "OfficePhone", pstProf->OfficePhone);
DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "HomePage", pstProf->HomePage);
DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "Nick", pstProf->FullName);
DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "City", pstProf->City);
DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "Province", pstProf->Province);
DBWriteContactSettingWord(NULL, SKYPE_PROTONAME, "BirthYear", (WORD)pstProf->Birthday.wYear);
DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "BirthMonth", (BYTE)pstProf->Birthday.wMonth);
DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "BirthDay", (BYTE)pstProf->Birthday.wDay);
}
示例11: Meta_Hide
void Meta_Hide(bool hide_metas) {
HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0);
while(hContact != NULL) {
if(IsMetacontact(hContact)) {
DBWriteContactSettingByte(hContact, "CList", "Hidden", hide_metas ? 1 : 0);
} else if(IsSubcontact(hContact)) {
if(!meta_group_hack_disabled)
DBWriteContactSettingByte(hContact, "CList", "Hidden", hide_metas ? 0 : 1);
CallService(hide_metas ? MS_IGNORE_UNIGNORE : MS_IGNORE_IGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
}
}
示例12: SetHideOffline
int SetHideOffline(WPARAM wParam, LPARAM lParam)
{
switch ((int) wParam) {
case 0:
DBWriteContactSettingByte(NULL, "CList", "HideOffline", 0); break;
case 1:
DBWriteContactSettingByte(NULL, "CList", "HideOffline", 1); break;
case -1:
DBWriteContactSettingByte(NULL, "CList", "HideOffline", (BYTE) ! DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)); break;
}
SetButtonStates(hwndContactList);
LoadContactTree();
return 0;
}
示例13: Service_PGPsetKey
INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) {
BOOL del = true;
if(bPGPloaded) {
if(bPGPkeyrings) {
char szKeyID[128];
szKeyID[0]='\0';
PVOID KeyID = pgp_select_keyid(GetForegroundWindow(),szKeyID);
if(szKeyID[0]) {
DBDeleteContactSetting((HANDLE)wParam,szModuleName,"pgp");
DBCONTACTWRITESETTING cws;
memset(&cws,0,sizeof(cws));
cws.szModule = szModuleName;
cws.szSetting = "pgp";
cws.value.type = DBVT_BLOB;
cws.value.pbVal = (LPBYTE)KeyID;
cws.value.cpbVal = pgp_size_keyid();
CallService(MS_DB_CONTACT_WRITESETTING,wParam,(LPARAM)&cws);
DBWriteContactSettingByte((HANDLE)wParam,szModuleName,"pgp_mode",0);
DBWriteContactSettingString((HANDLE)wParam,szModuleName,"pgp_abbr",szKeyID);
del = false;
}
}
else if(bPGPprivkey) {
char KeyPath[MAX_PATH];
KeyPath[0]='\0';
if(ShowSelectKeyDlg(0,KeyPath)) {
char *publ = LoadKeys(KeyPath,false);
if(publ) {
DBDeleteContactSetting((HANDLE)wParam,szModuleName,"pgp");
myDBWriteStringEncode((HANDLE)wParam,szModuleName,"pgp",publ);
DBWriteContactSettingByte((HANDLE)wParam,szModuleName,"pgp_mode",1);
DBWriteContactSettingString((HANDLE)wParam,szModuleName,"pgp_abbr","(binary)");
mir_free(publ);
del = false;
}
}
}
}
if(del) Service_PGPdelKey(wParam,lParam);
else {
pUinKey ptr = getUinKey((HANDLE)wParam);
cpp_delete_context(ptr->cntx);
ptr->cntx=0;
}
ShowStatusIconNotify((HANDLE)wParam);
return 1;
}
示例14: Meta_Convert
HANDLE Meta_Convert(HANDLE hSub) {
HANDLE hMeta = NewMetaContact();
DBWriteContactSettingByte(hMeta, MODULE, "Default", 0);
Meta_Assign(hSub, hMeta);
DBVARIANT dbv;
if(!DBGetContactSettingUTF8String(hSub, "CList", "Group", &dbv)) {
DBWriteContactSettingUTF8String(hMeta, "CList", "Group", dbv.pszVal);
DBFreeVariant(&dbv);
}
if(!DBGetContactSettingUTF8String(hSub, "CList", "MyHandle", &dbv)) {
DBWriteContactSettingUTF8String(hMeta, "CList", "MyHandle", dbv.pszVal);
DBFreeVariant(&dbv);
}
char *subProto = ContactProto(hSub);
if(subProto) {
if(!DBGetContactSettingUTF8String(hSub, subProto, "Nick", &dbv)) {
DBWriteContactSettingUTF8String(hMeta, MODULE, "Nick", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
Meta_CalcStatus(hMeta);
return hMeta;
}
示例15: RefreshContact
//Function to put all enabled contact to the Online status
void RefreshContact(void)
{
HACCOUNT Finder;
for(Finder=POP3Plugin->FirstAccount;Finder!=NULL;Finder=Finder->Next)
{
if(Finder->hContact != NULL)
{
if((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
{
DBDeleteContactSetting(Finder->hContact, "CList", "Hidden");
}
else
{
DBWriteContactSettingByte(Finder->hContact, "CList", "Hidden", 1);
}
}
else
{
if((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
{
Finder->hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)Finder->hContact,(LPARAM)ProtoName);
DBWriteContactSettingString(Finder->hContact,ProtoName,"Id",Finder->Name);
DBWriteContactSettingString(Finder->hContact,ProtoName,"Nick",Finder->Name);
DBWriteContactSettingString(Finder->hContact,"Protocol","p",ProtoName);
DBWriteContactSettingWord(Finder->hContact, ProtoName, "Status", ID_STATUS_ONLINE);
DBWriteContactSettingString(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
}
}
}
}