本文整理汇总了C++中db_get_ts函数的典型用法代码示例。如果您正苦于以下问题:C++ db_get_ts函数的具体用法?C++ db_get_ts怎么用?C++ db_get_ts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_get_ts函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: loadDBSettings
void loadDBSettings(plgsettings *ps)
{
logmsg("loadDBSettings");
ps->align=db_get_b(NULL,THIS_MODULE, "align", DEFAULT_ALIGN);
ps->salign=db_get_b(NULL,THIS_MODULE, "salign", DEFAULT_SALIGN);
ps->altShadow=db_get_b(NULL,THIS_MODULE, "altShadow", DEFAULT_ALTSHADOW);
ps->transparent=db_get_b(NULL,THIS_MODULE, "transparent", DEFAULT_TRANPARENT);
ps->showShadow=db_get_b(NULL,THIS_MODULE, "showShadow", DEFAULT_SHOWSHADOW);
ps->messages=db_get_b(NULL,THIS_MODULE, "messages", DEFAULT_ANNOUNCEMESSAGES);
ps->a_user=db_get_b(NULL,THIS_MODULE, "a_user", DEFAULT_ANNOUNCESTATUS);
ps->distance=db_get_b(NULL,THIS_MODULE, "distance", DEFAULT_DISTANCE);
ps->winx=db_get_dw(NULL,THIS_MODULE, "winx", DEFAULT_WINX);
ps->winy=db_get_dw(NULL,THIS_MODULE, "winy", DEFAULT_WINY);
ps->winxpos=db_get_dw(NULL,THIS_MODULE, "winxpos", DEFAULT_WINXPOS);
ps->winypos=db_get_dw(NULL,THIS_MODULE, "winypos", DEFAULT_WINYPOS);
ps->alpha=db_get_b(NULL,THIS_MODULE, "alpha", DEFAULT_ALPHA);
ps->showmystatus=db_get_b(NULL,THIS_MODULE, "showMyStatus", DEFAULT_SHOWMYSTATUS);
ps->timeout=db_get_dw(NULL,THIS_MODULE, "timeout", DEFAULT_TIMEOUT);
ps->clr_msg=db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG);
ps->clr_status=db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS);
ps->clr_shadow=db_get_dw(NULL,THIS_MODULE, "clr_shadow", DEFAULT_CLRSHADOW);
ps->bkclr=db_get_dw(NULL,THIS_MODULE, "bkclr", DEFAULT_BKCLR);
ps->showMsgWindow=db_get_b(NULL,THIS_MODULE, "showMessageWindow", DEFAULT_SHOWMSGWIN);
ps->showWhen=db_get_dw(NULL,THIS_MODULE,"showWhen", DEFAULT_SHOWWHEN);
DBVARIANT dbv;
if (!db_get_ts( NULL, THIS_MODULE, "message_format", &dbv )) {
_tcscpy(ps->msgformat, dbv.ptszVal);
db_free(&dbv);
}
else _tcscpy(ps->msgformat, DEFAULT_MESSAGEFORMAT);
ps->announce=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE);
ps->lf.lfHeight=db_get_dw(NULL,THIS_MODULE, "fntHeight", DEFAULT_FNT_HEIGHT);
ps->lf.lfWidth=db_get_dw(NULL,THIS_MODULE, "fntWidth", DEFAULT_FNT_WIDTH);
ps->lf.lfEscapement=db_get_dw(NULL,THIS_MODULE, "fntEscapement", DEFAULT_FNT_ESCAPEMENT);
ps->lf.lfOrientation=db_get_dw(NULL,THIS_MODULE, "fntOrientation", DEFAULT_FNT_ORIENTATION);
ps->lf.lfWeight=db_get_dw(NULL,THIS_MODULE, "fntWeight", DEFAULT_FNT_WEIGHT);
ps->lf.lfItalic=db_get_b(NULL,THIS_MODULE, "fntItalic", DEFAULT_FNT_ITALIC);
ps->lf.lfUnderline=db_get_b(NULL,THIS_MODULE, "fntUnderline", DEFAULT_FNT_UNDERLINE);
ps->lf.lfStrikeOut=db_get_b(NULL,THIS_MODULE, "fntStrikeout", DEFAULT_FNT_STRIKEOUT);
ps->lf.lfCharSet=db_get_b(NULL,THIS_MODULE, "fntCharSet", DEFAULT_FNT_CHARSET);
ps->lf.lfOutPrecision=db_get_b(NULL,THIS_MODULE, "fntOutPrecision", DEFAULT_FNT_OUTPRECISION);
ps->lf.lfClipPrecision=db_get_b(NULL,THIS_MODULE, "fntClipPrecision", DEFAULT_FNT_CLIPRECISION);
ps->lf.lfQuality=db_get_b(NULL,THIS_MODULE, "fntQuality", DEFAULT_FNT_QUALITY);
ps->lf.lfPitchAndFamily=db_get_b(NULL,THIS_MODULE, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
if(!db_get_ts(NULL,THIS_MODULE,"fntFaceName",&dbv)) {
_tcscpy(ps->lf.lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
else
_tcscpy(ps->lf.lfFaceName, DEFAULT_FNT_FACENAME);
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:57,代码来源:options.cpp
示例2: MIR_CORE_DLL
MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule, DWORD dwFlags)
{
if (hContact == NULL && szModule == NULL)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
if (szModule == NULL) szModule = "UserInfo";
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
signed char timezone = (signed char)db_get_b(hContact, szModule, "Timezone", -1);
if (timezone == -1) {
char *szProto = GetContactProto(hContact);
if (!db_get_ts(hContact, szProto, "TzName", &dbv)) {
HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
timezone = (signed char)db_get_b(hContact, szProto, "Timezone", -1);
}
if (timezone != -1) {
MIM_TIMEZONE tzsearch;
tzsearch.tzi.Bias = timezone * 30;
if (myInfo.myTZ.tzi.Bias == tzsearch.tzi.Bias) {
if (dwFlags & TZF_DIFONLY) return NULL;
return &myInfo.myTZ;
}
int i = g_timezonesBias.getIndex(&tzsearch);
while (i >= 0 && g_timezonesBias[i]->tzi.Bias == tzsearch.tzi.Bias) --i;
int delta = LONG_MAX;
for (int j = ++i; j < g_timezonesBias.getCount() && g_timezonesBias[j]->tzi.Bias == tzsearch.tzi.Bias; ++j) {
int delta1 = abs(g_timezonesBias[j]->tzi.DaylightDate.wMonth - myInfo.myTZ.tzi.DaylightDate.wMonth);
if (delta1 <= delta) {
delta = delta1;
i = j;
}
}
if (i >= 0) {
MIM_TIMEZONE *tz = g_timezonesBias[i];
return ((dwFlags & TZF_DIFONLY) && IsSameTime(tz)) ? NULL : tz;
}
}
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:52,代码来源:timezones.cpp
示例3: DBGetData
// getting weather setting from database
// return 0 on success
int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv)
{
if (db_get_ts(hContact, WEATHERCONDITION, setting, dbv)) {
size_t len = mir_strlen(setting) + 1;
char *set = (char*)alloca(len + 1);
*set = '#';
memcpy(set + 1, setting, len);
if (db_get_ts(hContact, WEATHERCONDITION, set, dbv))
return 1;
}
return 0;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:15,代码来源:weather_data.cpp
示例4: GetAwayMessage
static TCHAR* GetAwayMessage(int statusMode, char *szProto)
{
if (szProto && !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(statusMode)))
return NULL;
if ( GetStatusModeByte(statusMode, "Ignore"))
return NULL;
DBVARIANT dbv;
if ( GetStatusModeByte(statusMode, "UsePrev")) {
if ( db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Msg"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(statusMode));
}
else {
if ( db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusMode, "Default"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(statusMode));
for (int i=0; dbv.ptszVal[i]; i++) {
if (dbv.ptszVal[i] != '%')
continue;
TCHAR substituteStr[128];
if ( !_tcsnicmp(dbv.ptszVal + i, _T("%time%"), 6)) {
MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
if (mii.idleType == 1) {
int mm;
SYSTEMTIME t;
GetLocalTime(&t);
mm = t.wMinute + t.wHour * 60 - mii.idleTime;
if (mm < 0) mm += 60 * 24;
t.wMinute = mm % 60;
t.wHour = mm / 60;
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &t, NULL, substituteStr, SIZEOF(substituteStr));
}
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, SIZEOF(substituteStr));
}
else if ( !_tcsnicmp(dbv.ptszVal + i, _T("%date%"), 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, SIZEOF(substituteStr));
else continue;
if (lstrlen(substituteStr) > 6)
dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (lstrlen(dbv.ptszVal) + 1 + lstrlen(substituteStr) - 6) * sizeof(TCHAR));
MoveMemory(dbv.ptszVal + i + lstrlen(substituteStr), dbv.ptszVal + i + 6, (lstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
CopyMemory(dbv.ptszVal+i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
}
}
return dbv.ptszVal;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:50,代码来源:sendmsg.cpp
示例5: GetStatusMessage
int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus_has_priority)
{
DBVARIANT dbv = { 0 };
BOOL noAwayMsg = FALSE;
WORD wStatus = pdnce___GetStatus(pdnce);
text[0] = '\0';
// Hide status text if Offline /// no offline
if (wStatus == ID_STATUS_OFFLINE || wStatus == 0) noAwayMsg = TRUE;
// Get XStatusMsg
if (!noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
// Try to get XStatusMsg
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
if (text[0] != '\0')
return -1;
}
}
// Get StatusMsg
if (pdnce->hContact && text[0] == '\0') {
if (!db_get_ts(pdnce->hContact, "CList", "StatusMsg", &dbv)) {
//mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
if (text[0] != '\0')
return 1;
}
}
// Get XStatusMsg
if (!noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto && text[0] == '\0') {
// Try to get XStatusMsg
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//mir_tstrncpy(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1);
db_free(&dbv);
if (text[0] != '\0')
return -1;
}
}
return 1;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:49,代码来源:modern_cachefuncs.cpp
示例6: import_ping_address
void import_ping_address(int index, PINGADDRESS &pa) {
DBVARIANT dbv;
char buf[256];
mir_snprintf(buf, "Address%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
mir_tstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
db_free(&dbv);
}
else
mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), _countof(pa.pszName));
mir_snprintf(buf, "Label%d", index);
if (!db_get_ts(0, "PingPlug", buf, &dbv)) {
mir_tstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else
mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), _countof(pa.pszLabel));
mir_snprintf(buf, "Port%d", index);
pa.port = (int)db_get_dw(0, "PingPlug", buf, -1);
mir_snprintf(buf, "Proto%d", index);
if (!db_get_s(0, "PingPlug", buf, &dbv)) {
mir_strncpy(pa.pszProto, dbv.pszVal, _countof(pa.pszProto));
db_free(&dbv);
mir_snprintf(buf, "Status%d", index);
pa.set_status = db_get_w(0, "PingPlug", buf, ID_STATUS_ONLINE);
mir_snprintf(buf, "Status2%d", index);
pa.get_status = db_get_w(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, "Enabled%d", index);
if (db_get_b(0, "PingPlug", buf, 1) == 1)
pa.status = PS_NOTRESPONDING;
else
pa.status = PS_DISABLED;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:49,代码来源:utils.cpp
示例7: __declspec
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfoEx);
mir_getCLI();
// Load plugin options from DB
hForwardFrom = (MCONTACT)db_get_dw(NULL, "yaRelay", "ForwardFrom", 0);
hForwardTo = (MCONTACT)db_get_dw(NULL, "yaRelay", "ForwardTo", 0);
iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
DBVARIANT dbv;
if (!db_get_ts(NULL, "yaRelay", "ForwardTemplate", &dbv)){
_tcsncpy(tszForwardTemplate, dbv.ptszVal, SIZEOF(tszForwardTemplate));
db_free(&dbv);
}
else _tcsncpy(tszForwardTemplate, _T("%u: %m"), MAXTEMPLATESIZE-1);
iSplit = db_get_dw(NULL, "yaRelay", "Split", 0);
iSplitMaxSize = db_get_dw(NULL, "yaRelay", "SplitMaxSize", 100);
iSendParts = db_get_dw(NULL, "yaRelay", "SendParts", 0);
iMarkRead = db_get_dw(NULL, "yaRelay", "MarkRead", 0);
iSendAndHistory = db_get_dw(NULL, "yaRelay", "SendAndHistory", 1);
// hook events
HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
HookEvent(ME_OPT_INITIALISE, OptionsInit);
HookEvent(ME_PROTO_ACK, ProtoAck);
return 0;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:30,代码来源:main.cpp
示例8: fnGetFontSetting
void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
{
DBVARIANT dbv;
char idstr[20];
BYTE style;
cli.pfnGetDefaultFontSetting(i, lf, colour);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
if (!db_get_ts(NULL, "CLC", idstr, &dbv)) {
lstrcpy(lf->lfFaceName, dbv.ptszVal);
mir_free(dbv.pszVal);
}
mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
*colour = db_get_dw(NULL, "CLC", idstr, *colour);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
lf->lfHeight = (char) db_get_b(NULL, "CLC", idstr, lf->lfHeight);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
style = (BYTE) db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = (style & DBFONTF_ITALIC) != 0;
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:30,代码来源:clcutils.cpp
示例9: GetProfileName
INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam)
{
int profile = (int)wParam;
if (profile < 0) // get default profile
profile = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0);
int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0);
if (profile >= count && count > 0)
return -1;
TCHAR* buf = (TCHAR*)lParam;
if (count == 0) {
_tcsncpy(buf, TranslateT("default"), 128-1);
return 0;
}
DBVARIANT dbv;
char setting[80];
mir_snprintf(setting, "%d_%s", profile, SETTING_PROFILENAME);
if ( db_get_ts(NULL, MODULENAME, setting, &dbv))
return -1;
_tcsncpy(buf, dbv.ptszVal, 128-1);
buf[127] = 0;
db_free(&dbv);
return 0;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:27,代码来源:profiles.cpp
示例10: fnDeleteItemFromTree
void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem)
{
ClcContact *contact;
ClcGroup *group;
struct ClcData *dat = (struct ClcData *) GetWindowLongPtr(hwnd, 0);
dat->needsResort = 1;
if (!cli.pfnFindItem(hwnd, dat, hItem, &contact, &group, NULL)) {
DBVARIANT dbv;
int i, nameOffset;
if (!IsHContactContact(hItem))
return;
if (db_get_ts(hItem, "CList", "Group", &dbv))
return;
//decrease member counts of all parent groups too
group = &dat->list;
nameOffset = 0;
for (i=0;; i++) {
if (group->scanIndex == group->cl.count)
break;
if (group->cl.items[i]->type == CLCIT_GROUP) {
size_t len = mir_tstrlen(group->cl.items[i]->szText);
if (!_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) &&
(dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) {
group->totalMembers--;
if (dbv.ptszVal[nameOffset + len] == '\0')
break;
}
}
}
mir_free(dbv.ptszVal);
}
else cli.pfnRemoveItemFromGroup(hwnd, group, contact, 1);
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:35,代码来源:clcitems.cpp
示例11: SaveUserSessionName
int SaveUserSessionName(TCHAR *szUSessionName)
{
int i=0;
DBVARIANT dbv={0};
char szUserSessionNameBuf[256]={0};
TCHAR *szUserSessionNameBuf_1=NULL;
TCHAR *szUserSessionName=NULL;
TCHAR *ptr=NULL;
if (session_list[0]!=0)
{
szUserSessionName = mir_tstrdup(szUSessionName);
mir_snprintf(szUserSessionNameBuf, SIZEOF(szUserSessionNameBuf), "%s_%u", "UserSessionDsc", 0);
if (!db_get_ts(NULL, MODNAME, szUserSessionNameBuf, &dbv))
{
szUserSessionNameBuf_1 = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
ResaveSettings("UserSessionDsc",1,255,szUserSessionNameBuf_1);
}
db_set_ts(NULL, MODNAME, szUserSessionNameBuf, szUserSessionName);
//free(szUserSessionNameBuf_1);
mir_free(szUserSessionName);
return 0;
}
return 1;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:29,代码来源:Main.cpp
示例12: logoff_contacts
void logoff_contacts(BOOL bCleanup) {
MCONTACT hContact;
char *szProto;
DBVARIANT dbv = { 0 };
LOG(("logoff_contacts: Logging off contacts."));
for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0);
if (szProto != NULL && !strcmp(szProto, SKYPE_PROTONAME))
{
if (db_get_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE);
db_unset(hContact, SKYPE_PROTONAME, "CallId");
if (db_get_b(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 1)
{
if (db_get_ts(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue;
RemChat(dbv.ptszVal);
db_free(&dbv);
}
if (db_get_s(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv) == 0)
{
if (bCleanup) SkypeSend("ALTER APPLICATION libpurple_typing DISCONNECT %s", dbv.pszVal);
db_free(&dbv);
db_unset(hContact, SKYPE_PROTONAME, "Typing_Stream");
}
}
}
if (bCleanup && (protocol >= 5 || bIsImoproxy)) SkypeSend("DELETE APPLICATION libpurple_typing");
}
开发者ID:martok,项目名称:miranda-ng,代码行数:31,代码来源:contacts.cpp
示例13: UserinfoDlgProc
INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
DBVARIANT dbv;
switch(msg) {
case WM_INITDIALOG:
mir_subclassWindow( GetDlgItem(hdlg, IDC_INFOTEXT), EditProc);
{
TCHAR *szout;
if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
szout = ParseString(dbv.ptszVal, (HANDLE)lparam, 0);
db_free(&dbv);
}
else szout = ParseString(DEFAULT_USERSTAMP, (HANDLE)lparam, 0);
SetDlgItemText(hdlg, IDC_INFOTEXT, szout);
if ( !lstrcmp(szout, TranslateT("<unknown>")))
EnableWindow( GetDlgItem(hdlg, IDC_INFOTEXT), FALSE);
}
break;
case WM_COMMAND:
if (HIWORD(wparam) == EN_SETFOCUS)
SetFocus( GetParent(hdlg));
break;
}
return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:29,代码来源:userinfo.cpp
示例14: LoadHistoryList
void LoadHistoryList(MCONTACT hContact, HWND hwnd, int nList)
{
SendDlgItemMessage(hwnd, nList, LB_RESETCONTENT, 0, 0);
int historyMax = db_get_w(NULL, S_MOD, "HistoryMax", 10);
if (historyMax < 0)
historyMax = 0;
else if (historyMax > 99)
historyMax = 99;
if (historyMax == 0)
return;
int historyFirst = db_get_w(hContact, S_MOD, "HistoryFirst", 0);
if (historyFirst >= historyMax)
historyFirst = 0;
int historyLast = db_get_w(hContact, S_MOD, "HistoryLast", 0);
if (historyLast >= historyMax)
historyLast = historyMax - 1;
for (int i = historyLast; i != historyFirst;) {
i = (i - 1 + historyMax) % historyMax;
DBVARIANT dbv;
if (!db_get_ts(hContact, S_MOD, BuildSetting(i), &dbv)) {
SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
else SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)_T(""));
}
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:30,代码来源:history.cpp
示例15: Cache_GetFirstLineText
/*
* Get the text for First Line
*/
void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact)
{
if (GetCurrentThreadId() != g_dwMainThreadID)
return;
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(contact->hContact);
TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact, 0);
if (dat->first_line_append_nick && (!dat->force_in_dialog)) {
DBVARIANT dbv = { 0 };
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
TCHAR nick[_countof(contact->szText)];
mir_tstrncpy(nick, dbv.ptszVal, _countof(contact->szText));
db_free(&dbv);
// They are the same -> use the name to keep the case
if (mir_tstrcmpi(name, nick) == 0)
mir_tstrncpy(contact->szText, name, _countof(contact->szText));
else // Append then
mir_sntprintf(contact->szText, _T("%s - %s"), name, nick);
}
else mir_tstrncpy(contact->szText, name, _countof(contact->szText));
}
else mir_tstrncpy(contact->szText, name, _countof(contact->szText));
if (!dat->force_in_dialog) {
SHORTDATA data = { 0 };
Sync(CLUI_SyncGetShortData, (WPARAM)pcli->hwndContactTree, (LPARAM)&data);
contact->ssText.ReplaceSmileys(&data, pdnce, contact->szText, dat->first_line_draw_smileys);
}
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:33,代码来源:modern_cachefuncs.cpp
示例16: ProcessChatEvent
static int ProcessChatEvent(WPARAM, LPARAM lParam)
{
GCEVENT *gce = (GCEVENT*)lParam;
if (gce == NULL || gce->pDest == NULL)
return 0;
GCDEST *gcd = (GCDEST*)gce->pDest;
if (gcd->iType != GC_EVENT_MESSAGE)
return 0;
MCONTACT hContact = pci->FindRoom(gcd->pszModule, gcd->ptszID);
if (hContact != 0) {
ptrT nick(db_get_tsa(hContact, gcd->pszModule, "MyNick"));
if (nick == NULL || gce->ptszText == NULL)
return 0;
if (_tcsstr(gce->ptszText, nick)) {
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
TCHAR PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
isOwnSound = 0;
SkinPlaySoundFile(PlaySoundPath);
db_free(&dbv);
isOwnSound = 1;
}
}
}
return 0;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:31,代码来源:xsn_main.cpp
示例17: RunVirusScannerThread
static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
{
DBVARIANT dbv;
if (!db_get_ts(NULL, "SRFile", "ScanCmdLine", &dbv)) {
if (dbv.ptszVal[0]) {
STARTUPINFO si = { 0 };
si.cb = sizeof(si);
TCHAR *pszReplace = _tcsstr(dbv.ptszVal, _T("%f"));
TCHAR szCmdLine[768];
if (pszReplace) {
if (info->szFile[mir_tstrlen(info->szFile) - 1] == '\\')
info->szFile[mir_tstrlen(info->szFile) - 1] = '\0';
*pszReplace = 0;
mir_sntprintf(szCmdLine, _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2);
} else
_tcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE);
PROCESS_INFORMATION pi;
if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
if (WaitForSingleObject(pi.hProcess, 3600 * 1000) == WAIT_OBJECT_0)
PostMessage(info->hwndReply, M_VIRUSSCANDONE, info->returnCode, 0);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
}
db_free(&dbv);
}
mir_free(info->szFile);
mir_free(info);
}
开发者ID:gloria8023,项目名称:miranda-ng,代码行数:30,代码来源:filexferdlg.cpp
示例18: MyDBGetContactSettingTString
TCHAR* MyDBGetContactSettingTString(MCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
{
DBVARIANT dbv;
out[0] = _T('\0');
if (!db_get_ts(hContact, module, setting, &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, out, (int)len);
else if (dbv.type == DBVT_UTF8)
MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, out, (int)len);
else if (dbv.type == DBVT_WCHAR)
mir_tstrncpy(out, dbv.pwszVal, (int)len);
else if (def != NULL)
mir_tstrncpy(out, def, (int)len);
db_free(&dbv);
}
else {
if (def != NULL)
mir_tstrncpy(out, def, (int)len);
}
return out;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:25,代码来源:init.cpp
示例19: mir_snprintf
void CConfig::LoadFontSettings(int iFont)
{
if(iFont > FONT_SETTINGS -1 || iFont < 0)
return;
char szSetting[128];
// Fixed Values
m_logfont[iFont].lfOutPrecision = OUT_DEFAULT_PRECIS;
m_logfont[iFont].lfClipPrecision = CLIP_DEFAULT_PRECIS;
m_logfont[iFont].lfQuality = DEFAULT_QUALITY;
m_logfont[iFont].lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
// Height
mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dHeight",iFont);
m_logfont[iFont].lfHeight = (char) db_get_b(NULL, "MirandaG15", szSetting, -MulDiv(6, 96, 72));
// Style
mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dStyle",iFont);
int style = db_get_b(NULL, "MirandaG15", szSetting, 0);
m_logfont[iFont].lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
m_logfont[iFont].lfItalic = style & FONTF_ITALIC ? 1 : 0;
// Charset
mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dCharset",iFont);
m_logfont[iFont].lfCharSet = db_get_b(NULL, "MirandaG15", szSetting, DEFAULT_CHARSET);
// Name
mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dName",iFont);
DBVARIANT dbv;
if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv))
lstrcpy(m_logfont[iFont].lfFaceName,_T("Small Fonts"));
else {
lstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
db_free(&dbv);
}
UpdateFontSettings(iFont);
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:35,代码来源:CConfig.cpp
示例20: LoadOptions
int LoadOptions(void)
{
options.backup_types = (BackupType)db_get_b(0, "AutoBackups", "BackupType", (BYTE)(BT_PERIODIC));
options.period = (unsigned int)db_get_w(0, "AutoBackups", "Period", 1);
options.period_type = (PeriodType)db_get_b(0, "AutoBackups", "PeriodType", (BYTE)PT_DAYS);
if (!ServiceExists(MS_FOLDERS_GET_PATH)) {
DBVARIANT dbv;
if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
TCHAR *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
mir_sntprintf(options.folder, _countof(options.folder), _T("%s\\%s"), profilePath, dbv.ptszVal);
db_free(&dbv);
mir_free(tmp);
}
else
mir_sntprintf(options.folder, _countof(options.folder), _T("%s%s"), DIR, SUB_DIR);
}
options.num_backups = db_get_w(0, "AutoBackups", "NumBackups", 3);
options.disable_progress = (BOOL)db_get_b(0, "AutoBackups", "NoProgress", 0);
options.disable_popups = (BOOL)db_get_b(0, "AutoBackups", "NoPopups", 0);
options.use_zip = (BOOL)db_get_b(0, "AutoBackups", "UseZip", 0);
SetBackupTimer();
return 0;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:32,代码来源:options.cpp
注:本文中的db_get_ts函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论