diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
commit | c370af60855db957c5b200914bf0bde743845528 (patch) | |
tree | 0bd2ef127097c9e937c2650e8b202c3f09453323 /plugins | |
parent | 7f082bd5d4865c30b313661b7a02f048b4b137be (diff) |
mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible
git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
321 files changed, 4308 insertions, 4456 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index f723c05f81..76526891be 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -149,7 +149,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) // Default value
if (cacn.hash[0] == '\0')
- mir_sntprintf(cacn.hash, _countof(cacn.hash), _T("AVS-HASH-%x"), GetFileHash(cacn.filename));
+ mir_sntprintf(cacn.hash, _T("AVS-HASH-%x"), GetFileHash(cacn.filename));
NotifyEventHooks(hEventContactAvatarChanged, (WPARAM)cacn.hContact, (LPARAM)&cacn);
}
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 6ed85901fd..e48e8dc82d 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -142,10 +142,10 @@ static void LoadProtoInfo(PROTOCOLDESCRIPTOR *proto) return;
char protoName[MAX_PATH];
- mir_snprintf(protoName, _countof(protoName), "Global avatar for %s accounts", proto->szName);
+ mir_snprintf(protoName, "Global avatar for %s accounts", proto->szName);
TCHAR protoNameTmp[MAX_PATH];
- mir_sntprintf(protoNameTmp, _countof(protoNameTmp), TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
+ mir_sntprintf(protoNameTmp, TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
protoPicCacheEntry *pce = new protoPicCacheEntry;
if (CreateAvatarInCache(0, pce, protoName) != 1)
db_unset(0, PPICT_MODULE, protoName);
@@ -323,7 +323,7 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm static int ModulesLoaded(WPARAM, LPARAM)
{
TCHAR szEventName[100];
- mir_sntprintf(szEventName, _countof(szEventName), _T("avs_loaderthread_%d"), GetCurrentThreadId());
+ mir_sntprintf(szEventName, _T("avs_loaderthread_%d"), GetCurrentThreadId());
hLoaderEvent = CreateEvent(NULL, TRUE, FALSE, szEventName);
SetThreadPriority(mir_forkthread(PicLoader, 0), THREAD_PRIORITY_IDLE);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 3294089c99..5909a0d1ea 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -388,7 +388,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) { if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) { TCHAR szFinalPath[MAX_PATH]; - mir_sntprintf(szFinalPath, _countof(szFinalPath), _T("%%miranda_path%%\\%s"), dbv.ptszVal); + mir_sntprintf(szFinalPath, _T("%%miranda_path%%\\%s"), dbv.ptszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); } else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.ptszVal); diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 33084606e9..da081abf46 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -347,7 +347,7 @@ void SaveImage(SaveProtocolData &d, char *protocol, int format) if (!Proto_IsAvatarFormatSupported(protocol, format))
return;
- mir_sntprintf(d.image_file_name, _countof(d.image_file_name), _T("%s%s"), d.temp_file, ProtoGetAvatarExtension(format));
+ mir_sntprintf(d.image_file_name, _T("%s%s"), d.temp_file, ProtoGetAvatarExtension(format));
if (BmpFilterSaveBitmap(d.hBmpProto, d.image_file_name, format == PA_FORMAT_JPEG ? JPEG_QUALITYSUPERB : 0))
return;
@@ -550,13 +550,13 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo TCHAR globalFile[1024];
BOOL saved = TRUE;
if (FoldersGetCustomPathT(hGlobalAvatarFolder, globalFile, _countof(globalFile), _T(""))) {
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s%s"), g_szDataPath, _T("GlobalAvatar"));
+ mir_sntprintf(globalFile, _T("%s%s"), g_szDataPath, _T("GlobalAvatar"));
CreateDirectory(globalFile, NULL);
}
TCHAR *ext = _tcsrchr(szFinalName, _T('.')); // Can't be NULL here
if (format == PA_FORMAT_XML || format == PA_FORMAT_SWF) {
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s\\my_global_avatar%s"), globalFile, ext);
+ mir_sntprintf(globalFile, _T("%s\\my_global_avatar%s"), globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
}
else {
@@ -574,12 +574,12 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo // Check if need to resize
if (hBmpTmp == hBmp || hBmpTmp == NULL) {
// Use original image
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s\\my_global_avatar%s"), globalFile, ext);
+ mir_sntprintf(globalFile, _T("%s\\my_global_avatar%s"), globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
}
else {
// Save as PNG
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s\\my_global_avatar.png"), globalFile);
+ mir_sntprintf(globalFile, _T("%s\\my_global_avatar.png"), globalFile);
if (BmpFilterSaveBitmap(hBmpTmp, globalFile, 0))
saved = FALSE;
@@ -685,10 +685,10 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) TCHAR title[256];
if (protocol == NULL)
- mir_sntprintf(title, _countof(title), TranslateT("Set My Avatar"));
+ mir_sntprintf(title, TranslateT("Set My Avatar"));
else {
TCHAR* prototmp = mir_a2t(protocol);
- mir_sntprintf(title, _countof(title), TranslateT("Set My Avatar for %s"), prototmp);
+ mir_sntprintf(title, TranslateT("Set My Avatar for %s"), prototmp);
mir_free(prototmp);
}
ofn.lpstrTitle = title;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 6b2ffdeb4b..5167b3714e 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -103,7 +103,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if (pdescr == NULL)
return -1;
char key[MAX_PATH];
- mir_snprintf(key, _countof(key), "Global avatar for %s accounts", pdescr->szProtoName);
+ mir_snprintf(key, "Global avatar for %s accounts", pdescr->szProtoName);
if (tszValue = db_get_tsa(NULL, PPICT_MODULE, key))
MyPathToAbsolute(tszValue, tszFilename);
}
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 44f27182e1..def0c416ff 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -268,9 +268,9 @@ static TCHAR* GetAssocTypeDesc(const ASSOCDATA *assoc) {
static TCHAR szDesc[32];
if (assoc->pszFileExt == NULL)
- mir_sntprintf(szDesc, _countof(szDesc), _T("%hs:"), assoc->pszClassName);
+ mir_sntprintf(szDesc, _T("%hs:"), assoc->pszClassName);
else
- mir_sntprintf(szDesc, _countof(szDesc), TranslateT("%hs files"), assoc->pszFileExt);
+ mir_sntprintf(szDesc, TranslateT("%hs files"), assoc->pszFileExt);
return szDesc;
}
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 13812e61d4..79d710ff7c 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -33,7 +33,7 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, char *pszErr;
pszErr = GetWinErrorDescription(res);
pszInfo2 = s2t(pszInfo, fInfoUnicode, FALSE); /* does NULL check */
- mir_sntprintf(szMsg, _countof(szMsg), TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
+ mir_sntprintf(szMsg, TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
MessageBox(NULL, szMsg, TranslateT("Registry warning"), MB_OK | MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST | MB_TASKMODAL);
if (pszErr != NULL) LocalFree(pszErr);
mir_free(pszInfo2); /* does NULL check */
@@ -156,7 +156,7 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) }
TCHAR tszBuffer[1024];
- mir_sntprintf(tszBuffer, _countof(tszBuffer), pszFmt, szExe, szDbFile);
+ mir_sntprintf(tszBuffer, pszFmt, szExe, szDbFile);
return mir_tstrdup(tszBuffer);
}
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index cd4994331a..fc8b9df999 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -36,32 +36,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HINSTANCE hInst;
/* a copy of those in m_assocmgr.h, as we did not #include those helpers */
-__inline static int AssocMgr_AddNewFileTypeT(const char *ext,const char *mime,const TCHAR *desc,const TCHAR *verb,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+__inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, const TCHAR *desc, const TCHAR *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
FILETYPEDESC ftd;
- ftd.cbSize=sizeof(FILETYPEDESC);
- ftd.pszFileExt=ext;
- ftd.pszMimeType=mime;
- ftd.ptszDescription=desc;
- ftd.hInstance=hinst;
- ftd.nIconResID=iconid;
- ftd.ptszVerbDesc=verb;
- ftd.pszService=service;
- ftd.flags=flags|FTDF_TCHAR;
- return CallService(MS_ASSOCMGR_ADDNEWFILETYPE,0,(LPARAM)&ftd);
+ ftd.cbSize = sizeof(FILETYPEDESC);
+ ftd.pszFileExt = ext;
+ ftd.pszMimeType = mime;
+ ftd.ptszDescription = desc;
+ ftd.hInstance = hinst;
+ ftd.nIconResID = iconid;
+ ftd.ptszVerbDesc = verb;
+ ftd.pszService = service;
+ ftd.flags = flags | FTDF_TCHAR;
+ return CallService(MS_ASSOCMGR_ADDNEWFILETYPE, 0, (LPARAM)&ftd);
}
-static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+static int __inline AssocMgr_AddNewUrlType(const char *prefix, const char *desc, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
URLTYPEDESC utd;
- utd.cbSize=sizeof(URLTYPEDESC);
- utd.pszProtoPrefix=prefix;
- utd.pszDescription=desc;
- utd.hInstance=hinst;
- utd.nIconResID=iconid;
- utd.pszService=service;
- utd.flags=flags&~UTDF_UNICODE;
- return CallService(MS_ASSOCMGR_ADDNEWURLTYPE,0,(LPARAM)&utd);
+ utd.cbSize = sizeof(URLTYPEDESC);
+ utd.pszProtoPrefix = prefix;
+ utd.pszDescription = desc;
+ utd.hInstance = hinst;
+ utd.nIconResID = iconid;
+ utd.pszService = service;
+ utd.flags = flags&~UTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWURLTYPE, 0, (LPARAM)&utd);
}
// -----------------------------------------
@@ -72,10 +72,10 @@ static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,H #define IDI_AOL 28
#define MOD_KEY_CL "CList"
#define AIM_KEY_NL "NotOnList"
-struct oscar_data { HINSTANCE hInstance; } static conn;
+struct oscar_data { HINSTANCE hInstance; } static conn;
static __inline HANDLE find_contact(const char *nick) { nick; return NULL; }
static __inline HANDLE add_contact(const char *nick) { nick; return db_find_first(); }
-static __inline void aim_gchat_joinrequest(const char *room, int exchange) { room; exchange; MessageBoxA(NULL,"Join group chat!",room,MB_OK); return; }
+static __inline void aim_gchat_joinrequest(const char *room, int exchange) { room; exchange; MessageBoxA(NULL, "Join group chat!", room, MB_OK); return; }
#include <m_protosvc.h>
#include <m_message.h>
@@ -83,116 +83,116 @@ static __inline void aim_gchat_joinrequest(const char *room, int exchange) { roo static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseLink;
-static int ServiceParseAimLink(WPARAM,LPARAM lParam)
+static int ServiceParseAimLink(WPARAM, LPARAM lParam)
{
- char *arg=(char*)lParam;
- if(arg==NULL) return 1; /* sanity check */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
+ char *arg = (char*)lParam;
+ if (arg == NULL) return 1; /* sanity check */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
/*
add user: aim:addbuddy?screenname=NICK&groupname=GROUP
send message: aim:goim?screenname=NICK&message=MSG
open chatroom: aim:gochat?roomname=ROOM&exchange=NUM
*/
- /* add a contact to the list */
- if (!_strnicmp(arg,"addbuddy?",9)) {
- char *tok,*sn=NULL,*group=NULL;
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if (*(arg+=9)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
- sn=Netlib_UrlDecode(tok+11);
- if (!_strnicmp(tok,"groupname=",10) && *(tok+10)!=0)
- group=Netlib_UrlDecode(tok+10); /* group is currently ignored */
- tok=strtok(NULL,"&"); /* next token */
- }
- if(sn==NULL) return 1; /* parse failed */
- if(find_contact(sn)==NULL) { /* does not yet check if sn is current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=AIM_PROTOCOL_NAME;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=sn;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ /* add a contact to the list */
+ if (!_strnicmp(arg, "addbuddy?", 9)) {
+ char *tok, *sn = NULL, *group = NULL;
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (*(arg += 9) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "screenname=", 11) && *(tok + 11) != 0)
+ sn = Netlib_UrlDecode(tok + 11);
+ if (!_strnicmp(tok, "groupname=", 10) && *(tok + 10) != 0)
+ group = Netlib_UrlDecode(tok + 10); /* group is currently ignored */
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (sn == NULL) return 1; /* parse failed */
+ if (find_contact(sn) == NULL) { /* does not yet check if sn is current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = AIM_PROTOCOL_NAME;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = sn;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
- /* send a message to a contact */
- else if (!_strnicmp(arg,"goim?",5)) {
- char *tok,*sn=NULL,*msg=NULL;
- MCONTACT hContact;
- if (*(arg+=5)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
- sn=Netlib_UrlDecode(tok+11);
- if (!_strnicmp(tok,"message=",8) && *(tok+8)!=0)
- msg=Netlib_UrlDecode(tok+8);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(sn==NULL) return 1; /* parse failed */
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=find_contact(sn);
- if(hContact==NULL) {
- hContact=add_contact(sn); /* does not yet check if sn is current user */
- if(hContact!=NULL)
- db_set_b(hContact,MOD_KEY_CL,AIM_KEY_NL,1);
- }
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,(LPARAM)msg);
+ }
+ /* send a message to a contact */
+ else if (!_strnicmp(arg, "goim?", 5)) {
+ char *tok, *sn = NULL, *msg = NULL;
+ MCONTACT hContact;
+ if (*(arg += 5) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "screenname=", 11) && *(tok + 11) != 0)
+ sn = Netlib_UrlDecode(tok + 11);
+ if (!_strnicmp(tok, "message=", 8) && *(tok + 8) != 0)
+ msg = Netlib_UrlDecode(tok + 8);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (sn == NULL) return 1; /* parse failed */
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = find_contact(sn);
+ if (hContact == NULL) {
+ hContact = add_contact(sn); /* does not yet check if sn is current user */
+ if (hContact != NULL)
+ db_set_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 1);
+ }
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)msg);
}
return 0;
- }
- /* open a chatroom */
- else if (!_strnicmp(arg,"gochat?",7)) {
- char *tok,*rm=NULL;
- int exchange=0;
- if (*(arg+=7)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"roomname=",9) && *(tok+9)!=0)
- rm=Netlib_UrlDecode(tok+9);
- if (!_strnicmp(tok,"exchange=",9))
- exchange=atoi(Netlib_UrlDecode(tok+9));
- tok=strtok(NULL,"&"); /* next token */
- }
- if(rm==NULL || exchange<=0) return 1; /* parse failed */
- aim_gchat_joinrequest(rm,exchange);
+ }
+ /* open a chatroom */
+ else if (!_strnicmp(arg, "gochat?", 7)) {
+ char *tok, *rm = NULL;
+ int exchange = 0;
+ if (*(arg += 7) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "roomname=", 9) && *(tok + 9) != 0)
+ rm = Netlib_UrlDecode(tok + 9);
+ if (!_strnicmp(tok, "exchange=", 9))
+ exchange = atoi(Netlib_UrlDecode(tok + 9));
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (rm == NULL || exchange <= 0) return 1; /* parse failed */
+ aim_gchat_joinrequest(rm, exchange);
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int AimLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int AimLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char service_name[MAXMODULELABELLENGTH];
+ char service_name[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(service_name,_countof(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
+ mir_snprintf(service_name, _countof(service_name), "%s%s", AIM_PROTOCOL_NAME, "ParseAimLink");
/* or "AOL Instant Messenger Links" */
- AssocMgr_AddNewUrlType("aim:",Translate("AIM link protocol"),conn.hInstance,IDI_AOL,service_name,0);
- return 0;
+ AssocMgr_AddNewUrlType("aim:", Translate("AIM link protocol"), conn.hInstance, IDI_AOL, service_name, 0);
+ return 0;
}
void aim_links_init()
{
- char service_name[MAXMODULELABELLENGTH];
- //LOG(LOG_DEBUG,"Links: init");
- mir_snprintf(service_name,_countof(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
- hServiceParseLink=CreateServiceFunction(service_name,ServiceParseAimLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,AimLinksModulesLoaded);
+ char service_name[MAXMODULELABELLENGTH];
+ //LOG(LOG_DEBUG,"Links: init");
+ mir_snprintf(service_name, _countof(service_name), "%s%s", AIM_PROTOCOL_NAME, "ParseAimLink");
+ hServiceParseLink = CreateServiceFunction(service_name, ServiceParseAimLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, AimLinksModulesLoaded);
}
void aim_links_destroy()
{
- //LOG(LOG_DEBUG,"Links: destroy");
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseLink);
+ //LOG(LOG_DEBUG,"Links: destroy");
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseLink);
}
#endif
@@ -203,19 +203,20 @@ void aim_links_destroy() #define gpszICQProtoName "ICQ"
#define IDI_ICQ 101
#define hInst GetModuleHandleA("ICQ")
-static __inline HANDLE HContactFromUIN(DWORD dwUIN,int *Added) { dwUIN; Added; return db_find_first(); }
+static __inline HANDLE HContactFromUIN(DWORD dwUIN, int *Added) { dwUIN; Added; return db_find_first(); }
static __inline HANDLE ICQFindFirstContact(void) { return NULL; }
static __inline HANDLE ICQFindNextContact(MCONTACT hContact) { hContact; return NULL; }
-static __inline void AddToCache(MCONTACT hContact,DWORD dwUin) { hContact; dwUin; }
+static __inline void AddToCache(MCONTACT hContact, DWORD dwUin) { hContact; dwUin; }
static __inline DWORD ICQGetContactSettingUIN(MCONTACT hContact) { hContact; return 0; }
static __inline HANDLE HandleFromCacheByUin(DWORD dwUin) { dwUin; return NULL; }
#include <m_protosvc.h>
#include <m_message.h>
-typedef struct {
- PROTOSEARCHRESULT hdr;
- DWORD uin;
- BYTE auth;
- char* uid;
+typedef struct
+{
+ PROTOSEARCHRESULT hdr;
+ DWORD uin;
+ BYTE auth;
+ char* uid;
} ICQSEARCHRESULT;
#include "m_assocmgr.h"
@@ -224,25 +225,26 @@ static HANDLE hServiceOpenFile; static void TrimString(char *str)
{
- int len,start;
- len=mir_strlen(str);
- while(str[0]!='\0' && (unsigned char)str[len-1]<=' ') str[--len]=0;
- for(start=0;str[start] && (unsigned char)str[start]<=' ';++start);
- memmove(str,str+start,len-start+1);
+ int len, start;
+ len = mir_strlen(str);
+ while (str[0] != '\0' && (unsigned char)str[len - 1] <= ' ') str[--len] = 0;
+ for (start = 0; str[start] && (unsigned char)str[start] <= ' '; ++start);
+ memmove(str, str + start, len - start + 1);
}
static BOOL IsEmpty(const char *str)
{
int i;
- for(i=0;str[i]!='\0';i++)
- if(str[i]!=' ' && str[i]!='\r' && str[i]!='\n')
+ for (i = 0; str[i] != '\0'; i++)
+ if (str[i] != ' ' && str[i] != '\r' && str[i] != '\n')
return FALSE;
return TRUE;
}
#define ICQFILE_MESSAGEUSER 1
#define ICQFILE_ADDUSER 2
-typedef struct {
+typedef struct
+{
int type;
char uin[64];
char email[128];
@@ -255,16 +257,16 @@ static HANDLE IsHContactFromUIN(DWORD uin) {
MCONTACT hContact;
DWORD dwUin;
- hContact=HandleFromCacheByUin(uin);
- if(hContact!=NULL) return hContact;
- hContact=ICQFindFirstContact();
- while(hContact!=NULL) {
- dwUin=ICQGetContactSettingUIN(hContact);
- if(dwUin==uin) {
- AddToCache(hContact,dwUin);
+ hContact = HandleFromCacheByUin(uin);
+ if (hContact != NULL) return hContact;
+ hContact = ICQFindFirstContact();
+ while (hContact != NULL) {
+ dwUin = ICQGetContactSettingUIN(hContact);
+ if (dwUin == uin) {
+ AddToCache(hContact, dwUin);
return hContact;
}
- hContact=ICQFindNextContact(hContact);
+ hContact = ICQFindNextContact(hContact);
}
return NULL;
}
@@ -275,24 +277,24 @@ static void AddIcqUser(ICQFILEINFO *info) ICQSEARCHRESULT psr;
DWORD uin;
/* check that uin does not belong to current user */
- uin=atoi(info->uin);
- if(uin!=0 && uin!=ICQGetContactSettingUIN(NULL)) {
+ uin = atoi(info->uin);
+ if (uin != 0 && uin != ICQGetContactSettingUIN(NULL)) {
/* not yet present? */
- if(IsHContactFromUIN(uin)==NULL) {
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=gpszICQProtoName;
- acs.psr=(PROTOSEARCHRESULT*)&psr;
+ if (IsHContactFromUIN(uin) == NULL) {
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = gpszICQProtoName;
+ acs.psr = (PROTOSEARCHRESULT*)&psr;
memset(&psr, 0, sizeof(ICQSEARCHRESULT));
- psr.hdr.cbSize=sizeof(ICQSEARCHRESULT);
- if(info->nick[0]) psr.hdr.nick=info->nick;
- else psr.hdr.nick=info->uin;
- if(info->email[0]) psr.hdr.email=info->email;
- if(info->firstName[0]) psr.hdr.firstName=info->firstName;
- if(info->lastName[0]) psr.hdr.lastName=info->lastName;
- psr.uin=uin;
- psr.auth=1; /* authentication needed flag */
- psr.uid=NULL; /* icq contact */
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
+ psr.hdr.cbSize = sizeof(ICQSEARCHRESULT);
+ if (info->nick[0]) psr.hdr.nick = info->nick;
+ else psr.hdr.nick = info->uin;
+ if (info->email[0]) psr.hdr.email = info->email;
+ if (info->firstName[0]) psr.hdr.firstName = info->firstName;
+ if (info->lastName[0]) psr.hdr.lastName = info->lastName;
+ psr.uin = uin;
+ psr.auth = 1; /* authentication needed flag */
+ psr.uid = NULL; /* icq contact */
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
}
}
@@ -300,19 +302,19 @@ static void AddIcqUser(ICQFILEINFO *info) static void MessageIcqUser(ICQFILEINFO *info)
{
MCONTACT hContact;
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=HContactFromUIN(atoi(info->uin),NULL); /* adds the contact if needed */
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,0);
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = HContactFromUIN(atoi(info->uin), NULL); /* adds the contact if needed */
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
}
-static int IcqOpenFile(WPARAM wParam,LPARAM lParam)
+static int IcqOpenFile(WPARAM wParam, LPARAM lParam)
{
- TCHAR *pszFile=(TCHAR*)lParam; /* TCHAR is specified on AssocMgr_AddNewFileTypeT() */
+ TCHAR *pszFile = (TCHAR*)lParam; /* TCHAR is specified on AssocMgr_AddNewFileTypeT() */
FILE *fp;
ICQFILEINFO info;
- char line[4096],*sep;
+ char line[4096], *sep;
UNREFERENCED_PARAMETER(wParam);
/*
send message:
@@ -328,64 +330,64 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam) FirstName=
LastName=
*/
- if(pszFile==NULL) return 1; /* sanity check */
- fp=_tfopen(pszFile,_T("rt"));
- if(fp==NULL) return 1; /* open failed */
- info.type=0;
- while(!feof(fp)) {
- if(fgets(line,sizeof(line),fp)==NULL) break;
+ if (pszFile == NULL) return 1; /* sanity check */
+ fp = _tfopen(pszFile, _T("rt"));
+ if (fp == NULL) return 1; /* open failed */
+ info.type = 0;
+ while (!feof(fp)) {
+ if (fgets(line, sizeof(line), fp) == NULL) break;
TrimString(line);
- if(IsEmpty(line)) continue;
- if(line[0]=='[') {
+ if (IsEmpty(line)) continue;
+ if (line[0] == '[') {
memset(&info, 0, sizeof(info));
- if (!mir_strcmpi(line,"[ICQ Message User]"))
- info.type=ICQFILE_MESSAGEUSER;
- else if (!mir_strcmpi(line,"[ICQ User]"))
- info.type=ICQFILE_ADDUSER;
+ if (!mir_strcmpi(line, "[ICQ Message User]"))
+ info.type = ICQFILE_MESSAGEUSER;
+ else if (!mir_strcmpi(line, "[ICQ User]"))
+ info.type = ICQFILE_ADDUSER;
continue;
}
- if(info.type==0) continue;
- sep=strchr(line,'=');
- if(sep==NULL) { info.type=0; break; } /* format error */
- *(sep++)='\0';
- if (!mir_strcmp("UIN",line)) mir_strncpy(info.uin,sep,sizeof(info.uin)); /* buffer safe */
- else if (!mir_strcmp("Email",line)) mir_strncpy(info.email,sep,sizeof(info.email)); /* buffer safe */
- else if (!mir_strcmp("NickName",line)) mir_strncpy(info.nick,sep,sizeof(info.nick)); /* buffer safe */
- else if (!mir_strcmp("FirstName",line)) mir_strncpy(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
- else if (!mir_strcmp("LastName",line)) mir_strncpy(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
+ if (info.type == 0) continue;
+ sep = strchr(line, '=');
+ if (sep == NULL) { info.type = 0; break; } /* format error */
+ *(sep++) = '\0';
+ if (!mir_strcmp("UIN", line)) mir_strncpy(info.uin, sep, sizeof(info.uin)); /* buffer safe */
+ else if (!mir_strcmp("Email", line)) mir_strncpy(info.email, sep, sizeof(info.email)); /* buffer safe */
+ else if (!mir_strcmp("NickName", line)) mir_strncpy(info.nick, sep, sizeof(info.nick)); /* buffer safe */
+ else if (!mir_strcmp("FirstName", line)) mir_strncpy(info.firstName, sep, sizeof(info.firstName)); /* buffer safe */
+ else if (!mir_strcmp("LastName", line)) mir_strncpy(info.lastName, sep, sizeof(info.lastName)); /* buffer safe */
}
fclose(fp);
- switch(info.type) {
- case ICQFILE_MESSAGEUSER: MessageIcqUser(&info); return 0;
- case ICQFILE_ADDUSER: AddIcqUser(&info); return 0;
- default: return 1; /* open failed */
+ switch (info.type) {
+ case ICQFILE_MESSAGEUSER: MessageIcqUser(&info); return 0;
+ case ICQFILE_ADDUSER: AddIcqUser(&info); return 0;
+ default: return 1; /* open failed */
}
}
-static int IcqFilesModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int IcqFilesModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAX_PATH+32];
+ char szService[MAX_PATH + 32];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_strcat(mir_strcpy(szService,gpszICQProtoName),"OpenFile");
+ mir_strcat(mir_strcpy(szService, gpszICQProtoName), "OpenFile");
/* .icq files are not used, just by the ProtoLink plugin */
- //AssocMgr_AddNewFileTypeT(".icq","application/x-icq",TranslateT("ICQ link shortcut"),TranslateT("&Add to contact list..."),hInst,IDI_ICQ,szService,FTDF_BROWSERAUTOOPEN|FTDF_ISTEXT|FTDF_ISSHORTCUT|FTDF_DEFAULTDISABLED);
- AssocMgr_AddNewFileTypeT(".uin","application/x-icq",TranslateT("ICQ link shortcut"),TranslateT("&Add to contact list..."),hInst,IDI_ICQ,szService,FTDF_BROWSERAUTOOPEN|FTDF_ISTEXT|FTDF_ISSHORTCUT);
- return 0;
+ //AssocMgr_AddNewFileTypeT(".icq","application/x-icq",TranslateT("ICQ link shortcut"),TranslateT("&Add to contact list..."),hInst,IDI_ICQ,szService,FTDF_BROWSERAUTOOPEN|FTDF_ISTEXT|FTDF_ISSHORTCUT|FTDF_DEFAULTDISABLED);
+ AssocMgr_AddNewFileTypeT(".uin", "application/x-icq", TranslateT("ICQ link shortcut"), TranslateT("&Add to contact list..."), hInst, IDI_ICQ, szService, FTDF_BROWSERAUTOOPEN | FTDF_ISTEXT | FTDF_ISSHORTCUT);
+ return 0;
}
void InitIcqFiles(void)
{
- char szService[MAX_PATH+32];
- mir_strcat(mir_strcpy(szService,gpszICQProtoName),"OpenFile");
- hServiceOpenFile=CreateServiceFunction(szService,IcqOpenFile);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,IcqFilesModulesLoaded);
+ char szService[MAX_PATH + 32];
+ mir_strcat(mir_strcpy(szService, gpszICQProtoName), "OpenFile");
+ hServiceOpenFile = CreateServiceFunction(szService, IcqOpenFile);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, IcqFilesModulesLoaded);
}
void UninitIcqFiles(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceOpenFile);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceOpenFile);
}
#undef hInst
@@ -399,7 +401,7 @@ void UninitIcqFiles(void) #define IDI_YAHOO 10101
#define hinstance GetModuleHandleA("YAHOO")
static __inline HANDLE getbuddyH(const char *yahoo_id) { yahoo_id; return NULL; }
-static __inline HANDLE add_buddy(const char *yahoo_id,const char *yahoo_name,DWORD flags) { yahoo_id; yahoo_name; flags; return db_find_first(); }
+static __inline HANDLE add_buddy(const char *yahoo_id, const char *yahoo_name, DWORD flags) { yahoo_id; yahoo_name; flags; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -407,95 +409,95 @@ static __inline HANDLE add_buddy(const char *yahoo_id,const char *yahoo_name,DWO static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseYmsgrLink;
-static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam)
+static int ServiceParseYmsgrLink(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /*
- add user: ymsgr:addfriend?ID
- send message: ymsgr:sendim?ID&m=MESSAGE
- add chatroom: ymsgr:chat?ROOM
- */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
- /* add a contact to the list */
- if (!_strnicmp(arg,"addfriend?",10)) {
- char *tok,*id=NULL;
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if (*(arg+=10)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- if(tok!=NULL) id=Netlib_UrlDecode(tok);
- if(id==NULL || *id==0) return 1; /* parse failed */
- if(getbuddyH(id)==NULL) { /* does not yet check if id is current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=yahooProtocolName;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=id;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ if (arg == NULL) return 1; /* sanity check */
+ /*
+ add user: ymsgr:addfriend?ID
+ send message: ymsgr:sendim?ID&m=MESSAGE
+ add chatroom: ymsgr:chat?ROOM
+ */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
+ /* add a contact to the list */
+ if (!_strnicmp(arg, "addfriend?", 10)) {
+ char *tok, *id = NULL;
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (*(arg += 10) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ if (tok != NULL) id = Netlib_UrlDecode(tok);
+ if (id == NULL || *id == 0) return 1; /* parse failed */
+ if (getbuddyH(id) == NULL) { /* does not yet check if id is current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = yahooProtocolName;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = id;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
- /* send a message to a contact */
- else if (!_strnicmp(arg,"sendim?",7)) {
- char *tok,*id=NULL,*msg=NULL;
- MCONTACT hContact;
- if (*(arg+=7)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- if(tok!=NULL) id=tok;
- while(tok!=NULL) {
- if (!_strnicmp(tok,"m=",2) && *(tok+2)!=0)
- msg=Netlib_UrlDecode(tok+2);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(id==NULL || *id==0) return 1; /* parse failed */
- if(ServiceExists(MS_MSG_SENDMESSAGE)) { /* does not yet check if sn is current user */
- hContact=add_buddy(id,id,PALF_TEMPORARY); /* ensure contact is on list */
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,(LPARAM)msg);
+ }
+ /* send a message to a contact */
+ else if (!_strnicmp(arg, "sendim?", 7)) {
+ char *tok, *id = NULL, *msg = NULL;
+ MCONTACT hContact;
+ if (*(arg += 7) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ if (tok != NULL) id = tok;
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "m=", 2) && *(tok + 2) != 0)
+ msg = Netlib_UrlDecode(tok + 2);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (id == NULL || *id == 0) return 1; /* parse failed */
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) { /* does not yet check if sn is current user */
+ hContact = add_buddy(id, id, PALF_TEMPORARY); /* ensure contact is on list */
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)msg);
}
return 0;
}
- /* open a chatroom */
- else if (!_strnicmp(arg,"chat?",5)) {
- char *tok,*rm=NULL;
- if (*(arg+=5)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- if(tok!=NULL) rm=Netlib_UrlDecode(tok);
- if(rm==NULL) return 1; /* parse failed */
- /* not yet implemented (rm contains name of chatroom)*/
+ /* open a chatroom */
+ else if (!_strnicmp(arg, "chat?", 5)) {
+ char *tok, *rm = NULL;
+ if (*(arg += 5) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ if (tok != NULL) rm = Netlib_UrlDecode(tok);
+ if (rm == NULL) return 1; /* parse failed */
+ /* not yet implemented (rm contains name of chatroom)*/
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int YmsgrLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int YmsgrLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
- AssocMgr_AddNewUrlType("ymsgr:",Translate("Yahoo link protocol"),hinstance,IDI_YAHOO,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", yahooProtocolName, "ParseYmsgrLink");
+ AssocMgr_AddNewUrlType("ymsgr:", Translate("Yahoo link protocol"), hinstance, IDI_YAHOO, szService, 0);
+ return 0;
}
void YmsgrLinksInit(void)
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
- hServiceParseYmsgrLink=CreateServiceFunction(szService,ServiceParseYmsgrLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,YmsgrLinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", yahooProtocolName, "ParseYmsgrLink");
+ hServiceParseYmsgrLink = CreateServiceFunction(szService, ServiceParseYmsgrLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, YmsgrLinksModulesLoaded);
}
void YmsgrLinksUninit(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseYmsgrLink);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseYmsgrLink);
}
#undef hinstance
@@ -509,7 +511,7 @@ void YmsgrLinksUninit(void) #define IDI_MSN 101
#define hInst GetModuleHandleA("MSN")
static __inline HANDLE MSN_HContactFromEmailT(const char *msnEmail) { msnEmail; return NULL; }
-static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail,const char *msnNick,int addIfNeeded,int temporary) { msnEmail; msnNick; addIfNeeded; temporary; return db_find_first(); }
+static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail, const char *msnNick, int addIfNeeded, int temporary) { msnEmail; msnNick; addIfNeeded; temporary; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -517,93 +519,93 @@ static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail,const char *ms static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseMsnimLink;
-static int ServiceParseMsnimLink(WPARAM wParam,LPARAM lParam)
+static int ServiceParseMsnimLink(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /*
- add user: msnim:add?contact=netpassport@emailaddress.com
- send message: msnim:chat?contact=netpassport@emailaddress.com
- voice chat: msnim:voice?contact=netpassport@emailaddress.com
- video chat: msnim:video?contact=netpassport@emailaddress.com
- */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
- /* add a contact to the list */
- if (!_strnicmp(arg,"add?",4)) {
- char *tok,*email=NULL;
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if (*(arg+=4)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
- email=Netlib_UrlDecode(tok+11);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(email==NULL || *email==0) return 1; /* parse failed */
- if(MSN_HContactFromEmailT(email)==NULL) { /* does not yet check if email is current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=AIM_PROTOCOL_NAME;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=email;
- psr.email.t=email;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ if (arg == NULL) return 1; /* sanity check */
+ /*
+ add user: msnim:add?contact=netpassport@emailaddress.com
+ send message: msnim:chat?contact=netpassport@emailaddress.com
+ voice chat: msnim:voice?contact=netpassport@emailaddress.com
+ video chat: msnim:video?contact=netpassport@emailaddress.com
+ */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
+ /* add a contact to the list */
+ if (!_strnicmp(arg, "add?", 4)) {
+ char *tok, *email = NULL;
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (*(arg += 4) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "contact=", 8) && *(tok + 11) != 0)
+ email = Netlib_UrlDecode(tok + 11);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (email == NULL || *email == 0) return 1; /* parse failed */
+ if (MSN_HContactFromEmailT(email) == NULL) { /* does not yet check if email is current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = AIM_PROTOCOL_NAME;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = email;
+ psr.email.t = email;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
- /* send a message to a contact */
- /* "voice" and "video" not yet implemented, perform same action as "chat" */
- else if (!_strnicmp(arg,"chat?",5) || !_strnicmp(arg,"voice?",6) || !_strnicmp(arg,"video?",6)) {
- char *tok,*email=NULL;
- MCONTACT hContact;
- if (*(arg+=5)==0) return 1; /* parse failed */
- if (*arg=='?' && *(++arg)==0) return 1; /* for "voice?" and "video?" */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
- email=Netlib_UrlDecode(tok+11);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(email==NULL || *email==0) return 1; /* parse failed */
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=MSN_HContactFromEmail(email,email,TRUE,TRUE); /* does not yet check if email is current user */
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,0);
+ }
+ /* send a message to a contact */
+ /* "voice" and "video" not yet implemented, perform same action as "chat" */
+ else if (!_strnicmp(arg, "chat?", 5) || !_strnicmp(arg, "voice?", 6) || !_strnicmp(arg, "video?", 6)) {
+ char *tok, *email = NULL;
+ MCONTACT hContact;
+ if (*(arg += 5) == 0) return 1; /* parse failed */
+ if (*arg == '?' && *(++arg) == 0) return 1; /* for "voice?" and "video?" */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "contact=", 8) && *(tok + 11) != 0)
+ email = Netlib_UrlDecode(tok + 11);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (email == NULL || *email == 0) return 1; /* parse failed */
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = MSN_HContactFromEmail(email, email, TRUE, TRUE); /* does not yet check if email is current user */
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int MsnLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int MsnLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
- AssocMgr_AddNewUrlType("msnim:",Translate("MSN link protocol"),hInst,IDI_MSN,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", msnProtocolName, "ParseMsnimLink");
+ AssocMgr_AddNewUrlType("msnim:", Translate("MSN link protocol"), hInst, IDI_MSN, szService, 0);
+ return 0;
}
int LoadMsnLinks(void)
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
- hServiceParseMsnimLink=CreateServiceFunction(szService,ServiceParseMsnimLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,MsnLinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", msnProtocolName, "ParseMsnimLink");
+ hServiceParseMsnimLink = CreateServiceFunction(szService, ServiceParseMsnimLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, MsnLinksModulesLoaded);
return 0;
}
void UnloadMsnLinks(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseMsnimLink);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseMsnimLink);
}
#undef hInst
@@ -617,7 +619,7 @@ void UnloadMsnLinks(void) #define IDI_GG 251
#define hInstance GetModuleHandleA("GG")
typedef DWORD uin_t;
-static __inline HANDLE gg_getcontact(uin_t uin,int create,int inlist,char *szNick) { uin; create; inlist; szNick; return db_find_first(); }
+static __inline HANDLE gg_getcontact(uin_t uin, int create, int inlist, char *szNick) { uin; create; inlist; szNick; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -625,49 +627,49 @@ static __inline HANDLE gg_getcontact(uin_t uin,int create,int inlist,char *szNic static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseLink;
-static int ServiceParseLink(WPARAM wParam,LPARAM lParam)
+static int ServiceParseLink(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /* send message: gg:UID */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
- /* send a message to a contact */
+ if (arg == NULL) return 1; /* sanity check */
+ /* send message: gg:UID */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
+ /* send a message to a contact */
{ MCONTACT hContact;
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=gg_getcontact(atoi(arg),TRUE,FALSE,arg);
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,0);
- }
- }
- return 0;
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = gg_getcontact(atoi(arg), TRUE, FALSE, arg);
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
+ }
+ }
+ return 0;
}
-static int LinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int LinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",GG_PROTO,"ParseMsnimLink");
- AssocMgr_AddNewUrlType("gg:",Translate("Gadu-Gadu link protocol"),hInstance,IDI_GG,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", GG_PROTO, "ParseMsnimLink");
+ AssocMgr_AddNewUrlType("gg:", Translate("Gadu-Gadu link protocol"), hInstance, IDI_GG, szService, 0);
+ return 0;
}
void gg_registerlinks(void)
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",GG_PROTO,"ParseLink");
- hServiceParseLink=CreateServiceFunction(szService,ServiceParseLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,LinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", GG_PROTO, "ParseLink");
+ hServiceParseLink = CreateServiceFunction(szService, ServiceParseLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, LinksModulesLoaded);
}
void gg_unregisterlinks(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseLink);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseLink);
}
#undef hInstance
@@ -681,7 +683,7 @@ void gg_unregisterlinks(void) #define IDI_JABBER 102
#define hInst GetModuleHandleA("JABBER")
static __inline HANDLE JabberHContactFromJID(const char *jid) { jid; return NULL; }
-static __inline HANDLE JabberDBCreateContact(char *jid,char *nick,BOOL temporary,BOOL stripResource) { jid; nick; temporary; stripResource; return db_find_first(); }
+static __inline HANDLE JabberDBCreateContact(char *jid, char *nick, BOOL temporary, BOOL stripResource) { jid; nick; temporary; stripResource; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -689,16 +691,16 @@ static __inline HANDLE JabberDBCreateContact(char *jid,char *nick,BOOL temporary static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseXmppURI;
-static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
+static int ServiceParseXmppURI(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
char *jid;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
+ if (arg == NULL) return 1; /* sanity check */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
/*
complete specification: http://www.xmpp.org/extensions/xep-0147.html
send message: xmpp:JID?message;subject=TEXT&body=TEXT
@@ -706,95 +708,96 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam) remove user: xmpp:JID?remove
*/
/* user id */
- arg=strchr(jid=arg,'?');
- if(arg==NULL) arg+=mir_strlen(arg); /* points to terminating nul */
- else *(arg++)=0;
- if (*jid==0) return 1; /* parse failed */
- /* send a message to a contact */
- else if (*arg==0 || (!_strnicmp(arg,"message",7) && (*(arg+7)==';' || *(arg+7)==0))) {
- char *tok,*subj=NULL,*body=NULL;
- MCONTACT hContact;
+ arg = strchr(jid = arg, '?');
+ if (arg == NULL) arg += mir_strlen(arg); /* points to terminating nul */
+ else *(arg++) = 0;
+ if (*jid == 0) return 1; /* parse failed */
+ /* send a message to a contact */
+ else if (*arg == 0 || (!_strnicmp(arg, "message", 7) && (*(arg + 7) == ';' || *(arg + 7) == 0))) {
+ char *tok, *subj = NULL, *body = NULL;
+ MCONTACT hContact;
char msg[1024];
- arg+=7;
- while(*arg==';') ++arg;
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"subject=",8) && *(tok+8)!=0)
- subj=Netlib_UrlDecode(tok+8);
- if (!_strnicmp(tok,"body=",5) && *(tok+5)!=0)
- body=Netlib_UrlDecode(tok+5);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=JabberDBCreateContact(jid,jid,TRUE,FALSE);
- if(subj!=NULL && body!=NULL) {
- mir_snprintf(msg,_countof(msg),"%.128s %s",subj,body);
- body=msg;
- } else if(body==NULL) body=subj;
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,(LPARAM)body);
+ arg += 7;
+ while (*arg == ';') ++arg;
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "subject=", 8) && *(tok + 8) != 0)
+ subj = Netlib_UrlDecode(tok + 8);
+ if (!_strnicmp(tok, "body=", 5) && *(tok + 5) != 0)
+ body = Netlib_UrlDecode(tok + 5);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = JabberDBCreateContact(jid, jid, TRUE, FALSE);
+ if (subj != NULL && body != NULL) {
+ mir_snprintf(msg, _countof(msg), "%.128s %s", subj, body);
+ body = msg;
+ }
+ else if (body == NULL) body = subj;
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)body);
}
return 0;
- }
- /* add user to contact list */
- else if (!_strnicmp(arg,"roster",6) && (*(arg+6)==';' || *(arg+6)==0)) {
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if(JabberHContactFromJID(jid)==NULL) { /* does not yet check if jid belongs to current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=jabberProtoName;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=jid;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ }
+ /* add user to contact list */
+ else if (!_strnicmp(arg, "roster", 6) && (*(arg + 6) == ';' || *(arg + 6) == 0)) {
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (JabberHContactFromJID(jid) == NULL) { /* does not yet check if jid belongs to current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = jabberProtoName;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = jid;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
+ }
/* remove user from contact list */
- else if (!_strnicmp(arg,"remove",6) && (*(arg+6)==';' || *(arg+6)==0)) {
+ else if (!_strnicmp(arg, "remove", 6) && (*(arg + 6) == ';' || *(arg + 6) == 0)) {
MCONTACT hContact;
- hContact=JabberHContactFromJID(jid);
- if(hContact==NULL) /* not yet implemented: show standard miranda dialog here */
- CallService(MS_DB_CONTACT_DELETE,hContact,0);
+ hContact = JabberHContactFromJID(jid);
+ if (hContact == NULL) /* not yet implemented: show standard miranda dialog here */
+ CallService(MS_DB_CONTACT_DELETE, hContact, 0);
return 0;
- }
- /* add user subscription */
- else if (!_strnicmp(arg,"subscribe",9) && (*(arg+9)==';' || *(arg+9)==0)) {
+ }
+ /* add user subscription */
+ else if (!_strnicmp(arg, "subscribe", 9) && (*(arg + 9) == ';' || *(arg + 9) == 0)) {
/* not yet implemented */
return 0;
- }
+ }
/* remove user subscription */
- else if (!_strnicmp(arg,"unsubscribe",11) && (*(arg+11)==';' || *(arg+11)==0)) {
+ else if (!_strnicmp(arg, "unsubscribe", 11) && (*(arg + 11) == ';' || *(arg + 11) == 0)) {
/* not yet implemented */
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int JabberLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int JabberLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",jabberProtoName,"ParseXmppURI");
- AssocMgr_AddNewUrlType("xmpp:",Translate("Jabber link protocol"),hInst,IDI_JABBER,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", jabberProtoName, "ParseXmppURI");
+ AssocMgr_AddNewUrlType("xmpp:", Translate("Jabber link protocol"), hInst, IDI_JABBER, szService, 0);
+ return 0;
}
int JabberLinksInit()
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",jabberProtoName,"ParseXmppURI");
- hServiceParseXmppURI=CreateServiceFunction(szService,ServiceParseXmppURI);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,JabberLinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", jabberProtoName, "ParseXmppURI");
+ hServiceParseXmppURI = CreateServiceFunction(szService, ServiceParseXmppURI);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, JabberLinksModulesLoaded);
return 0;
}
int JabberLinksUninit()
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseXmppURI);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseXmppURI);
return 0;
}
@@ -806,7 +809,7 @@ int JabberLinksUninit() void InitTest(void)
{
#ifdef AIM_SUPPORT_TEST
- conn.hInstance=GetModuleHandleA("AIM");
+ conn.hInstance = GetModuleHandleA("AIM");
aim_links_init();
#endif
#ifdef ICQ_SUPPORT_TEST
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 5c00f93395..1b275e1ffe 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -468,7 +468,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
- mir_sntprintf(ttdi->szText, _countof(ttdi->szText), _T("%s %s"), (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
+ mir_sntprintf(ttdi->szText, _T("%s %s"), (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
ttdi->lpszText = ttdi->szText;
}
return 0;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index f947eedfcd..17c30d59f6 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -48,7 +48,7 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam) return FALSE; /* stop poll thread */
TCHAR str[64];
- mir_sntprintf(str, _countof(str), TranslateT("(current: %u%%)"), nCpuUsage);
+ mir_sntprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
SetWindowText((HWND)lParam, str);
return TRUE;
}
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 68f398d0f5..6f35543e29 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -384,7 +384,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
TCHAR szText[256];
- mir_sntprintf(szText, _countof(szText), TranslateTS(desc[shutdownType - 1]), lParam);
+ mir_sntprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
if (!lParam)
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index a748ae039a..0747bf7041 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -136,7 +136,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l TCHAR *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
if (displayName) {
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), TranslateT("Avatar History for %s"), displayName);
+ mir_sntprintf(title, TranslateT("Avatar History for %s"), displayName);
SetWindowText(hwnd, title);
}
@@ -374,7 +374,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
- mir_sntprintf(path, _countof(path), _T("%s\\*.*"), dir);
+ mir_sntprintf(path, _T("%s\\*.*"), dir);
HANDLE hFind = FindFirstFile(path, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
@@ -384,7 +384,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) {
if (finddata.cFileName[0] != '.')
{
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), dir, finddata.cFileName);
+ mir_sntprintf(path, _T("%s\\%s"), dir, finddata.cFileName);
max_pos = AddFileToList(path,finddata.cFileName,finddata.cFileName,list);
}
}
@@ -401,7 +401,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
- mir_sntprintf(path, _countof(path), _T("%s\\*.lnk"), dir);
+ mir_sntprintf(path, _T("%s\\*.lnk"), dir);
HANDLE hFind = FindFirstFile(path, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
@@ -412,7 +412,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) if (finddata.cFileName[0] != '.')
{
TCHAR lnk[MAX_PATH];
- mir_sntprintf(lnk, _countof(lnk), _T("%s\\%s"), dir, finddata.cFileName);
+ mir_sntprintf(lnk, _T("%s\\%s"), dir, finddata.cFileName);
if (ResolveShortcut(lnk, path))
max_pos = AddFileToList(path,lnk,finddata.cFileName,list);
}
@@ -549,7 +549,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) TCHAR title[MAX_PATH];
if (displayName)
{
- mir_sntprintf(title, _countof(title), TranslateT("Save Avatar for %s"), displayName);
+ mir_sntprintf(title, TranslateT("Save Avatar for %s"), displayName);
ofn.lpstrTitle = title;
}
else
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index bbf9da67b1..e12e54d4f2 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -187,7 +187,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) else
GetProtocolFolder(history_filename, proto);
- mir_sntprintf(history_filename, _countof(history_filename),
+ mir_sntprintf(history_filename,
_T("%s\\%s"), history_filename, hash);
if (CopyImageFile(avatar->filename, history_filename))
@@ -236,7 +236,7 @@ static int PreShutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM)
{
- mir_sntprintf(basedir, _countof(basedir), _T("%s\\Avatars History"), profilePath);
+ mir_sntprintf(basedir, _T("%s\\Avatars History"), profilePath);
hFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatar History"),
PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\Avatars History"));
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 9344544a1e..637458b60d 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -151,7 +151,7 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) #ifdef DBGPOPUPS
TCHAR log[1024];
- mir_sntprintf(log, _countof(log), _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin);
+ mir_sntprintf(log, _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin);
ShowPopup(hContact, _T("AVH Debug: GetContactFolder"), log);
#endif
@@ -178,7 +178,7 @@ void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) GetOldStyleAvatarName(shortcut, hContact);
- mir_sntprintf(shortcut, _countof(shortcut), _T("%s.%s.lnk"), shortcut,
+ mir_sntprintf(shortcut, _T("%s.%s.lnk"), shortcut,
GetExtension(history_filename));
if (!CreateShortcut(history_filename, shortcut))
@@ -208,7 +208,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) else
GetProtocolFolder(file, proto);
- mir_sntprintf(search, _countof(search), _T("%s\\%s.*"), file, hash);
+ mir_sntprintf(search, _T("%s\\%s.*"), file, hash);
WIN32_FIND_DATA finddata;
HANDLE hFind = FindFirstFile(search, &finddata);
@@ -225,7 +225,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) || !mir_tstrcmpi(&finddata.cFileName[len-4], _T(".jpg"))
|| !mir_tstrcmpi(&finddata.cFileName[len-5], _T(".jpeg"))))
{
- mir_sntprintf(file, _countof(file), _T("%s\\%s"), file, finddata.cFileName);
+ mir_sntprintf(file, _T("%s\\%s"), file, finddata.cFileName);
ret = mir_tstrdup(file);
break;
}
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 4fcefa4b21..c27974f8b5 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -185,7 +185,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
else {
DWORD bassver = BASS_GetVersion();
- mir_sntprintf(tmp, _countof(tmp), TranslateT("un4seen's bass version: %d.%d.%d.%d"), bassver >> 24, (bassver >> 16) & 0xff, (bassver >> 8) & 0xff, bassver & 0xff);
+ mir_sntprintf(tmp, TranslateT("un4seen's bass version: %d.%d.%d.%d"), bassver >> 24, (bassver >> 16) & 0xff, (bassver >> 8) & 0xff, bassver & 0xff);
SetDlgItemText(hwndDlg, IDC_BASSVERSION, tmp);
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_RESETCONTENT, 0, 0);
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 8dd5516bcc..96caf57292 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -346,11 +346,11 @@ void HistoryEventList::InitNames() TCHAR str[200];
if (m_hContact) {
_tcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
- mir_sntprintf(str, _countof(str), TranslateT("History for %s"), m_contactName);
+ mir_sntprintf(str, TranslateT("History for %s"), m_contactName);
}
else {
_tcscpy_s(m_contactName, TranslateT("System"));
- mir_sntprintf(str, _countof(str), TranslateT("History"));
+ mir_sntprintf(str, TranslateT("History"));
}
if (m_isWnd)
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index 8c05d7bc67..35aa7045e6 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -41,7 +41,7 @@ std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open) _tcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
- mir_sntprintf(filter, _countof(filter), TranslateT("%s Files (*.%s)"), extUpper, ext);
+ mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, _T("*.%s"), ext);
len += mir_tstrlen(filter + len);
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 247f7cdd5b..a1ad2df7d8 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1949,7 +1949,7 @@ void HistoryWindow::Delete(int what) return;
TCHAR message[256];
- mir_sntprintf(message, _countof(message), TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
+ mir_sntprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
if (MessageBox(m_hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 523cc4bce1..8a795f769e 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -805,7 +805,7 @@ bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const TCHAR* defName, const TCHAR* TCHAR extUpper[32];
_tcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
- mir_sntprintf(filter, _countof(filter), TranslateT("%s Files (*.%s)"), extUpper, ext);
+ mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, _T("*.%s"), ext);
len += mir_tstrlen(filter + len) + 1;
@@ -1701,7 +1701,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, TCHAR sep = _T(':');
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, timeFormat, 10) > 0)
sep = timeFormat[0];
- mir_sntprintf(timeFormat, _countof(timeFormat), _T("HH%cmm"), sep);
+ mir_sntprintf(timeFormat, _T("HH%cmm"), sep);
}
SYSTEMTIME st;
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index cd4129a5f5..1dc8a3b79f 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -236,9 +236,9 @@ bool DoTask(TaskOptions& to) if (err.empty())
_tcscpy_s(msg, TranslateT("Some value is invalid"));
else if (errDescr.empty())
- mir_sntprintf(msg, _countof(msg), TranslateT("Invalid '%s' value."), err.c_str());
+ mir_sntprintf(msg, TranslateT("Invalid '%s' value."), err.c_str());
else
- mir_sntprintf(msg, _countof(msg), TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
+ mir_sntprintf(msg, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
DoError(to, msg);
return true;
@@ -395,7 +395,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n";
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
+ mir_sntprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
errorStr += msg;
}
else {
@@ -404,7 +404,7 @@ bool DoTask(TaskOptions& to) TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
+ mir_sntprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
errorStr += msg;
}
}
@@ -460,7 +460,7 @@ bool DoTask(TaskOptions& to) TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
+ mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
}
@@ -481,7 +481,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n";
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
+ mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
break;
}
@@ -586,7 +586,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName, TCHAR time[256];
SYSTEMTIME st;
GetLocalTime(&st);
- mir_sntprintf(time, _countof(time), _T("%d-%02d-%02d %02d%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
+ mir_sntprintf(time, _T("%d-%02d-%02d %02d%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
std::wstring str1 = str.substr(0, pos);
str1 += time;
str1 += str.substr(pos + 6);
@@ -1129,7 +1129,7 @@ bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std:: DeleteFile(log.c_str());
TCHAR cmdLine[MAX_PATH];
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
+ mir_sntprintf(cmdLine, _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
startupInfo.cb = sizeof(STARTUPINFO);
@@ -1220,7 +1220,7 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
TCHAR cmdLine[MAX_PATH];
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
+ mir_sntprintf(cmdLine, _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
PROCESS_INFORMATION processInfo;
startupInfo.cb = sizeof(STARTUPINFO);
@@ -1283,7 +1283,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM) void DoError(const TaskOptions& to, const std::wstring _error)
{
TCHAR msg[256];
- mir_sntprintf(msg, _countof(msg), TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
+ mir_sntprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
if (Options::instance->schedulerHistoryAlerts) {
std::wstring error = msg;
error += L"\n";
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 154885f92f..39d094ba1e 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -111,7 +111,7 @@ static bool LoadMind(const TCHAR* filename, int &line) #ifdef DEBUG_LOAD_TIME
t = __rdtsc() - t;
char dest[101];
- mir_snprintf(dest, _countof(dest), "%I64d ticks\n", t / 3200000);
+ mir_snprintf(dest, "%I64d ticks\n", t / 3200000);
MessageBoxA(NULL, dest, NULL, 0);
//exit(0);
#endif
@@ -407,7 +407,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP bTranslated = blInit = LoadMind(c, line);
if (!bTranslated) {
TCHAR message[5000];
- mir_sntprintf(message, _countof(message), TranslateTS(FAILED_TO_LOAD_BASE), line, c);
+ mir_sntprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
}
@@ -571,7 +571,7 @@ extern "C" int __declspec(dllexport) Load(void) blInit = LoadMind(Config.MindFileName, line);
if (!blInit) {
TCHAR path[2000];
- mir_sntprintf(path, _countof(path), TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
+ mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
@@ -589,7 +589,7 @@ extern "C" int __declspec(dllexport) Unload(void) //So in case of saving error we will remain silent
#if 0
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
+ mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
TCHAR* err = TranslateTS(BOLTUN_ERROR);
MessageBox(NULL, path, err, MB_ICONERROR | MB_TASKMODAL | MB_OK); */
#endif
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index ff4a7676a5..6ef497ee08 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -231,11 +231,8 @@ bool isContactGoneFor(MCONTACT hContact, int days) ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), TranslateT("Hiding %s (%S)"),
- pcli->pfnGetContactDisplayName(hContact, 0),
- GetContactProto(hContact));
-
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d days since last message"), daysSinceMessage);
+ mir_sntprintf(ppd.lptzContactName, TranslateT("Hiding %s (%S)"), pcli->pfnGetContactDisplayName(hContact, 0), GetContactProto(hContact));
+ mir_sntprintf(ppd.lptzText, TranslateT("%d days since last message"), daysSinceMessage);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
@@ -289,7 +286,7 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR tmpMsg[512];
- mir_sntprintf(tmpMsg, _countof(tmpMsg), _T("%s %s"), nick, message);
+ mir_sntprintf(tmpMsg, _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
@@ -327,7 +324,7 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR tmpMsg[512];
- mir_sntprintf(tmpMsg, _countof(tmpMsg), _T("%s %s"), nick, message);
+ mir_sntprintf(tmpMsg, _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 27337be821..49fb08103f 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -327,7 +327,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchIcon = hIcon;
_tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
TCHAR szPreviewText[250];
- mir_sntprintf(szPreviewText, _countof(szPreviewText), TranslateT("has returned after being absent since %d days"), rand() % 30);
+ mir_sntprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
_tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 4d579257db..14230d91cb 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -16,7 +16,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB) char *szProto = GetContactProto(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
TCHAR name[300];
- mir_sntprintf(name, _countof(name), _T("%s (%s)"), pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
+ mir_sntprintf(name, _T("%s (%s)"), pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
int index = SendMessage(hwnd2CB, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwnd2CB, CB_SETITEMDATA, index, hContact);
if (BPhContact == hContact)
@@ -201,7 +201,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
getDefaultMessage(hwnd, IDC_MESSAGE, hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
return FALSE;
@@ -210,7 +210,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), length);
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
}
break;
@@ -258,7 +258,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
@@ -272,7 +272,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), length);
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
}
break;
@@ -315,7 +315,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_DEFAULT:
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
db_set_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG",0));
@@ -390,7 +390,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0));
@@ -433,7 +433,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), length);
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
@@ -524,7 +524,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_TIMER:
{
TCHAR message[1024];
- mir_sntprintf(message, _countof(message), TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
+ mir_sntprintf(message, TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
SetDlgItemText(hwnd, LBL_CONTACT, message);
}
spdps->timer--;
@@ -601,12 +601,12 @@ void CreateMessageAcknowlegedWindow(MCONTACT hContact, int SentSuccess) HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, PounceSentDlgProc, hContact);
TCHAR msg[256];
if (SentSuccess) {
- mir_sntprintf(msg, _countof(msg), TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(msg, TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("OK"));
ShowWindow(GetDlgItem(hwnd, IDCANCEL), 0);
}
else {
- mir_sntprintf(msg, _countof(msg), TranslateT("Message failed to send to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(msg, TranslateT("Message failed to send to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("Retry"));
}
SetDlgItemText(hwnd, LBL_CONTACT, msg);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index aabf619a4b..6063ce4306 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -134,7 +134,7 @@ extern "C" __declspec(dllexport) int Load() for (int i = 0; i < _countof(forms); i++) { char szSettingName[64]; - mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODNAME, forms[i].pszIconIcoLib); + mir_snprintf(szSettingName, "%s_%s", MODNAME, forms[i].pszIconIcoLib); sid.pszName = szSettingName; sid.description.t = forms[i].ptszDescr; @@ -260,14 +260,14 @@ void importCustomStatuses(CSWindow* csw, int result) StatusItem* si = new StatusItem(); si->m_iIcon = i - 1; - mir_snprintf(bufTitle, _countof(bufTitle), "XStatus%dName", i); + mir_snprintf(bufTitle, "XStatus%dName", i); if (!db_get_ts(NULL, protoName, bufTitle, &dbv)) { mir_tstrcpy(si->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else si->m_tszTitle[0] = 0; - mir_snprintf(bufMessage, _countof(bufMessage), "XStatus%dMsg", i); + mir_snprintf(bufMessage, "XStatus%dMsg", i); if (!db_get_ts(NULL, protoName, bufMessage, &dbv)) { mir_tstrcpy(si->m_tszMessage, dbv.ptszVal); db_free(&dbv); @@ -538,7 +538,7 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item) EDITBALLOONTIP ebt = { 0 }; ebt.cbStruct = sizeof(ebt); ebt.pszTitle = TranslateT("Warning"); - mir_sntprintf(tszPopupTip, _countof(tszPopupTip), TranslateT("This field doesn't accept string longer than %d characters. The string will be truncated."), limit); + mir_sntprintf(tszPopupTip, TranslateT("This field doesn't accept string longer than %d characters. The string will be truncated."), limit); ebt.pszText = tszPopupTip; ebt.ttiIcon = TTI_WARNING; SendDlgItemMessage(m_handle, item, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt); @@ -737,30 +737,30 @@ int CSItemsList::compareItems(const StatusItem* p1, const StatusItem* p2) void CSItemsList::loadItems(char *protoName) { char dbSetting[32]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_ItemsCount", protoName); + mir_snprintf(dbSetting, "%s_ItemsCount", protoName); unsigned int itemsCount = getWord(dbSetting, DEFAULT_ITEMS_COUNT); for (unsigned int i = 1; i <= itemsCount; i++) { StatusItem* item = new StatusItem(); DBVARIANT dbv; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dIcon", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); item->m_iIcon = getByte(dbSetting, DEFAULT_ITEM_ICON); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dTitle", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); if (!getTString(dbSetting, &dbv)) { mir_tstrcpy(item->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else item->m_tszTitle[0] = 0; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dMessage", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); if (!getTString(dbSetting, &dbv)) { mir_tstrcpy(item->m_tszMessage, dbv.ptszVal); db_free(&dbv); } else item->m_tszMessage[0] = 0; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dFavourite", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); item->m_bFavourite = (BOOL)getByte(dbSetting, DEFAULT_ITEM_IS_FAVOURITE); m_list->add(item); @@ -772,34 +772,34 @@ void CSItemsList::saveItems(char *protoName) { unsigned int i; char dbSetting[32]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_ItemsCount", protoName); + mir_snprintf(dbSetting, "%s_ItemsCount", protoName); unsigned int oldItemsCount = getWord(dbSetting, DEFAULT_ITEMS_COUNT); for (i = 1; i <= m_list->getCount(); i++) { StatusItem* item = m_list->get(i - 1); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dIcon", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); setByte(dbSetting, item->m_iIcon); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dTitle", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); setTString(dbSetting, item->m_tszTitle); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dMessage", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); setTString(dbSetting, item->m_tszMessage); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dFavourite", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); setByte(dbSetting, item->m_bFavourite); } - mir_snprintf(dbSetting, _countof(dbSetting), "%s_ItemsCount", protoName); + mir_snprintf(dbSetting, "%s_ItemsCount", protoName); setWord(dbSetting, m_list->getCount()); for (; i <= oldItemsCount; i++) { - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dIcon", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); deleteSetting(dbSetting); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dTitle", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); deleteSetting(dbSetting); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dMessage", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); deleteSetting(dbSetting); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dFavourite", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); deleteSetting(dbSetting); } } diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index e75ea0b1d3..5c31dc61e6 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -462,7 +462,7 @@ TCHAR* GetProtoName(struct ClcContact *item) if (acc == NULL) {
#ifdef UNICODE
CallProtoService(item->proto, PS_GETNAME, sizeof(description), (LPARAM)description);
- mir_sntprintf(proto_name, _countof(proto_name), L"%S", description);
+ mir_sntprintf(proto_name, L"%S", description);
#else
CallProtoService(item->proto, PS_GETNAME, sizeof(proto_name), (LPARAM)proto_name);
#endif
@@ -537,7 +537,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) };
if (szCounts[0] != '\0')
- mir_sntprintf(count, _countof(count), _T("%s "), szCounts);
+ mir_sntprintf(count, _T("%s "), szCounts);
else
count[0] = _T('\0');
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index db0fceeede..891ab77fd4 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -668,7 +668,7 @@ static int LocateStorePosition(int Frameid, int maxstored) char settingname[255];
for (int i = 0; i < maxstored; i++) {
- mir_snprintf(settingname, _countof(settingname), "Name%d", i);
+ mir_snprintf(settingname, "Name%d", i);
DBVARIANT dbv = { 0 };
if (db_get_ts(NULL, CLUIFrameModule, settingname, &dbv))
continue;
@@ -2746,7 +2746,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (pos != -1) {
int oldflags;
- mir_sntprintf(TBcapt, _countof(TBcapt), _T("%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d"),
+ mir_sntprintf(TBcapt, _T("%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d"),
g_pfwFrames[pos].name, g_pfwFrames[pos].height, g_pfwFrames[pos].visible, g_pfwFrames[pos].floating,
g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y,
g_pfwFrames[pos].FloatingSize.x, g_pfwFrames[pos].FloatingSize.y,
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 280a33acbd..12d6a29765 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -525,9 +525,8 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) // 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, _countof(contact->szText), _T("%s - %s"), name, nick); + else // Append then + mir_sntprintf(contact->szText, _T("%s - %s"), name, nick); } else mir_tstrncpy(contact->szText, name, _countof(contact->szText)); } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index a465b90bd1..5a1fd0361e 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1129,7 +1129,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (mir_strcmp(contSour->proto, META_PROTO)) { if (!contSour->isSubcontact) { MCONTACT hDest = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText); int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { MCONTACT handle = CallService(MS_MC_CONVERTTOMETA, hDest, 0); @@ -1142,7 +1142,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else { hcontact = contSour->hContact; MCONTACT hdest = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { MCONTACT handle = (MCONTACT)CallService(MS_MC_CONVERTTOMETA, (WPARAM)hdest, 0); @@ -1168,7 +1168,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!contSour->isSubcontact) { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText); int res = MessageBox(hwnd, Wording, TranslateT("Adding contact to metacontact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1178,7 +1178,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, } else if (contSour->subcontacts == contDest) { MCONTACT hsour = contSour->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be default?"), contSour->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be default?"), contSour->szText); int res = MessageBox(hwnd, Wording, TranslateT("Set default contact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) db_mc_setDefault(contDest->hContact, hsour, true); @@ -1186,7 +1186,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText); int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1210,7 +1210,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!contSour->isSubcontact) { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->subcontacts->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1222,7 +1222,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else if (contSour->subcontacts != contDest->subcontacts) { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->subcontacts->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->subcontacts->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1260,7 +1260,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (shortGroup) { NeedRename = TRUE; if (sourceGrName) - mir_sntprintf(newName, _countof(newName), _T("%s\\%s"), sourceGrName, shortGroup); + mir_sntprintf(newName, _T("%s\\%s"), sourceGrName, shortGroup); else mir_tstrncpy(newName, shortGroup, _countof(newName)); } diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index c4102c68a5..e57e8d6a89 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -248,7 +248,7 @@ void* AddTempGroup(HWND hwnd, ClcData *dat, const TCHAR *szName) _itoa_s(i - 1, buf, 10); TCHAR b2[255]; - mir_sntprintf(b2, _countof(b2), _T("#%s"), szName); + mir_sntprintf(b2, _T("#%s"), szName); b2[0] = 1 | GROUPF_EXPANDED; db_set_ws(NULL, "CListGroups", buf, b2); pcli->pfnGetGroupName(i, &groupFlags); @@ -718,7 +718,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc } if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) { if (!db_get_ts(hContact, "CList", "Group", &dbv)) { - mir_sntprintf(szGroupMask, _countof(szGroupMask), _T("%s|"), &dbv.ptszVal[0]); + mir_sntprintf(szGroupMask, _T("%s|"), &dbv.ptszVal[0]); filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)); mir_free(dbv.ptszVal); } diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 0229e36828..bad0577a45 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -1015,7 +1015,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP SendDlgItemMessage(hwndDlg, IDC_TITLETEXT, CB_ADDSTRING, 0, (LPARAM)MIRANDANAME);
char szUin[20];
- mir_snprintf(szUin, _countof(szUin), "%u", db_get_dw(NULL, "ICQ", "UIN", 0));
+ mir_snprintf(szUin, "%u", db_get_dw(NULL, "ICQ", "UIN", 0));
SendDlgItemMessage(hwndDlg, IDC_TITLETEXT, CB_ADDSTRING, 0, (LPARAM)szUin);
if (!db_get_s(NULL, "ICQ", "Nick", &dbv)) {
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 019e95db1a..c3b0efde3f 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -896,7 +896,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) if (szAccoName) {
// first of all try to find by account name( or empty - global )
- mir_sntprintf(fileFull, _countof(fileFull), _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, szAccoName);
+ mir_sntprintf(fileFull, _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, szAccoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
@@ -904,7 +904,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) // second try to find by protocol name
PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
- mir_sntprintf(fileFull, _countof(fileFull), _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, acc->szProtoName);
+ mir_sntprintf(fileFull, _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, acc->szProtoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
}
@@ -912,7 +912,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) }
// third try global
- mir_sntprintf(fileFull, _countof(fileFull), _T("%s\\Icons\\proto_conn.dll"), tszFolderPath);
+ mir_sntprintf(fileFull, _T("%s\\Icons\\proto_conn.dll"), tszFolderPath);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
@@ -938,7 +938,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) HICON hIcon;
if (szAccoName) {
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("proto_conn_%S.dll"), szAccoName);
+ mir_sntprintf(szFullPath, _T("proto_conn_%S.dll"), szAccoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
@@ -946,7 +946,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) // second try to find by protocol name
PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("proto_conn_%S.dll"), acc->szProtoName);
+ mir_sntprintf(szFullPath, _T("proto_conn_%S.dll"), acc->szProtoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
}
@@ -1582,7 +1582,7 @@ LRESULT CLUI::PreProcessWndProc(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bH if (msg == uMsgGetProfile && wParam != 0) { // got IPC message
int rc = 0;
char szName[MAX_PATH];
- mir_snprintf(szName, _countof(szName), "Miranda::%u", wParam); // caller will tell us the ID of the map
+ mir_snprintf(szName, "Miranda::%u", wParam); // caller will tell us the ID of the map
HANDLE hMap = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, szName);
if (hMap != NULL) {
void *hView = NULL;
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 2078d05f6f..13fd8e2bcd 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -1480,7 +1480,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m TCHAR b2[MAX_PATH]; if (file[0] != '\\' && file[1] != ':') - mir_sntprintf(b2, _countof(b2), _T("%s\\%s"), (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : _T(""), file); + mir_sntprintf(b2, _T("%s\\%s"), (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : _T(""), file); else mir_tstrncpy(b2, file, _countof(b2)); @@ -2980,13 +2980,13 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) BitBlt(g_pCachedWindow->hImageDC, rLine.left, rLine.top, rLine.right - rLine.left, rLine.bottom - rLine.top, g_pCachedWindow->hBackDC, rLine.left, rLine.top, SRCCOPY); char req[255]; - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar,Frame=%S,Part=Back", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar,Frame=%S,Part=Back", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rLine, &rLine, req); - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar,Frame=%S,Part=Thumb", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar,Frame=%S,Part=Thumb", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rThumb, &rThumb, req); - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar, Frame=%S,Part=UpLineButton", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar, Frame=%S,Part=UpLineButton", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rUpBtn, &rUpBtn, req); - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar,Frame=%S,Part=DownLineButton", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar,Frame=%S,Part=DownLineButton", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rDnBtn, &rDnBtn, req); } @@ -3301,9 +3301,9 @@ static DWORD ske_HexToARGB(char * Hex) char buf2[11] = { 0 }; mir_snprintf(buf, "%s\n", Hex); if (buf[1] == 'x' || buf[1] == 'X') - mir_snprintf(buf2, _countof(buf2), "0x%s\n", buf + 2); + mir_snprintf(buf2, "0x%s\n", buf + 2); else - mir_snprintf(buf2, _countof(buf2), "0x%s\n", buf); + mir_snprintf(buf2, "0x%s\n", buf); buf2[10] = '\0'; char *st; diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 4e95804f4e..df52146c38 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -252,7 +252,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, _countof(imfn), sd->File); IniParser::GetSkinFolder(sd->File, skinfolder); - mir_sntprintf(prfn, _countof(prfn), _T("%s\\%s"), skinfolder, imfn); + mir_sntprintf(prfn, _T("%s\\%s"), skinfolder, imfn); PathToAbsoluteT(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); @@ -332,7 +332,7 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder) struct _tfinddata_t fd = { 0 }; TCHAR mask[MAX_PATH]; long hFile; - mir_sntprintf(mask, _countof(mask), _T("%s\\*.msf"), Folder); + mir_sntprintf(mask, _T("%s\\*.msf"), Folder); //fd.attrib = _A_SUBDIR; hFile = _tfindfirst(mask, &fd); if (hFile != -1) @@ -342,14 +342,14 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder) } while (!_tfindnext(hFile, &fd)); _findclose(hFile); } - mir_sntprintf(mask, _countof(mask), _T("%s\\*"), Folder); + mir_sntprintf(mask, _T("%s\\*"), Folder); hFile = _tfindfirst(mask, &fd); { do { if (fd.attrib&_A_SUBDIR && !(mir_tstrcmpi(fd.name, _T(".")) == 0 || mir_tstrcmpi(fd.name, _T("..")) == 0)) {//Next level of subfolders TCHAR path[MAX_PATH]; - mir_sntprintf(path, _countof(path), _T("%s\\%s"), Folder, fd.name); + mir_sntprintf(path, _T("%s\\%s"), Folder, fd.name); SearchSkinFiles(hwndDlg, path); } } while (!_tfindnext(hFile, &fd)); @@ -414,7 +414,7 @@ HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file) _tcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE); } else { - mir_sntprintf(fullName, _countof(fullName), _T("%s\\%s"), path, file); + mir_sntprintf(fullName, _T("%s\\%s"), path, file); _tcsncpy_s(defskinname, file, _TRUNCATE); TCHAR *p = _tcsrchr(defskinname, '.'); if (p) *p = 0; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Name"), defskinname, sd->Name, _countof(sd->Name), fullName); @@ -522,7 +522,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) TCHAR skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, _countof(imfn), (LPCTSTR)lParam); IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder); - mir_sntprintf(prfn, _countof(prfn), _T("%s\\%s"), skinfolder, imfn); + mir_sntprintf(prfn, _T("%s\\%s"), skinfolder, imfn); PathToAbsoluteT(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 8fc3333cff..20d96b08fc 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -770,12 +770,12 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (msg == WM_LBUTTONDOWN && bCtrl) {
if (g_CluiData.bFilterEffective != CLVM_FILTER_PROTOS || !bShift) {
ApplyViewMode("");
- mir_snprintf(g_CluiData.protoFilter, _countof(g_CluiData.protoFilter), "%s|", p.szAccountName);
+ mir_snprintf(g_CluiData.protoFilter, "%s|", p.szAccountName);
g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
else {
char protoF[sizeof(g_CluiData.protoFilter)];
- mir_snprintf(protoF, _countof(protoF), "%s|", p.szAccountName);
+ mir_snprintf(protoF, "%s|", p.szAccountName);
char *pos = strstri(g_CluiData.protoFilter, p.szAccountName);
if (pos) {
// remove filter
@@ -789,7 +789,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa }
else {
//add filter
- mir_snprintf(g_CluiData.protoFilter, _countof(g_CluiData.protoFilter), "%s%s", g_CluiData.protoFilter, protoF);
+ mir_snprintf(g_CluiData.protoFilter, "%s%s", g_CluiData.protoFilter, protoF);
g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
}
@@ -809,7 +809,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa continue;
char protoF[sizeof(g_CluiData.protoFilter)];
- mir_snprintf(protoF, _countof(protoF), "%s|", accs[k]->szModuleName);
+ mir_snprintf(protoF, "%s|", accs[k]->szModuleName);
if (strstri(g_CluiData.protoFilter, protoF)) {
if (!first)
mir_strncat(filterName, "; ", _countof(filterName) - mir_strlen(filterName));
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 63ccf96317..6b8c55e12d 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -403,25 +403,25 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l StatusBarProtocolOptions *sbpo = (StatusBarProtocolOptions*)SendMessage(hwndComboBox, CB_GETITEMDATA, i, 0);
char settingBuf[256];
- mir_snprintf(settingBuf, _countof(settingBuf), "SBarAccountIsCustom_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "SBarAccountIsCustom_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->AccountIsCustomized);
- mir_snprintf(settingBuf, _countof(settingBuf), "HideAccount_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "HideAccount_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->HideAccount);
- mir_snprintf(settingBuf, _countof(settingBuf), "SBarShow_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "SBarShow_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->SBarShow);
- mir_snprintf(settingBuf, _countof(settingBuf), "SBarRightClk_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "SBarRightClk_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->SBarRightClk);
- mir_snprintf(settingBuf, _countof(settingBuf), "UseConnectingIcon_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "UseConnectingIcon_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->UseConnectingIcon);
- mir_snprintf(settingBuf, _countof(settingBuf), "ShowUnreadEmails_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "ShowUnreadEmails_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->ShowUnreadEmails);
- mir_snprintf(settingBuf, _countof(settingBuf), "ShowXStatus_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "ShowXStatus_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, sbpo->ShowXStatus);
- mir_snprintf(settingBuf, _countof(settingBuf), "PaddingLeft_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "PaddingLeft_%s", sbpo->szName);
db_set_dw(NULL, "CLUI", settingBuf, sbpo->PaddingLeft);
- mir_snprintf(settingBuf, _countof(settingBuf), "PaddingRight_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "PaddingRight_%s", sbpo->szName);
db_set_dw(NULL, "CLUI", settingBuf, sbpo->PaddingRight);
}
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index 6644f0a846..decbcd621e 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -101,7 +101,7 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint, POINT *pOffset) if (!g_CluiData.fDisableSkinEngine) {
char szRequest[128];
/* painting */
- mir_snprintf(szRequest, _countof(szRequest), "Button,ID=%s,Hovered=%s,Pressed=%s,Focused=%s",
+ mir_snprintf(szRequest, "Button,ID=%s,Hovered=%s,Pressed=%s,Focused=%s",
bct->szButtonID, // ID
b2str(bct->stateId == PBS_HOT), // Hovered
b2str(bct->stateId == PBS_PRESSED || bct->bIsPushed == TRUE), // Pressed
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index f3d98a0056..121fbf4bef 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -538,7 +538,7 @@ static void UpdateFilters() for (i = 0; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- mir_snprintf(szMask, _countof(szMask), "%s|", szTemp);
+ mir_snprintf(szMask, "%s|", szTemp);
if (szPF && strstr(szPF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
@@ -561,7 +561,7 @@ static void UpdateFilters() for (i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, _countof(szMask), _T("%s|"), szTemp);
+ mir_sntprintf(szMask, _T("%s|"), szTemp);
if (szGF && _tcsstr(szGF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 1efaba03ad..6dbfb937d6 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -485,7 +485,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str }
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
- mir_sntprintf(szGroupMask, _countof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
+ mir_sntprintf(szGroupMask, _T("%s|"), &dbv.ptszVal[1]);
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
}
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index e590392b4d..b1e87183be 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -66,7 +66,7 @@ int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact, HICON if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE && phIcon != NULL) {
if (szProto) {
char szBuf[128];
- mir_snprintf(szBuf, _countof(szBuf), "%s_conn", szProto);
+ mir_snprintf(szBuf, "%s_conn", szProto);
*phIcon = IcoLib_GetIcon(szBuf);
}
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 752cc0c8c2..d7705d4239 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -246,7 +246,7 @@ static void CacheClientIcons() for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) { char szBuffer[128]; - mir_snprintf(szBuffer, _countof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); + mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); overlayicons[i - IDI_OVL_OFFLINE] = IcoLib_GetIcon(szBuffer); } } @@ -257,7 +257,7 @@ static void InitIcoLib() for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) { char szBuffer[128]; - mir_snprintf(szBuffer, _countof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); + mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); IconItemT icon = { pcli->pfnGetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), 0), szBuffer, i }; Icon_RegisterT(g_hInst, LPGENT("Contact list") _T("/") LPGENT("Overlay icons"), &icon, 1); } @@ -270,7 +270,7 @@ static void InitIcoLib() continue; TCHAR szDescr[128]; - mir_sntprintf(szDescr, _countof(szDescr), TranslateT("%s connecting"), accs[k]->tszAccountName); + mir_sntprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName); IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING }; Icon_RegisterT(g_hInst, LPGENT("Contact list") _T("/") LPGENT("Connecting icons"), &icon, 1, accs[k]->szModuleName); } @@ -1420,7 +1420,7 @@ skipbg: if (serviceFailure) { char szError[512]; - mir_snprintf(szError, _countof(szError), Translate("The service %s specified by the %s button definition was not found. You may need to install additional plugins."), item->szService, item->szName); + mir_snprintf(szError, Translate("The service %s specified by the %s button definition was not found. You may need to install additional plugins."), item->szService, item->szName); MessageBoxA(0, szError, Translate("Service failure"), MB_OK); } break; @@ -1669,7 +1669,7 @@ buttons_done: if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE) { char szBuffer[128]; - mir_snprintf(szBuffer, _countof(szBuffer), "%s_conn", pd->RealName); + mir_snprintf(szBuffer, "%s_conn", pd->RealName); hIcon = IcoLib_GetIcon(szBuffer); } else if (cfg::dat.bShowXStatusOnSbar && status > ID_STATUS_OFFLINE) { diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index bbf7b4f8e0..2e42ddf769 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -468,7 +468,7 @@ int LocateStorePosition(int Frameid, int maxstored) for (int i = 0; i < maxstored; i++) { char settingname[255]; - mir_snprintf(settingname, _countof(settingname), "Name%d", i); + mir_snprintf(settingname, "Name%d", i); ptrT frmname(db_get_tsa(0, CLUIFrameModule, settingname)); if (frmname == NULL) continue; if (mir_tstrcmpi(frmname, Frames[Frameid].name) == 0) @@ -2445,7 +2445,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA if (pos != -1) { int oldflags; char TBcapt[255]; - mir_snprintf(TBcapt, _countof(TBcapt), "%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d", + mir_snprintf(TBcapt, "%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d", Frames[pos].name, Frames[pos].height, Frames[pos].visible, Frames[pos].floating, Frames[pos].FloatingPos.x, Frames[pos].FloatingPos.y, Frames[pos].FloatingSize.x, Frames[pos].FloatingSize.y, @@ -2929,7 +2929,7 @@ TCHAR g_ptszEventName[100]; static int CLUIFrameOnModulesLoad(WPARAM, LPARAM) { - mir_sntprintf(g_ptszEventName, _countof(g_ptszEventName), _T("mf_update_evt_%d"), GetCurrentThreadId()); + mir_sntprintf(g_ptszEventName, _T("mf_update_evt_%d"), GetCurrentThreadId()); g_hEventThread = CreateEvent(NULL, TRUE, FALSE, g_ptszEventName); hThreadMFUpdate = mir_forkthread(MF_UpdateThread, NULL); SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE); diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index e5e059f787..ccdb98ccc4 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -33,7 +33,7 @@ static INT_PTR GetClistVersion(WPARAM, LPARAM lParam) {
static char g_szVersionString[256];
- mir_snprintf(g_szVersionString, _countof(g_szVersionString), "%s, %d.%d.%d.%d", pluginInfo.shortName, HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOBYTE(pluginInfo.version)));
+ mir_snprintf(g_szVersionString, "%s, %d.%d.%d.%d", pluginInfo.shortName, HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOBYTE(pluginInfo.version)));
if (!IsBadWritePtr((LPVOID)lParam, 4))
*((DWORD *)lParam) = pluginInfo.version;
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 48486e1456..0cf73d44aa 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -253,13 +253,13 @@ INT_PTR CALLBACK API::Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) case WM_INITDIALOG: {
char szBuffer[2048];
#ifdef _WIN64
- mir_snprintf(szBuffer, _countof(szBuffer),
+ mir_snprintf(szBuffer,
"Exception %16.16X at address %16.16X occured in %s at line %d.\r\n\r\nEAX=%16.16X EBX=%16.16X ECX=%16.16X\r\nEDX=%16.16X ESI=%16.16X EDI=%16.16X\r\nEBP=%16.16X ESP=%16.16X EIP=%16.16X",
exRecord.ExceptionCode, exRecord.ExceptionAddress, exSzFile, exLine,
exCtx.Rax, exCtx.Rbx, exCtx.Rcx, exCtx.Rdx,
exCtx.Rsi, exCtx.Rdi, exCtx.Rbp, exCtx.Rsp, exCtx.Rip);
#else
- mir_snprintf(szBuffer, _countof(szBuffer),
+ mir_snprintf(szBuffer,
"Exception %8.8X at address %8.8X occured in %s at line %d.\r\n\r\nEAX=%8.8X EBX=%8.8X ECX=%8.8X\r\nEDX=%8.8X ESI=%8.8X EDI=%8.8X\r\nEBP=%8.8X ESP=%8.8X EIP=%8.8X",
exRecord.ExceptionCode, exRecord.ExceptionAddress, exSzFile, exLine,
exCtx.Eax,exCtx.Ebx, exCtx.Ecx, exCtx.Edx,
@@ -303,8 +303,8 @@ int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, TCH memcpy(&exRecord, ep->ExceptionRecord, sizeof(EXCEPTION_RECORD));
memcpy(&exCtx, ep->ContextRecord, sizeof(CONTEXT));
- mir_snprintf(exSzFile, _countof(exSzFile), "%s%s", szName, szExt);
- mir_sntprintf(exReason, _countof(exReason), _T("An application error has occured: %s"), szReason);
+ mir_snprintf(exSzFile, "%s%s", szName, szExt);
+ mir_sntprintf(exReason, _T("An application error has occured: %s"), szReason);
exLine = line;
exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), 0, Ex_DlgProc, 0);
exAllowContinue = fAllowContinue;
@@ -370,7 +370,7 @@ void CRTException::display() const TCHAR *tszMsg = mir_a2t(what());
TCHAR tszBoxMsg[500];
- mir_sntprintf(tszBoxMsg, _countof(tszBoxMsg), _T("%s\n\n(%s)"), tszMsg, m_szParam);
+ mir_sntprintf(tszBoxMsg, _T("%s\n\n(%s)"), tszMsg, m_szParam);
::MessageBox(0, tszBoxMsg, _T("Clist_nicer runtime error"), MB_OK | MB_ICONERROR);
mir_free(tszMsg);
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index aad2b8689c..27d3b837ed 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -287,9 +287,9 @@ void LoadExtBkSettingsFromDB() *p = _StatusItems[0];
ID_EXTBK_LAST++;
- mir_snprintf(p->szDBname, _countof(p->szDBname), "EXBK_%s", accs[i]->szModuleName);
+ mir_snprintf(p->szDBname, "EXBK_%s", accs[i]->szModuleName);
if (i == 0)
- mir_snprintf(p->szName, _countof(p->szName), "{-}%s", accs[i]->szModuleName);
+ mir_snprintf(p->szName, "{-}%s", accs[i]->szModuleName);
else
strncpy_s(p->szName, accs[i]->szModuleName, _TRUNCATE);
p->statusID = ID_EXTBK_LAST;
@@ -487,34 +487,34 @@ void extbk_export(char *file) }
for (n = 0; n <= FONTID_LAST; n++) {
- mir_snprintf(szSection, _countof(szSection), "Font%d", n);
+ mir_snprintf(szSection, "Font%d", n);
- mir_snprintf(szKey, _countof(szKey), "Font%dName", n);
+ mir_snprintf(szKey, "Font%dName", n);
if (!cfg::getString(NULL, "CLC", szKey, &dbv)) {
WritePrivateProfileStringA(szSection, "Name", dbv.pszVal, file);
mir_free(dbv.pszVal);
}
- mir_snprintf(szKey, _countof(szKey), "Font%dSize", n);
+ mir_snprintf(szKey, "Font%dSize", n);
data = (DWORD)cfg::getByte("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Size", &data, 1, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dSty", n);
+ mir_snprintf(szKey, "Font%dSty", n);
data = (DWORD)cfg::getByte("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Style", &data, 1, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dSet", n);
+ mir_snprintf(szKey, "Font%dSet", n);
data = (DWORD)cfg::getByte("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Set", &data, 1, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dCol", n);
+ mir_snprintf(szKey, "Font%dCol", n);
data = cfg::getDword("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Color", &data, 4, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dFlags", n);
+ mir_snprintf(szKey, "Font%dFlags", n);
data = (DWORD)cfg::getDword("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Flags", &data, 4, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dAs", n);
+ mir_snprintf(szKey, "Font%dAs", n);
data = (DWORD)cfg::getWord("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "SameAs", &data, 2, file);
}
@@ -555,7 +555,7 @@ DWORD __fastcall HexStringToLong(const char *szSource) static StatusItems_t default_item = {
"{--Contact--}", "", 0,
CLCDEFAULT_GRADIENT, CLCDEFAULT_CORNER,
- CLCDEFAULT_COLOR, CLCDEFAULT_COLOR2, CLCDEFAULT_COLOR2_TRANSPARENT, -1,
+ CLCDEFAULT_COLOR, CLCDEFAULT_COLOR2, CLCDEFAULT_COLOR2_TRANSPARENT, DWORD(-1),
CLCDEFAULT_ALPHA, CLCDEFAULT_MRGN_LEFT, CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT,
CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE
};
@@ -700,12 +700,12 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file) this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_snprintf(def_color, _countof(def_color), "%6.6x", clr);
+ mir_snprintf(def_color, "%6.6x", clr);
GetPrivateProfileStringA(szItem, "Color1", def_color, buffer, 400, file);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_snprintf(def_color, _countof(def_color), "%6.6x", clr);
+ mir_snprintf(def_color, "%6.6x", clr);
GetPrivateProfileStringA(szItem, "Color2", def_color, buffer, 400, file);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -777,7 +777,7 @@ done_with_glyph: strncpy(tmpItem.szName, &itemname[1], sizeof(tmpItem.szName));
tmpItem.szName[sizeof(tmpItem.szName) - 1] = 0;
_splitpath(szFileName, szDrive, szPath, NULL, NULL);
- mir_snprintf(szFinalName, _countof(szFinalName), "%s\\%s\\%s", szDrive, szPath, buffer);
+ mir_snprintf(szFinalName, "%s\\%s\\%s", szDrive, szPath, buffer);
tmpItem.alpha = GetPrivateProfileIntA(itemname, "Alpha", 100, szFileName);
tmpItem.alpha = min(tmpItem.alpha, 100);
tmpItem.alpha = (BYTE)((FLOAT)(((FLOAT)tmpItem.alpha) / 100) * 255);
@@ -853,7 +853,7 @@ done_with_glyph: goto imgread_done;
}
for (n = 0;; n++) {
- mir_snprintf(szItemNr, _countof(szItemNr), "Item%d", n);
+ mir_snprintf(szItemNr, "Item%d", n);
GetPrivateProfileStringA(itemname, szItemNr, "None", buffer, 500, szFileName);
if (!mir_strcmp(buffer, "None"))
break;
@@ -1274,7 +1274,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) char UIN[40];
switch (dbv.type) {
case DBVT_DWORD:
- mir_snprintf(UIN, _countof(UIN), "%d", dbv.dVal);
+ mir_snprintf(UIN, "%d", dbv.dVal);
break;
case DBVT_ASCIIZ:
strncpy_s(UIN, dbv.pszVal, _TRUNCATE);
@@ -1363,38 +1363,38 @@ void extbk_import(char *file, HWND hwndDlg) GetPrivateProfileStructA("Global", "Version", &version, 4, file);
if (version >= 2) {
for (n = 0; n <= FONTID_LAST; n++) {
- mir_snprintf(szSection, _countof(szSection), "Font%d", n);
+ mir_snprintf(szSection, "Font%d", n);
- mir_snprintf(szKey, _countof(szKey), "Font%dName", n);
+ mir_snprintf(szKey, "Font%dName", n);
GetPrivateProfileStringA(szSection, "Name", "Arial", buffer, sizeof(buffer), file);
cfg::writeString(NULL, "CLC", szKey, buffer);
- mir_snprintf(szKey, _countof(szKey), "Font%dSize", n);
+ mir_snprintf(szKey, "Font%dSize", n);
data = 0;
GetPrivateProfileStructA(szSection, "Size", &data, 1, file);
cfg::writeByte("CLC", szKey, (BYTE)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dSty", n);
+ mir_snprintf(szKey, "Font%dSty", n);
data = 0;
GetPrivateProfileStructA(szSection, "Style", &data, 1, file);
cfg::writeByte("CLC", szKey, (BYTE)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dSet", n);
+ mir_snprintf(szKey, "Font%dSet", n);
data = 0;
GetPrivateProfileStructA(szSection, "Set", &data, 1, file);
cfg::writeByte("CLC", szKey, (BYTE)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dCol", n);
+ mir_snprintf(szKey, "Font%dCol", n);
data = 0;
GetPrivateProfileStructA(szSection, "Color", &data, 4, file);
cfg::writeDword("CLC", szKey, data);
- mir_snprintf(szKey, _countof(szKey), "Font%dFlags", n);
+ mir_snprintf(szKey, "Font%dFlags", n);
data = 0;
GetPrivateProfileStructA(szSection, "Flags", &data, 4, file);
cfg::writeDword("CLC", szKey, (WORD)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dAs", n);
+ mir_snprintf(szKey, "Font%dAs", n);
data = 0;
GetPrivateProfileStructA(szSection, "SameAs", &data, 2, file);
cfg::writeDword("CLC", szKey, (WORD)data);
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 2aec05b640..22268a7df3 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -160,7 +160,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM BYTE isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0);
TCHAR szTipText[256];
- mir_sntprintf(szTipText, _countof(szTipText), _T("<b>%s</b>: %s%s"),
+ mir_sntprintf(szTipText, _T("<b>%s</b>: %s%s"),
PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? _T(" (LOCKED)") : _T(""));
CLCINFOTIP ti = { sizeof(ti) };
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 74107561e0..cb647b2923 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -481,7 +481,7 @@ void UpdateFilters() for (i = 0; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- mir_snprintf(szMask, _countof(szMask), "%s|", szTemp);
+ mir_snprintf(szMask, "%s|", szTemp);
if (dbv_pf.pszVal && strstr(dbv_pf.pszVal, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
@@ -505,7 +505,7 @@ void UpdateFilters() for (i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, _countof(szMask), _T("%s|"), szTemp);
+ mir_sntprintf(szMask, _T("%s|"), szTemp);
if (dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 05f8c0e839..673813dc24 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -90,13 +90,13 @@ int AccountName2Protocol(const char *accountName, OUT char *uniqueProtocolName, void HandleWrongParametersCount(PCommand command, PReply reply)
{
reply->code = MIMRES_WRONGPARAMSCOUNT;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Wrong number of parameters for command '%s'."), command->command);
+ mir_snprintf(reply->message, Translate("Wrong number of parameters for command '%s'."), command->command);
}
void HandleUnknownParameter(PCommand command, char *param, PReply reply)
{
reply->code = MIMRES_UNKNOWNPARAM;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Unknown parameter '%s' for command '%s'."), param, command->command);
+ mir_snprintf(reply->message, Translate("Unknown parameter '%s' for command '%s'."), param, command->command);
}
int ParseValueParam(char *param, void *&result)
@@ -231,7 +231,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep }
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Current global status: %s.%s"), pretty, perAccountStatus.c_str());
+ mir_snprintf(reply->message, Translate("Current global status: %s.%s"), pretty, perAccountStatus.c_str());
return;
}
@@ -252,7 +252,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep PrettyStatusMode(status, pn, sizeof(pn));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Changed global status to '%s' (previous status was '%s')."), pn, po);
+ mir_snprintf(reply->message, Translate("Changed global status to '%s' (previous status was '%s')."), pn, po);
}
else {
HandleUnknownParameter(command, argv[2], reply);
@@ -283,17 +283,17 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep switch (res) {
case 0:
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Changed '%s' status to '%s' (previous status was '%s')."), account, pn, po);
+ mir_snprintf(reply->message, Translate("Changed '%s' status to '%s' (previous status was '%s')."), account, pn, po);
return;
case CALLSERVICE_NOTFOUND:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("'%s' doesn't seem to be a valid account."), account);
+ mir_snprintf(reply->message, Translate("'%s' doesn't seem to be a valid account."), account);
return;
default:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Failed to change status for account '%s' to '%s'."), account, pn);
+ mir_snprintf(reply->message, Translate("Failed to change status for account '%s' to '%s'."), account, pn);
return;
}
}
@@ -377,22 +377,22 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re switch (res) {
case 0:
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Changed '%s' status message to '%s' (status is '%s')."), account, awayMsg, pn);
+ mir_snprintf(reply->message, Translate("Changed '%s' status message to '%s' (status is '%s')."), account, awayMsg, pn);
return;
case CALLSERVICE_NOTFOUND:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("'%s' doesn't seem to be a valid account."), account);
+ mir_snprintf(reply->message, Translate("'%s' doesn't seem to be a valid account."), account);
return;
case -2:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Account '%s' does not support away messages, skipping."), account);
+ mir_snprintf(reply->message, Translate("Account '%s' does not support away messages, skipping."), account);
return;
default:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Failed to change status message for account '%s' to '%s' (status is '%s')."), account, awayMsg, pn);
+ mir_snprintf(reply->message, Translate("Failed to change status message for account '%s' to '%s' (status is '%s')."), account, awayMsg, pn);
return;
}
}
@@ -407,21 +407,21 @@ void Set2StateReply(PReply reply, int state, int failure, char *successTrue, cha if (state) {
if (failure) {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate(failureTrue));
+ mir_snprintf(reply->message, Translate(failureTrue));
}
else {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate(successTrue));
+ mir_snprintf(reply->message, Translate(successTrue));
}
}
else {
if (failure) {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate(failureFalse));
+ mir_snprintf(reply->message, Translate(failureFalse));
}
else {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate(successFalse));
+ mir_snprintf(reply->message, Translate(successFalse));
}
}
}
@@ -594,7 +594,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply PostMessage(hWndMiranda, WM_COMMAND, ID_ICQ_EXIT, 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued a quit command."));
+ mir_snprintf(reply->message, Translate("Issued a quit command."));
break;
}
@@ -612,7 +612,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply PostMessage(hWndMiranda, WM_COMMAND, ID_ICQ_EXIT, 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued a quit and wait command."));
+ mir_snprintf(reply->message, Translate("Issued a quit and wait command."));
SetEvent(heServerBufferFull);
@@ -646,11 +646,11 @@ void HandleExchangeCommand(PCommand command, TArgument *argv, int argc, PReply r INT_PTR ret = CallService(MS_EXCHANGE_CHECKEMAIL, 0, 0);
if (ret != CALLSERVICE_NOTFOUND) {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued check email command to Exchange plugin."));
+ mir_snprintf(reply->message, Translate("Issued check email command to Exchange plugin."));
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Exchange plugin is not running."));
+ mir_snprintf(reply->message, Translate("Exchange plugin is not running."));
}
}
else {
@@ -678,11 +678,11 @@ void HandleYAMNCommand(PCommand command, TArgument *argv, int argc, PReply reply CallService(MS_YAMN_FORCECHECK, 0, 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued check email command to YAMN plugin."));
+ mir_snprintf(reply->message, Translate("Issued check email command to YAMN plugin."));
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("YAMN plugin is not running."));
+ mir_snprintf(reply->message, Translate("YAMN plugin is not running."));
}
}
else {
@@ -713,11 +713,11 @@ void HandleCallServiceCommand(PCommand command, TArgument *argv, int argc, PRepl INT_PTR res = CallService(service, ((res1 == 1) ? *((long *)wParam) : (WPARAM)wParam), (LPARAM)((res2 == 1) ? *((long *)lParam) : (LPARAM)lParam));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("CallService call successful: service '%s' returned %p."), service, res);
+ mir_snprintf(reply->message, Translate("CallService call successful: service '%s' returned %p."), service, res);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Invalid parameter '%s' passed to CallService command."), (wParam) ? argv[4] : argv[3]);
+ mir_snprintf(reply->message, Translate("Invalid parameter '%s' passed to CallService command."), (wParam) ? argv[4] : argv[3]);
}
free(wParam);
@@ -726,7 +726,7 @@ void HandleCallServiceCommand(PCommand command, TArgument *argv, int argc, PRepl }
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Service '%s' does not exist."), service);
+ mir_snprintf(reply->message, Translate("Service '%s' does not exist."), service);
}
break;
@@ -893,7 +893,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r db_unset(NULL, module, key);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Setting '%s/%s' deleted."), module, key);
+ mir_snprintf(reply->message, Translate("Setting '%s/%s' deleted."), module, key);
}
else {
HandleWrongParametersCount(command, reply);
@@ -941,7 +941,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r }
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Wrote '%s:%s' to database entry '%s/%s'."), wrote, argv[5] + 1, module, key);
+ mir_snprintf(reply->message, Translate("Wrote '%s:%s' to database entry '%s/%s'."), wrote, argv[5] + 1, module, key);
free(value);
}
@@ -962,16 +962,16 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r if (ParseDatabaseData(&var, buffer, sizeof(buffer), TRUE)) {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), "'%s/%s' - %s.", module, key, buffer);
+ mir_snprintf(reply->message, "'%s/%s' - %s.", module, key, buffer);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Could not retrieve setting '%s/%s': %s."), module, key, buffer);
+ mir_snprintf(reply->message, Translate("Could not retrieve setting '%s/%s': %s."), module, key, buffer);
}
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Setting '%s/%s' was not found."), module, key);
+ mir_snprintf(reply->message, Translate("Setting '%s/%s' was not found."), module, key);
}
}
@@ -1057,7 +1057,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe int value = db_get_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
+ mir_snprintf(buffer, "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
break;
}
@@ -1071,7 +1071,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("'%s' proxy was disabled."), protocol);
+ mir_snprintf(buffer, Translate("'%s' proxy was disabled."), protocol);
break;
}
@@ -1081,7 +1081,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLUseProxy", 1);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("'%s' proxy was enabled."), protocol);
+ mir_snprintf(buffer, Translate("'%s' proxy was enabled."), protocol);
break;
}
@@ -1093,7 +1093,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLUseProxy", value);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
+ mir_snprintf(buffer, (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
break;
}
@@ -1121,7 +1121,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe PrettyProxyType(db_get_b(NULL, module, "NLProxyType", 0), type, sizeof(type));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
+ mir_snprintf(buffer, Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
break;
}
@@ -1140,11 +1140,11 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLProxyType", type);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
+ mir_snprintf(buffer, Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(buffer, _countof(buffer), Translate("%s The port or the proxy type parameter is invalid."), protocol);
+ mir_snprintf(buffer, Translate("%s The port or the proxy type parameter is invalid."), protocol);
}
break;
@@ -1167,7 +1167,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe reply->message[_countof(reply->message) - 1] = 0;
}
else {
- mir_snprintf(reply->message, _countof(reply->message), buffer);
+ mir_snprintf(reply->message, buffer);
}
}
@@ -1210,7 +1210,7 @@ void HandleProxyCommand(PCommand command, TArgument *argv, int argc, PReply repl if (!found) {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("'%s' doesn't seem to be a valid account."), account);
+ mir_snprintf(reply->message, Translate("'%s' doesn't seem to be a valid account."), account);
}
}
else {
@@ -1309,7 +1309,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r char *contact = GetContactName(hContact, protocol);
char *id = GetContactID(hContact, protocol);
if (ContactMatchSearch(hContact, contact, id, protocol, &argv[3], argc - 3)) {
- mir_snprintf(buffer, _countof(buffer), "%s:[%s]:%s (%08d)", contact, id, protocol, hContact);
+ mir_snprintf(buffer, "%s:[%s]:%s (%08d)", contact, id, protocol, hContact);
if (count) {
mir_strncat(reply->message, "\n", _countof(reply->message) - mir_strlen(reply->message));
mir_strncat(reply->message, buffer, _countof(reply->message) - mir_strlen(reply->message));
@@ -1376,7 +1376,7 @@ void AddHistoryEvent(DBEVENTINFO *dbEvent, char *contact, PReply reply) char *message = DbGetEventTextA(dbEvent, CP_ACP);
static char buffer[8192];
- mir_snprintf(buffer, _countof(buffer), "[%s] %15s: %s", timestamp, sender, message);
+ mir_snprintf(buffer, "[%s] %15s: %s", timestamp, sender, message);
if (reply->message[0] != 0) {
@@ -1409,7 +1409,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re DBEVENTINFO dbEvent = { sizeof(dbEvent) };
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("No unread messages found."));
+ mir_snprintf(reply->message, Translate("No unread messages found."));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
MEVENT hEvent = db_event_firstUnread(hContact);
@@ -1426,7 +1426,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re char protocol[128];
GetContactProto(hContact, protocol, sizeof(protocol));
char *contact = GetContactName(hContact, protocol);
- mir_snprintf(buffer, _countof(buffer), Translate("%s:%s - %d unread events."), contact, protocol, count);
+ mir_snprintf(buffer, Translate("%s:%s - %d unread events."), contact, protocol, count);
if (contacts > 0) {
mir_strncat(reply->message, "\n", _countof(reply->message) - mir_strlen(reply->message));
@@ -1467,13 +1467,13 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re }
else if (_stricmp(cmd, "show") == 0) {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Contact '%s' has %d events in history."), contact, db_event_count(hContact));
+ mir_snprintf(reply->message, Translate("Contact '%s' has %d events in history."), contact, db_event_count(hContact));
}
else HandleUnknownParameter(command, cmd, reply);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Could not find contact handle for contact '%s'."), contact);
+ mir_snprintf(reply->message, Translate("Could not find contact handle for contact '%s'."), contact);
}
}
break;
@@ -1529,7 +1529,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re }
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Could not find contact handle for contact '%s'."), contact);
+ mir_snprintf(reply->message, Translate("Could not find contact handle for contact '%s'."), contact);
}
}
break;
@@ -1549,14 +1549,14 @@ void HandleVersionCommand(PCommand command, TArgument*, int argc, PReply reply) if (ServiceExists(MS_CRASHDUMPER_GETINFO)) {
char *data;
CallService(MS_CRASHDUMPER_GETINFO, (WPARAM)FALSE, (LPARAM)&data);
- mir_snprintf(reply->message, _countof(reply->message), data);
+ mir_snprintf(reply->message, data);
mir_free(data);
}
else {
char miranda[512];
DWORD v = pluginInfo.version;
CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(miranda), (LPARAM)miranda);
- mir_snprintf(reply->message, _countof(reply->message), "Miranda %s\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF));
+ mir_snprintf(reply->message, "Miranda %s\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF));
}
}
else HandleWrongParametersCount(command, reply);
@@ -1577,7 +1577,7 @@ void HandleSetNicknameCommand(PCommand command, TArgument *argv, int argc, PRepl }
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Error setting nickname to '%s' for protocol '%s'"), nickname, protocol);
+ mir_snprintf(reply->message, Translate("Error setting nickname to '%s' for protocol '%s'"), nickname, protocol);
}
}
else HandleWrongParametersCount(command, reply);
@@ -1684,6 +1684,6 @@ void HandleCommand(PCommand command, TArgument *argv, int argc, PReply reply) default:
reply->code = MIMRES_NOTFOUND;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Command '%s' is not currently supported."), command->command);
+ mir_snprintf(reply->message, Translate("Command '%s' is not currently supported."), command->command);
}
}
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index 4631775c63..993b300648 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -210,17 +210,17 @@ char* GetContactID(MCONTACT hContact, char *szProto) char tmp[16];
switch (ctInfo.type) {
case CNFT_BYTE:
- mir_snprintf(tmp, _countof(tmp), "%d", ctInfo.bVal);
+ mir_snprintf(tmp, "%d", ctInfo.bVal);
buffer = strdup(tmp);
break;
case CNFT_WORD:
- mir_snprintf(tmp, _countof(tmp), "%d", ctInfo.wVal);
+ mir_snprintf(tmp, "%d", ctInfo.wVal);
buffer = strdup(tmp);
break;
case CNFT_DWORD:
- mir_snprintf(tmp, _countof(tmp), "%ld", ctInfo.dVal);
+ mir_snprintf(tmp, "%ld", ctInfo.dVal);
buffer = strdup(tmp);
break;
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 6cda0d5484..4708b7da38 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -94,8 +94,7 @@ void saveSettingsConnections(struct CONNECTION *connHead) char buff[128];
int i = 0;
struct CONNECTION *tmp = connHead;
- while (tmp != NULL)
- {
+ while (tmp != NULL) {
mir_snprintf(buff, "%dFilterIntIp", i);
db_set_ts(NULL, PLUGINNAME, buff, tmp->strIntIp);
@@ -124,8 +123,7 @@ struct CONNECTION* LoadSettingsConnections() DBVARIANT dbv;
char buff[128];
int i = 0;
- for (i = settingFiltersCount - 1; i >= 0; i--)
- {
+ for (i = settingFiltersCount - 1; i >= 0; i--) {
struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
mir_snprintf(buff, "%dFilterIntIp", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
@@ -167,8 +165,7 @@ void LoadSettings() settingFgColor = (COLORREF)db_get_dw(NULL, PLUGINNAME, "PopupFgColor", (DWORD)0x000000);
settingFiltersCount = (INT)db_get_dw(NULL, PLUGINNAME, "FiltersCount", 0);
settingStatusMask = (WORD)db_get_w(NULL, PLUGINNAME, "StatusMask", 16);
- for (int i = 0; i < STATUS_COUNT; i++)
- {
+ for (int i = 0; i < STATUS_COUNT; i++) {
char buff[128];
mir_snprintf(buff, "Status%d", i);
settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
@@ -189,8 +186,7 @@ void fillExceptionsListView(HWND hwndDlg) // Initialize LVITEM members that are common to all
// items.
lvI.mask = LVIF_TEXT;
- while (tmp)
- {
+ while (tmp) {
TCHAR tmpAddress[25];
lvI.iItem = i++;
lvI.iSubItem = 0;
@@ -198,16 +194,16 @@ void fillExceptionsListView(HWND hwndDlg) ListView_InsertItem(hwndList, &lvI);
lvI.iSubItem = 1;
if (tmp->intIntPort == -1)
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:*"), tmp->strIntIp);
+ mir_sntprintf(tmpAddress, _T("%s:*"), tmp->strIntIp);
else
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:%d"), tmp->strIntIp, tmp->intIntPort);
+ mir_sntprintf(tmpAddress, _T("%s:%d"), tmp->strIntIp, tmp->intIntPort);
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 2;
if (tmp->intExtPort == -1)
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:*"), tmp->strExtIp);
+ mir_sntprintf(tmpAddress, _T("%s:*"), tmp->strExtIp);
else
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:%d"), tmp->strExtIp, tmp->intExtPort);
+ mir_sntprintf(tmpAddress, _T("%s:%d"), tmp->strExtIp, tmp->intExtPort);
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 3;
@@ -221,59 +217,57 @@ void fillExceptionsListView(HWND hwndDlg) //filter editor dialog box procedure opened modally from options dialog
static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
+ switch (message) {
case WM_INITDIALOG:
- {
- struct CONNECTION *conn = (struct CONNECTION*)lParam;
- TranslateDialogDefault(hWnd);
- connCurrentEditModal = conn;
- SetDlgItemText(hWnd, ID_TEXT_NAME, conn->PName);
- SetDlgItemText(hWnd, ID_TXT_LOCAL_IP, conn->strIntIp);
- SetDlgItemText(hWnd, ID_TXT_REMOTE_IP, conn->strExtIp);
-
- if (conn->intIntPort == -1)
- SetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, _T("*"));
- else
- SetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, conn->intIntPort, FALSE);
-
- if (conn->intExtPort == -1)
- SetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, _T("*"));
- else
- SetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, conn->intExtPort, FALSE);
-
- SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Always show popup"));
- SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Never show popup"));
- SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_SETCURSEL, conn->Pid == 0 ? 1 : 0, 0);
- return TRUE;
- }
- case WM_COMMAND:
- switch (LOWORD(wParam))
{
- case ID_OK:
- {
- TCHAR tmpPort[6];
- GetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, tmpPort, _countof(tmpPort));
- if (tmpPort[0] == '*')
- connCurrentEditModal->intIntPort = -1;
- else
- connCurrentEditModal->intIntPort = GetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, NULL, FALSE);
- GetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, tmpPort, _countof(tmpPort));
- if (tmpPort[0] == '*')
- connCurrentEditModal->intExtPort = -1;
+ struct CONNECTION *conn = (struct CONNECTION*)lParam;
+ TranslateDialogDefault(hWnd);
+ connCurrentEditModal = conn;
+ SetDlgItemText(hWnd, ID_TEXT_NAME, conn->PName);
+ SetDlgItemText(hWnd, ID_TXT_LOCAL_IP, conn->strIntIp);
+ SetDlgItemText(hWnd, ID_TXT_REMOTE_IP, conn->strExtIp);
+
+ if (conn->intIntPort == -1)
+ SetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, _T("*"));
else
- connCurrentEditModal->intExtPort = GetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, NULL, FALSE);
+ SetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, conn->intIntPort, FALSE);
- GetDlgItemText(hWnd, ID_TXT_LOCAL_IP, connCurrentEditModal->strIntIp, _countof(connCurrentEditModal->strIntIp));
- GetDlgItemText(hWnd, ID_TXT_REMOTE_IP, connCurrentEditModal->strExtIp, _countof(connCurrentEditModal->strExtIp));
- GetDlgItemText(hWnd, ID_TEXT_NAME, connCurrentEditModal->PName, _countof(connCurrentEditModal->PName));
-
- connCurrentEditModal->Pid = !(BOOL)SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_GETCURSEL, 0, 0);
+ if (conn->intExtPort == -1)
+ SetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, _T("*"));
+ else
+ SetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, conn->intExtPort, FALSE);
- connCurrentEditModal = NULL;
- EndDialog(hWnd, IDOK);
+ SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Always show popup"));
+ SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Never show popup"));
+ SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_SETCURSEL, conn->Pid == 0 ? 1 : 0, 0);
return TRUE;
}
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case ID_OK:
+ {
+ TCHAR tmpPort[6];
+ GetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, tmpPort, _countof(tmpPort));
+ if (tmpPort[0] == '*')
+ connCurrentEditModal->intIntPort = -1;
+ else
+ connCurrentEditModal->intIntPort = GetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, NULL, FALSE);
+ GetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, tmpPort, _countof(tmpPort));
+ if (tmpPort[0] == '*')
+ connCurrentEditModal->intExtPort = -1;
+ else
+ connCurrentEditModal->intExtPort = GetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, NULL, FALSE);
+
+ GetDlgItemText(hWnd, ID_TXT_LOCAL_IP, connCurrentEditModal->strIntIp, _countof(connCurrentEditModal->strIntIp));
+ GetDlgItemText(hWnd, ID_TXT_REMOTE_IP, connCurrentEditModal->strExtIp, _countof(connCurrentEditModal->strExtIp));
+ GetDlgItemText(hWnd, ID_TEXT_NAME, connCurrentEditModal->PName, _countof(connCurrentEditModal->PName));
+
+ connCurrentEditModal->Pid = !(BOOL)SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_GETCURSEL, 0, 0);
+
+ connCurrentEditModal = NULL;
+ EndDialog(hWnd, IDOK);
+ return TRUE;
+ }
case ID_CANCEL:
connCurrentEditModal = NULL;
EndDialog(hWnd, IDCANCEL);
@@ -282,11 +276,11 @@ static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, L return FALSE;
break;
case WM_CLOSE:
- {
- connCurrentEditModal = NULL;
- EndDialog(hWnd, IDCANCEL);
- break;
- }
+ {
+ connCurrentEditModal = NULL;
+ EndDialog(hWnd, IDCANCEL);
+ break;
+ }
}
return FALSE;
}
@@ -297,85 +291,85 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar HWND hwndList;
switch (msg) {
case WM_INITDIALOG://initialize dialog, so set properties from db.
- {
- LVCOLUMN lvc = { 0 };
- LVITEM lvI = { 0 };
- TCHAR buff[256];
- bOptionsOpen = TRUE;
- TranslateDialogDefault(hwndDlg);//translate miranda function
-#ifdef _WIN64
- mir_sntprintf(buff,_countof(buff),_T("%d.%d.%d.%d/64"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
-#else
- mir_sntprintf(buff, _T("%d.%d.%d.%d/32"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
-#endif
- SetDlgItemText(hwndDlg, IDC_VERSION, buff);
- LoadSettings();
- //connExceptionsTmp=LoadSettingsConnections();
- SetDlgItemInt(hwndDlg, IDC_INTERVAL, settingInterval, FALSE);
- SetDlgItemInt(hwndDlg, IDC_INTERVAL1, settingInterval1, TRUE);
- CheckDlgButton(hwndDlg, IDC_SETCOLOURS, settingSetColours ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_RESOLVEIP, settingResolveIp ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, ID_CHK_DEFAULTACTION, settingDefaultAction ? BST_CHECKED : BST_UNCHECKED);
-
- SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingBgColor);
- SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingFgColor);
- if (!settingSetColours) {
- HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
- CheckDlgButton(hwndDlg, IDC_SETCOLOURS, BST_UNCHECKED);
- EnableWindow(hwnd, FALSE);
- hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
- EnableWindow(hwnd, FALSE);
- }
- SendDlgItemMessage(hwndDlg, ID_ADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON6), IMAGE_ICON, 16, 16, 0));
- SendDlgItemMessage(hwndDlg, ID_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, 0));
- SendDlgItemMessage(hwndDlg, ID_DOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON4), IMAGE_ICON, 16, 16, 0));
- SendDlgItemMessage(hwndDlg, ID_UP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON5), IMAGE_ICON, 16, 16, 0));
- // initialise and fill listbox
- hwndList = GetDlgItem(hwndDlg, IDC_STATUS);
- ListView_DeleteAllItems(hwndList);
- SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
- // Initialize the LVCOLUMN structure.
- // The mask specifies that the format, width, text, and
- // subitem members of the structure are valid.
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- lvc.fmt = LVCFMT_LEFT;
- lvc.iSubItem = 0;
- lvc.pszText = TranslateT("Status");
- lvc.cx = 120; // width of column in pixels
- ListView_InsertColumn(hwndList, 0, &lvc);
- // Some code to create the list-view control.
- // Initialize LVITEM members that are common to all
- // items.
- lvI.mask = LVIF_TEXT;
- for (int i = 0; i < STATUS_COUNT; i++) {
- lvI.pszText = pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE + i, 0);
- lvI.iItem = i;
- ListView_InsertItem(hwndList, &lvI);
- ListView_SetCheckState(hwndList, i, settingStatus[i]);
- }
+ {
+ LVCOLUMN lvc = { 0 };
+ LVITEM lvI = { 0 };
+ TCHAR buff[256];
+ bOptionsOpen = TRUE;
+ TranslateDialogDefault(hwndDlg);//translate miranda function
+ #ifdef _WIN64
+ mir_sntprintf(buff, _T("%d.%d.%d.%d/64"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ #else
+ mir_sntprintf(buff, _T("%d.%d.%d.%d/32"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ #endif
+ SetDlgItemText(hwndDlg, IDC_VERSION, buff);
+ LoadSettings();
+ //connExceptionsTmp=LoadSettingsConnections();
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL, settingInterval, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL1, settingInterval1, TRUE);
+ CheckDlgButton(hwndDlg, IDC_SETCOLOURS, settingSetColours ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_RESOLVEIP, settingResolveIp ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, ID_CHK_DEFAULTACTION, settingDefaultAction ? BST_CHECKED : BST_UNCHECKED);
+
+ SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingBgColor);
+ SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingFgColor);
+ if (!settingSetColours) {
+ HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
+ CheckDlgButton(hwndDlg, IDC_SETCOLOURS, BST_UNCHECKED);
+ EnableWindow(hwnd, FALSE);
+ hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
+ EnableWindow(hwnd, FALSE);
+ }
+ SendDlgItemMessage(hwndDlg, ID_ADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON6), IMAGE_ICON, 16, 16, 0));
+ SendDlgItemMessage(hwndDlg, ID_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, 0));
+ SendDlgItemMessage(hwndDlg, ID_DOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON4), IMAGE_ICON, 16, 16, 0));
+ SendDlgItemMessage(hwndDlg, ID_UP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON5), IMAGE_ICON, 16, 16, 0));
+ // initialise and fill listbox
+ hwndList = GetDlgItem(hwndDlg, IDC_STATUS);
+ ListView_DeleteAllItems(hwndList);
+ SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
+ // Initialize the LVCOLUMN structure.
+ // The mask specifies that the format, width, text, and
+ // subitem members of the structure are valid.
+ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ lvc.fmt = LVCFMT_LEFT;
+ lvc.iSubItem = 0;
+ lvc.pszText = TranslateT("Status");
+ lvc.cx = 120; // width of column in pixels
+ ListView_InsertColumn(hwndList, 0, &lvc);
+ // Some code to create the list-view control.
+ // Initialize LVITEM members that are common to all
+ // items.
+ lvI.mask = LVIF_TEXT;
+ for (int i = 0; i < STATUS_COUNT; i++) {
+ lvI.pszText = pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE + i, 0);
+ lvI.iItem = i;
+ ListView_InsertItem(hwndList, &lvI);
+ ListView_SetCheckState(hwndList, i, settingStatus[i]);
+ }
- connExceptionsTmp = LoadSettingsConnections();
- hwndList = GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS);
- SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
-
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- lvc.fmt = LVCFMT_LEFT;
- lvc.iSubItem = 0;
- lvc.cx = 120; // width of column in pixels
- lvc.pszText = TranslateT("Application");
- ListView_InsertColumn(hwndList, 1, &lvc);
- lvc.pszText = TranslateT("Internal socket");
- ListView_InsertColumn(hwndList, 2, &lvc);
- lvc.pszText = TranslateT("External socket");
- ListView_InsertColumn(hwndList, 3, &lvc);
- lvc.pszText = TranslateT("Action");
- lvc.cx = 50;
- ListView_InsertColumn(hwndList, 4, &lvc);
-
- //fill exceptions list
- fillExceptionsListView(hwndDlg);
- }
- break;
+ connExceptionsTmp = LoadSettingsConnections();
+ hwndList = GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS);
+ SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
+
+ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ lvc.fmt = LVCFMT_LEFT;
+ lvc.iSubItem = 0;
+ lvc.cx = 120; // width of column in pixels
+ lvc.pszText = TranslateT("Application");
+ ListView_InsertColumn(hwndList, 1, &lvc);
+ lvc.pszText = TranslateT("Internal socket");
+ ListView_InsertColumn(hwndList, 2, &lvc);
+ lvc.pszText = TranslateT("External socket");
+ ListView_InsertColumn(hwndList, 3, &lvc);
+ lvc.pszText = TranslateT("Action");
+ lvc.cx = 50;
+ ListView_InsertColumn(hwndList, 4, &lvc);
+
+ //fill exceptions list
+ fillExceptionsListView(hwndDlg);
+ }
+ break;
case WM_COMMAND://user changed something, so get changes to variables
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -385,129 +379,122 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_RESOLVEIP: settingResolveIp = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESOLVEIP); break;
case ID_CHK_DEFAULTACTION: settingDefaultAction = (BYTE)IsDlgButtonChecked(hwndDlg, ID_CHK_DEFAULTACTION); break;
case ID_ADD:
- {
- struct CONNECTION *cur = (struct CONNECTION *)mir_alloc(sizeof(struct CONNECTION));
- memset(cur, 0, sizeof(struct CONNECTION));
- cur->intExtPort = -1;
- cur->intIntPort = -1;
- cur->Pid = 0;
- cur->PName[0] = '*';
- cur->strExtIp[0] = '*';
- cur->strIntIp[0] = '*';
-
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur) == IDCANCEL) {
- mir_free(cur);
- cur = NULL;
- }
- else {
- cur->next = connExceptionsTmp;
- connExceptionsTmp = cur;
- }
+ {
+ struct CONNECTION *cur = (struct CONNECTION *)mir_alloc(sizeof(struct CONNECTION));
+ memset(cur, 0, sizeof(struct CONNECTION));
+ cur->intExtPort = -1;
+ cur->intIntPort = -1;
+ cur->Pid = 0;
+ cur->PName[0] = '*';
+ cur->strExtIp[0] = '*';
+ cur->strIntIp[0] = '*';
+
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur) == IDCANCEL) {
+ mir_free(cur);
+ cur = NULL;
+ }
+ else {
+ cur->next = connExceptionsTmp;
+ connExceptionsTmp = cur;
+ }
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), 0, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- }
- break;
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), 0, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ }
+ break;
case ID_DELETE:
- {
- int pos, pos1;
- struct CONNECTION *cur = connExceptionsTmp, *pre = NULL;
-
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
{
- pre = cur;
- cur = cur->next;
+ int pos, pos1;
+ struct CONNECTION *cur = connExceptionsTmp, *pre = NULL;
+
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ pre = cur;
+ cur = cur->next;
+ }
+ if (pre == NULL)
+ connExceptionsTmp = connExceptionsTmp->next;
+ else
+ (pre)->next = cur->next;
+ mir_free(cur);
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- if (pre == NULL)
- connExceptionsTmp = connExceptionsTmp->next;
- else
- (pre)->next = cur->next;
- mir_free(cur);
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
case ID_UP:
- {
- int pos, pos1;
- struct CONNECTION *cur = NULL, *pre = NULL, *prepre = NULL;
+ {
+ int pos, pos1;
+ struct CONNECTION *cur = NULL, *pre = NULL, *prepre = NULL;
- cur = connExceptionsTmp;
+ cur = connExceptionsTmp;
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
- {
- prepre = pre;
- pre = cur;
- cur = cur->next;
- }
- if (prepre != NULL)
- {
- pre->next = cur->next;
- cur->next = pre;
- prepre->next = cur;
- }
- else if (pre != NULL)
- {
- pre->next = cur->next;
- cur->next = pre;
- connExceptionsTmp = cur;
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ prepre = pre;
+ pre = cur;
+ cur = cur->next;
+ }
+ if (prepre != NULL) {
+ pre->next = cur->next;
+ cur->next = pre;
+ prepre->next = cur;
+ }
+ else if (pre != NULL) {
+ pre->next = cur->next;
+ cur->next = pre;
+ connExceptionsTmp = cur;
+ }
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 - 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 - 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
case ID_DOWN:
- {
- int pos, pos1;
- struct CONNECTION *cur = NULL, *pre = NULL;
+ {
+ int pos, pos1;
+ struct CONNECTION *cur = NULL, *pre = NULL;
- cur = connExceptionsTmp;
+ cur = connExceptionsTmp;
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
- {
- pre = cur;
- cur = cur->next;
- }
- if (cur == connExceptionsTmp&&cur->next != NULL)
- {
- connExceptionsTmp = cur->next;
- cur->next = cur->next->next;
- connExceptionsTmp->next = cur;
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ pre = cur;
+ cur = cur->next;
+ }
+ if (cur == connExceptionsTmp&&cur->next != NULL) {
+ connExceptionsTmp = cur->next;
+ cur->next = cur->next->next;
+ connExceptionsTmp->next = cur;
+ }
+ else if (cur->next != NULL) {
+ struct CONNECTION *tmp = cur->next->next;
+ pre->next = cur->next;
+ cur->next->next = cur;
+ cur->next = tmp;
+ }
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 + 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- else if (cur->next != NULL)
+ case IDC_SETCOLOURS:
{
- struct CONNECTION *tmp = cur->next->next;
- pre->next = cur->next;
- cur->next->next = cur;
- cur->next = tmp;
+ HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
+ settingSetColours = IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS);
+ EnableWindow(hwnd, settingSetColours);
+ hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
+ EnableWindow(hwnd, settingSetColours);
+ break;
}
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 + 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
- case IDC_SETCOLOURS:
- {
- HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
- settingSetColours = IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS);
- EnableWindow(hwnd, settingSetColours);
- hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
- EnableWindow(hwnd, settingSetColours);
- break;
- }
case IDC_BGCOLOR: settingBgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0); break;
case IDC_FGCOLOR: settingFgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_GETCOLOUR, 0, 0); break;
@@ -554,25 +541,24 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS) == ((LPNMHDR)lParam)->hwndFrom) {
switch (((LPNMHDR)lParam)->code) {
case NM_DBLCLK:
- {
- int pos, pos1;
- struct CONNECTION *cur = NULL;
+ {
+ int pos, pos1;
+ struct CONNECTION *cur = NULL;
- cur = connExceptionsTmp;
+ cur = connExceptionsTmp;
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
- {
- cur = cur->next;
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ cur = cur->next;
+ }
+ DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur);
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur);
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
}
}
@@ -647,22 +633,19 @@ INT_PTR TMLoadIcon(WPARAM wParam, LPARAM) //=======================================================
INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
{
- if (wParam == ID_STATUS_OFFLINE)
- {
+ if (wParam == ID_STATUS_OFFLINE) {
diffstat = 0;
//PostThreadMessage(ConnectionCheckThreadId,WM_QUIT ,0, 0);
SetEvent(killCheckThreadEvent);
}
- else if (wParam == ID_STATUS_ONLINE)
- {
+ else if (wParam == ID_STATUS_ONLINE) {
diffstat = 0;
ResetEvent(killCheckThreadEvent);
if (!hConnectionCheckThread)
hConnectionCheckThread = (HANDLE)mir_forkthreadex(checkthread, 0, (unsigned int*)&ConnectionCheckThreadId);
}
- else
- {
+ else {
int retv = 0;
if (settingStatus[wParam - ID_STATUS_ONLINE])
@@ -696,17 +679,15 @@ INT_PTR GetStatus(WPARAM, LPARAM) static unsigned __stdcall checkthread(void *)
{
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("check thread started"));
-#endif
- while (1)
- {
+ #endif
+ while (1) {
struct CONNECTION* conn = NULL, *connOld = first, *cur = NULL;
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("checking connections table..."));
-#endif
- if (WAIT_OBJECT_0 == WaitForSingleObject(killCheckThreadEvent, 100))
- {
+ #endif
+ if (WAIT_OBJECT_0 == WaitForSingleObject(killCheckThreadEvent, 100)) {
hConnectionCheckThread = NULL;
return 0;
}
@@ -716,16 +697,14 @@ static unsigned __stdcall checkthread(void *) while (cur != NULL) {
if (searchConnection(first, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state) == NULL && (settingStatusMask & (1 << (cur->state - 1)))) {
-#ifdef _DEBUG
+ #ifdef _DEBUG
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), _T("%s:%d\n%s:%d"), cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
+ mir_sntprintf(msg, _T("%s:%d\n%s:%d"), cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
_OutputDebugString(_T("New connection: %s"), msg);
-#endif
+ #endif
pid2name(cur->Pid, cur->PName, _countof(cur->PName));
- if (WAIT_OBJECT_0 == WaitForSingleObject(hExceptionsMutex, 100))
- {
- if (checkFilter(connExceptions, cur))
- {
+ if (WAIT_OBJECT_0 == WaitForSingleObject(hExceptionsMutex, 100)) {
+ if (checkFilter(connExceptions, cur)) {
showMsg(cur->PName, cur->Pid, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state);
SkinPlaySound(PLUGINNAME_NEWSOUND);
}
@@ -800,11 +779,11 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i if (settingResolveIp) {
TCHAR hostName[128];
getDnsName(extIp, hostName, _countof(hostName));
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), _T("%s:%d\n%s:%d"), hostName, extPort, intIp, intPort);
+ mir_sntprintf(ppd.lptzText, _T("%s:%d\n%s:%d"), hostName, extPort, intIp, intPort);
}
- else mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), _T("%s:%d\n%s:%d"), extIp, extPort, intIp, intPort);
+ else mir_sntprintf(ppd.lptzText, _T("%s:%d\n%s:%d"), extIp, extPort, intIp, intPort);
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), _T("%s (%s)"), pName, tcpStates[state - 1]);
+ mir_sntprintf(ppd.lptzContactName, _T("%s (%s)"), pName, tcpStates[state - 1]);
if (settingSetColours) {
ppd.colorBack = settingBgColor;
@@ -833,9 +812,9 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i static int modulesloaded(WPARAM, LPARAM)
{
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("Modules loaded, lets start TN..."));
-#endif
+ #endif
// hConnectionCheckThread = (HANDLE)mir_forkthreadex(checkthread, 0, 0, ConnectionCheckThreadId);
//#ifdef _DEBUG
@@ -868,9 +847,9 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) extern "C" int __declspec(dllexport) Load(void)
{
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("Entering Load dll"));
-#endif
+ #endif
mir_getLP(&pluginInfo);
mir_getCLI();
@@ -919,9 +898,8 @@ extern "C" int __declspec(dllexport) Unload(void) //if (hCurrentEditMutex) CloseHandle(hCurrentEditMutex);
if (hExceptionsMutex) CloseHandle(hExceptionsMutex);
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("Unloaded"));
-#endif
+ #endif
return 0;
}
-
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp index 892da06cf3..3b49eebe41 100644 --- a/plugins/ConnectionNotify/src/debug.cpp +++ b/plugins/ConnectionNotify/src/debug.cpp @@ -27,7 +27,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) case 's':
{
TCHAR* s = va_arg(argptr, TCHAR *);
- mir_sntprintf(OutMsg, _countof(OutMsg), format, s);
+ mir_sntprintf(OutMsg, format, s);
_tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
@@ -37,7 +37,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) case 'c':
{
char c = (char)va_arg(argptr, int);
- mir_sntprintf(OutMsg, _countof(OutMsg), format, c);
+ mir_sntprintf(OutMsg, format, c);
_tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
@@ -47,7 +47,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) case 'd':
{
int d = va_arg(argptr, int);
- mir_sntprintf(OutMsg, _countof(OutMsg), format, d);
+ mir_sntprintf(OutMsg, format, d);
_tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 59237178d6..e050008784 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -621,7 +621,7 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)path);
- mir_sntprintf(title, _countof(title), _T("%s - %s\\%s"), TranslateT("Miranda Console"), path, name);
+ mir_sntprintf(title, _T("%s - %s\\%s"), TranslateT("Miranda Console"), path, name);
SetWindowText(hwndDlg, title);
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcons[0]);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 74a3ff2672..03a2750243 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -74,7 +74,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) {
//add event to the contact list
TCHAR caToolTip[128];
- mir_sntprintf(caToolTip, _countof(caToolTip), _T("%s %s"), TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(caToolTip, _T("%s %s"), TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 1247b24e45..9a5750f90a 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -130,7 +130,7 @@ void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart) SetDlgItemText(hwndDlg, IDC_NAME, uid ? uid : contactName);
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- mir_sntprintf(newtitle, _countof(newtitle), _T("%s %s (%s)"), TranslateTS(pszTitleStart), contactName, szStatus);
+ mir_sntprintf(newtitle, _T("%s %s (%s)"), TranslateTS(pszTitleStart), contactName, szStatus);
}
}
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 491d413742..82adffe7ef 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -55,7 +55,7 @@ static void CALLBACK SetExtraImage(MCONTACT hContact) ExtraIcon_Clear(hExtraIcon, hContact);
else {
char szId[20];
- mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber);
+ mir_snprintf(szId, (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber);
ExtraIcon_SetIconByName(hExtraIcon, hContact, szId);
}
}
diff --git a/plugins/CountryFlags/src/icons.cpp b/plugins/CountryFlags/src/icons.cpp index c11f0b4b9d..966af46b11 100644 --- a/plugins/CountryFlags/src/icons.cpp +++ b/plugins/CountryFlags/src/icons.cpp @@ -146,7 +146,7 @@ HICON __fastcall LoadFlagIcon(int countryNumber) szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, countryNumber = 0xFFFF, 0);
char szId[20];
- mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); /* buffer safe */
+ mir_snprintf(szId, (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); /* buffer safe */
return IcoLib_GetIcon(szId);
}
@@ -244,7 +244,7 @@ void InitIcons(void) sid.description.a = (char*)countries[i].szName;
/* create identifier */
- mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */
+ mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
/* create icon */
HICON hIcon = ImageList_GetIcon(himl,index,ILD_NORMAL);
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index 49dcc881b6..d39f6beecd 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -246,7 +246,7 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut) }
/* not in list */
if (i == nCountriesCount) {
- mir_snprintf(out, _countof(out), "Unknown: %s-%s [%s, %s]\n", pszFrom, pszTo, pszTwo, pszCountry);
+ mir_snprintf(out, "Unknown: %s-%s [%s, %s]\n", pszFrom, pszTo, pszTwo, pszCountry);
OutputDebugStringA(out); /* all ascii */
}
}
diff --git a/plugins/CountryFlags/src/utils.cpp b/plugins/CountryFlags/src/utils.cpp index 958a99fb25..082f8f256e 100644 --- a/plugins/CountryFlags/src/utils.cpp +++ b/plugins/CountryFlags/src/utils.cpp @@ -21,7 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /************************* Buffered Functions *********************/
-struct BufferedCallData {
+struct BufferedCallData
+{
DWORD startTick;
UINT uElapse;
BUFFEREDPROC pfnBuffProc;
@@ -36,10 +37,10 @@ static struct BufferedCallData *callList; static int nCallListCount;
// always gets called in main message loop
-static void CALLBACK BufferedProcTimer(HWND hwnd,UINT,UINT_PTR idTimer,DWORD currentTick)
+static void CALLBACK BufferedProcTimer(HWND hwnd, UINT, UINT_PTR idTimer, DWORD currentTick)
{
struct BufferedCallData *buf;
- UINT uElapsed,uElapseNext=USER_TIMER_MAXIMUM;
+ UINT uElapsed, uElapseNext = USER_TIMER_MAXIMUM;
BUFFEREDPROC pfnBuffProc;
LPARAM lParam;
#ifdef _DEBUG
@@ -47,114 +48,117 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT,UINT_PTR idTimer,DWORD cur const char *pszProcName;
#endif
- for(int i=0; i < nCallListCount; ++i) {
+ for (int i = 0; i < nCallListCount; ++i) {
/* find elapsed procs */
- uElapsed=currentTick-callList[i].startTick; /* wraparound works */
- if ((uElapsed+USER_TIMER_MINIMUM)>=callList[i].uElapse) {
+ uElapsed = currentTick - callList[i].startTick; /* wraparound works */
+ if ((uElapsed + USER_TIMER_MINIMUM) >= callList[i].uElapse) {
/* call elapsed proc */
- pfnBuffProc=callList[i].pfnBuffProc;
- lParam=callList[i].lParam;
+ pfnBuffProc = callList[i].pfnBuffProc;
+ lParam = callList[i].lParam;
#ifdef _DEBUG
- pszProcName=callList[i].pszProcName;
+ pszProcName = callList[i].pszProcName;
#endif
/* resize storage array */
- if ((i+1)<nCallListCount)
- memmove(&callList[i],&callList[i+1],((nCallListCount-i-1)*sizeof(struct BufferedCallData)));
+ if ((i + 1) < nCallListCount)
+ memmove(&callList[i], &callList[i + 1], ((nCallListCount - i - 1)*sizeof(struct BufferedCallData)));
--nCallListCount;
--i; /* reiterate current */
if (nCallListCount) {
- buf=(struct BufferedCallData*)mir_realloc(callList,nCallListCount*sizeof(struct BufferedCallData));
- if (buf != NULL) callList=buf;
- } else {
+ buf = (struct BufferedCallData*)mir_realloc(callList, nCallListCount*sizeof(struct BufferedCallData));
+ if (buf != NULL) callList = buf;
+ }
+ else {
mir_free(callList);
- callList=NULL;
+ callList = NULL;
}
#ifdef _DEBUG
- mir_snprintf(szDbgLine,_countof(szDbgLine),"buffered call: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
- OutputDebugStringA(szDbgLine);
+ mir_snprintf(szDbgLine, "buffered call: %s(0x%X)\n", pszProcName, lParam); /* all ascii */
+ OutputDebugStringA(szDbgLine);
#endif
- CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc,(void*)lParam); /* compatible */
+ CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc, (void*)lParam); /* compatible */
}
/* find next timer delay */
- else if ((callList[i].uElapse-uElapsed)<uElapseNext)
- uElapseNext=callList[i].uElapse-uElapsed;
+ else if ((callList[i].uElapse - uElapsed) < uElapseNext)
+ uElapseNext = callList[i].uElapse - uElapsed;
}
/* set next timer */
if (nCallListCount) {
#ifdef _DEBUG
- mir_snprintf(szDbgLine,_countof(szDbgLine),"next buffered timeout: %ums\n",uElapseNext); /* all ascii */
- OutputDebugStringA(szDbgLine);
+ mir_snprintf(szDbgLine, "next buffered timeout: %ums\n", uElapseNext); /* all ascii */
+ OutputDebugStringA(szDbgLine);
#endif
- idBufferedTimer=SetTimer(hwnd,idBufferedTimer,uElapseNext,BufferedProcTimer); /* will be reset */
- } else {
- KillTimer(hwnd,idTimer);
- idBufferedTimer=0;
+ idBufferedTimer = SetTimer(hwnd, idBufferedTimer, uElapseNext, BufferedProcTimer); /* will be reset */
+ }
+ else {
+ KillTimer(hwnd, idTimer);
+ idBufferedTimer = 0;
#ifdef _DEBUG
- OutputDebugStringA("empty buffered queue\n");
+ OutputDebugStringA("empty buffered queue\n");
#endif
}
}
// assumes to be called in context of main thread
#ifdef _DEBUG
-void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,const char *pszProcName,LPARAM lParam,BOOL fAccumulateSameParam,UINT uElapse)
+void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc, const char *pszProcName, LPARAM lParam, BOOL fAccumulateSameParam, UINT uElapse)
#else
-void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumulateSameParam,UINT uElapse)
+void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc, LPARAM lParam, BOOL fAccumulateSameParam, UINT uElapse)
#endif
{
- struct BufferedCallData *data=NULL;
+ struct BufferedCallData *data = NULL;
int i;
/* find existing */
- for(i=0;i<nCallListCount;++i)
+ for (i = 0; i < nCallListCount; ++i)
if (callList[i].pfnBuffProc == pfnBuffProc)
if (!fAccumulateSameParam || callList[i].lParam == lParam) {
- data=&callList[i];
+ data = &callList[i];
break;
}
/* append new */
if (data == NULL) {
/* resize storage array */
- data=(struct BufferedCallData*)mir_realloc(callList,(nCallListCount+1)*sizeof(struct BufferedCallData));
+ data = (struct BufferedCallData*)mir_realloc(callList, (nCallListCount + 1)*sizeof(struct BufferedCallData));
if (data == NULL) return;
- callList=data;
- data=&callList[nCallListCount];
+ callList = data;
+ data = &callList[nCallListCount];
++nCallListCount;
}
/* set delay */
- data->startTick=GetTickCount();
- data->uElapse=uElapse;
- data->lParam=lParam;
- data->pfnBuffProc=pfnBuffProc;
+ data->startTick = GetTickCount();
+ data->uElapse = uElapse;
+ data->lParam = lParam;
+ data->pfnBuffProc = pfnBuffProc;
#ifdef _DEBUG
- { char szDbgLine[256];
- data->pszProcName=pszProcName;
- mir_snprintf(szDbgLine,_countof(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
+ {
+ char szDbgLine[256];
+ data->pszProcName = pszProcName;
+ mir_snprintf(szDbgLine, "buffered queue: %s(0x%X)\n", pszProcName, lParam); /* all ascii */
+ OutputDebugStringA(szDbgLine);
+ if (!idBufferedTimer) {
+ mir_snprintf(szDbgLine, "next buffered timeout: %ums\n", uElapse); /* all ascii */
OutputDebugStringA(szDbgLine);
- if (!idBufferedTimer) {
- mir_snprintf(szDbgLine,_countof(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */
- OutputDebugStringA(szDbgLine);
- }
}
+ }
#endif
/* set next timer */
- if (idBufferedTimer) uElapse=USER_TIMER_MINIMUM; /* will get recalculated */
- idBufferedTimer=SetTimer(NULL,idBufferedTimer,uElapse,BufferedProcTimer);
+ if (idBufferedTimer) uElapse = USER_TIMER_MINIMUM; /* will get recalculated */
+ idBufferedTimer = SetTimer(NULL, idBufferedTimer, uElapse, BufferedProcTimer);
}
// assumes to be called in context of main thread
void PrepareBufferedFunctions(void)
{
- idBufferedTimer=0;
- nCallListCount=0;
- callList=NULL;
+ idBufferedTimer = 0;
+ nCallListCount = 0;
+ callList = NULL;
}
// assumes to be called in context of main thread
void KillBufferedFunctions(void)
{
- if (idBufferedTimer) KillTimer(NULL,idBufferedTimer);
- nCallListCount=0;
+ if (idBufferedTimer) KillTimer(NULL, idBufferedTimer);
+ nCallListCount = 0;
mir_free(callList); /* does NULL check */
}
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index df5d273ae1..e49c42d7f3 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -68,7 +68,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam) CreateDirectoryTree(VersionInfoFolder);
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDumpFile != INVALID_HANDLE_VALUE) {
@@ -159,7 +159,7 @@ INT_PTR CopyLinkToClipboard(WPARAM, LPARAM) ptrT tmp(db_get_wsa(NULL, PluginName, "Username"));
if (tmp != NULL) {
TCHAR buffer[MAX_PATH];
- mir_sntprintf(buffer, _countof(buffer), _T("http://vi.miranda-ng.org/detail/%s"), tmp);
+ mir_sntprintf(buffer, _T("http://vi.miranda-ng.org/detail/%s"), tmp);
int bufLen = (sizeof(buffer) + 1) * sizeof(TCHAR);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
@@ -359,7 +359,7 @@ extern "C" int __declspec(dllexport) Load(void) profname = Utils_ReplaceVarsT(_T("%miranda_profilename%.dat"));
profpath = Utils_ReplaceVarsT(_T("%miranda_userdata%"));
if (catchcrashes && !needrestart)
- mir_sntprintf(CrashLogFolder, _countof(CrashLogFolder), TEXT("%s\\CrashLog"), profpath);
+ mir_sntprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
_tcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index e35f535d7f..21a98c3e62 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -477,7 +477,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime);
TCHAR profpn[MAX_PATH];
- mir_sntprintf(profpn, _countof(profpn), TEXT("%s\\%s"), profpathfull, profname);
+ mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
buffer.AppendFormat(TEXT("Profile: %s\r\n"), profpn);
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index 91535bb12e..fcd25a8a0d 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -55,13 +55,13 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) __try {
if (dtsubfldr) {
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, _countof(path), TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -82,18 +82,18 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) __try {
if (dtsubfldr) {
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, _countof(path), TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
- mir_sntprintf(path, _countof(path), TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
+ mir_sntprintf(path, TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
if (hDumpFile != INVALID_HANDLE_VALUE)
CreateCrashReport(hDumpFile, exc_ptr, notify ? path : NULL);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 26989f5ad8..41cc0f34fb 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -282,7 +282,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case 3:
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
break;
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index 8f7899db24..dae48644ac 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -87,7 +87,7 @@ void __cdecl dbpanic(void *) msg = TranslateT("Disk is full. Miranda will now shut down.");
TCHAR err[256];
- mir_sntprintf(err, _countof(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
+ mir_sntprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
@@ -128,13 +128,13 @@ char* printVariant(DBVARIANT* p) static char boo[1000];
switch (p->type) {
- case DBVT_BYTE: mir_snprintf(boo, _countof(boo), "byte: %d", p->bVal ); break;
- case DBVT_WORD: mir_snprintf(boo, _countof(boo), "word: %d", p->wVal ); break;
- case DBVT_DWORD: mir_snprintf(boo, _countof(boo), "dword: %d", p->dVal ); break;
+ case DBVT_BYTE: mir_snprintf(boo, "byte: %d", p->bVal ); break;
+ case DBVT_WORD: mir_snprintf(boo, "word: %d", p->wVal ); break;
+ case DBVT_DWORD: mir_snprintf(boo, "dword: %d", p->dVal ); break;
case DBVT_UTF8:
- case DBVT_ASCIIZ: mir_snprintf(boo, _countof(boo), "string: '%s'", p->pszVal); break;
+ case DBVT_ASCIIZ: mir_snprintf(boo, "string: '%s'", p->pszVal); break;
case DBVT_DELETED: mir_strcpy(boo, "deleted"); break;
- default: mir_snprintf(boo, _countof(boo), "crap: %d", p->type ); break;
+ default: mir_snprintf(boo, "crap: %d", p->type ); break;
}
return boo;
}
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp index b3167fcdad..3b597e387a 100644 --- a/plugins/DbChecker/src/selectdb.cpp +++ b/plugins/DbChecker/src/selectdb.cpp @@ -36,7 +36,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) if (opts.dbChecker == NULL) {
DATABASELINK* dblink = FindDatabasePlugin(opts.filename);
if (dblink == NULL) {
- mir_sntprintf(tszMsg, _countof(tszMsg),
+ mir_sntprintf(tszMsg,
TranslateT("Database Checker cannot find a suitable database plugin to open '%s'."),
opts.filename);
LBL_Error:
@@ -45,7 +45,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) }
if (dblink->CheckDB == NULL) {
- mir_sntprintf(tszMsg, _countof(tszMsg),
+ mir_sntprintf(tszMsg,
TranslateT("Database driver '%s' doesn't support checking."),
TranslateTS(dblink->szFullName));
goto LBL_Error;
@@ -129,7 +129,7 @@ static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir) int iNewItem = ListView_InsertItem(hwndList, &lvi);
TCHAR szSize[20];
- mir_sntprintf(szSize, _countof(szSize), _T("%.2lf MB"), totalSize / 1048576.0);
+ mir_sntprintf(szSize, _T("%.2lf MB"), totalSize / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 1, szSize);
return iNewItem;
}
@@ -149,7 +149,7 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix) if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T("..")))
continue;
- mir_sntprintf(szFilename, _countof(szFilename), _T("%s\\%s\\%s.dat"), szProfileDir, fd.cFileName, fd.cFileName);
+ mir_sntprintf(szFilename, _T("%s\\%s\\%s.dat"), szProfileDir, fd.cFileName, fd.cFileName);
if (_taccess(szFilename, 0) == 0)
AddDatabaseToList(GetDlgItem(hdlg, IDC_DBLIST), szFilename, szPrefix);
} while (FindNextFile(hFind, &fd));
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp index c89063058b..674088d9f5 100644 --- a/plugins/DbChecker/src/worker.cpp +++ b/plugins/DbChecker/src/worker.cpp @@ -54,9 +54,9 @@ static void Finalize(time_t& ts) }
for (int i = 1;; i++) {
if (i == 1)
- mir_sntprintf(opts.backupFilename, _countof(opts.backupFilename), TranslateT("%s\\Backup of %s"), dbPath, dbFile);
+ mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup of %s"), dbPath, dbFile);
else
- mir_sntprintf(opts.backupFilename, _countof(opts.backupFilename), TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
+ mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
if (_taccess(opts.backupFilename, 0) == -1) break;
}
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 5f118fd7a6..18790a530c 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -119,7 +119,7 @@ char* NickFromHContact(MCONTACT hContact) if (!loaded) {
if (szProto[0])
- mir_snprintf(nick, _countof(nick), "%s (%s)", name, szProto);
+ mir_snprintf(nick, "%s (%s)", name, szProto);
else
mir_strncpy(nick, name, _countof(nick));
}
@@ -128,9 +128,9 @@ char* NickFromHContact(MCONTACT hContact) if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
char szUID[FLD_SIZE];
GetValueA(hContact, szProto, uid, szUID, _countof(szUID));
- mir_snprintf(nick, _countof(nick), "%s *(%s)*<%s>*{%s}*", name, szProto, uid, szUID);
+ mir_snprintf(nick, "%s *(%s)*<%s>*{%s}*", name, szProto, uid, szUID);
}
- else mir_snprintf(nick, _countof(nick), "%s (%s)", name, szProto);
+ else mir_snprintf(nick, "%s (%s)", name, szProto);
}
}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 8f6b19d14c..7f3ea9f087 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -225,7 +225,7 @@ char *StringFromBlob(BYTE *blob, WORD len) data[0] = 0;
for (j = 0; j < len; j++) {
- mir_snprintf(tmp, _countof(tmp), "%02X ", blob[j]);
+ mir_snprintf(tmp, "%02X ", blob[j]);
mir_strcat(data, tmp);
}
return data;
@@ -542,7 +542,7 @@ void saveListSettings(HWND hwnd, ColumnsSettings *cs) int i = 0;
while (cs[i].name) {
if (ListView_GetColumn(hwnd, cs[i].index, &sLC)) {
- mir_snprintf(tmp, _countof(tmp), cs[i].dbname, i);
+ mir_snprintf(tmp, cs[i].dbname, i);
db_set_w(NULL, modname, tmp, (WORD)sLC.cx);
}
i++;
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index db914d4a83..3a9a39b7e4 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -181,7 +181,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) if (options.num_backups == 0)
return 0; /* Roration disabled. */
- mir_sntprintf(backupfolderTmp, _countof(backupfolderTmp), _T("%s\\%s*"), backupfolder, dbname);
+ mir_sntprintf(backupfolderTmp, _T("%s\\%s*"), backupfolder, dbname);
hFind = FindFirstFile(backupfolderTmp, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
return 0;
@@ -201,7 +201,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) if (i > 0)
qsort(bf, i, sizeof(backupFile), Comp); /* Sort the list of found files by date in descending order. */
for (; i >= options.num_backups; i --) {
- mir_sntprintf(backupfolderTmp, _countof(backupfolderTmp), _T("%s\\%s"), backupfolder, bf[(i - 1)].Name);
+ mir_sntprintf(backupfolderTmp, _T("%s\\%s"), backupfolder, bf[(i - 1)].Name);
DeleteFile(backupfolderTmp);
}
err_out:
@@ -237,7 +237,7 @@ int Backup(TCHAR *backup_filename) GetLocalTime(&st);
GetComputerName(buffer, &size);
- mir_sntprintf(dest_file, _countof(dest_file), _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? _T("zip") : _T("dat"));
+ mir_sntprintf(dest_file, _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? _T("zip") : _T("dat"));
mir_free(backupfolder);
}
else {
@@ -253,7 +253,7 @@ int Backup(TCHAR *backup_filename) SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
- mir_sntprintf(source_file, _countof(source_file), _T("%s\\%s"), profilePath, dbname);
+ mir_sntprintf(source_file, _T("%s\\%s"), profilePath, dbname);
TCHAR *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 4f143fedb9..5579e9daf4 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -37,7 +37,7 @@ static INT_PTR DBSaveAs(WPARAM, LPARAM) OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
- mir_sntprintf(tszFilter, _countof(tszFilter), _T("%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c"),
+ mir_sntprintf(tszFilter, _T("%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c"),
TranslateT("Miranda NG databases"), 0, 0,
TranslateT("Compressed Miranda NG databases"), 0, 0,
TranslateT("All files"), 0, 0);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index a9fe7d9abf..59e5ca5306 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -48,13 +48,12 @@ int LoadOptions(void) 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);
+ mir_sntprintf(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);
+ else mir_sntprintf(options.folder, _T("%s%s"), DIR, SUB_DIR);
}
options.num_backups = db_get_w(0, "AutoBackups", "NumBackups", 3);
@@ -76,7 +75,7 @@ int SaveOptions(void) db_set_w(0, "AutoBackups", "Period", (WORD)options.period);
db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
- mir_sntprintf(prof_dir, _countof(prof_dir), _T("%s\\"), profilePath);
+ mir_sntprintf(prof_dir, _T("%s\\"), profilePath);
size_t prof_len = mir_tstrlen(prof_dir);
size_t opt_len = mir_tstrlen(options.folder);
@@ -89,7 +88,7 @@ int SaveOptions(void) TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
_tcsncpy_s(prof_dir, options.folder, _TRUNCATE);
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s\\%s"), profilePath, prof_dir);
+ mir_sntprintf(options.folder, _T("%s\\%s"), profilePath, prof_dir);
}
mir_free(tmp);
db_set_w(0, "AutoBackups", "NumBackups", options.num_backups);
@@ -188,7 +187,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else {
TCHAR tszTooltipText[4096];
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTooltipText, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("%miranda_path%"), TranslateT("path to Miranda root folder"),
_T("%miranda_profilesdir%"), TranslateT("path to folder containing Miranda profiles"),
_T("%miranda_profilename%"), TranslateT("name of current Miranda profile (filename, without extension)"),
@@ -346,7 +345,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
- mir_sntprintf(backupfolder, _countof(backupfolder), _T("%s\\%s"), profilePath, tmp);
+ mir_sntprintf(backupfolder, _T("%s\\%s"), profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 3909ea4750..1a35c464f1 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -199,7 +199,7 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) }
char help[1024];
- mir_snprintf(help, _countof(help), Translate("\"%s\" is not valid.\nUse \"/help\" for more info."), szMessage);
+ mir_snprintf(help, Translate("\"%s\" is not valid.\nUse \"/help\" for more info."), szMessage);
CallContactService(GetDefaultContact(), PSR_MESSAGE, 0, (LPARAM)help);
return 0;
}
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index a2669f7abb..a4e80c6c7e 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -279,9 +279,9 @@ int CExchangeServer::Check(int bNoEmailsNotify) if (((count > 0) || ((bNoEmailsNotify) && (count >= 0))) && (count != -1)) {
TCHAR buffer[1024];
if (count != 1)
- mir_sntprintf(buffer, _countof(buffer), TranslateT("You have %d unread emails..."), count);
+ mir_sntprintf(buffer, TranslateT("You have %d unread emails..."), count);
else
- mir_sntprintf(buffer, _countof(buffer), TranslateT("You have one unread email..."));
+ mir_sntprintf(buffer, TranslateT("You have one unread email..."));
ShowMessage(buffer, count);
}
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 6db6412c4a..e6eda61bd5 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -131,7 +131,7 @@ void UploadDialog::Tab::select() void UploadDialog::Tab::labelCompleted()
{
TCHAR buff[64], buff2[256];
- mir_sntprintf(buff2, _countof(buff2), _T("* %s"), Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
+ mir_sntprintf(buff2, _T("* %s"), Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
TCITEM tab = { 0 };
tab.mask = TCIF_TEXT;
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 8eba5013dd..d0e6b988fe 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -110,7 +110,7 @@ void InitMenuItems() for (int i = 0; i < ServerList::FTP_COUNT; i++) {
if (DB::getStringF(0, MODULE, "Name%d", i, stzName))
- mir_sntprintf(stzName, _countof(stzName), TranslateT("FTP Server %d"), i + 1);
+ mir_sntprintf(stzName, TranslateT("FTP Server %d"), i + 1);
mi.flags = CMIF_TCHAR;
mi.root = (opt.bUseSubmenu) ? hMenu : 0;
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index 0c99989da0..f3cab81cd3 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -92,7 +92,7 @@ void GenericJob::getFilesFromOpenDialog() {
TCHAR *ptr = m_tszFilePath + length + 1;
while (ptr[0]) {
- mir_sntprintf(stzFile, _countof(stzFile), _T("%s\\%s"), m_tszFilePath, ptr);
+ mir_sntprintf(stzFile, _T("%s\\%s"), m_tszFilePath, ptr);
addFile(stzFile);
ptr += mir_tstrlen(ptr) + 1;
}
@@ -116,7 +116,7 @@ int GenericJob::getFilesFromFolder(TCHAR *stzFolder) HANDLE hFind = FindFirstFile(_T("*.*"), &ffd);
while (hFind != INVALID_HANDLE_VALUE) {
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- mir_sntprintf(stzFile, _countof(stzFile), _T("%s\\%s"), stzFolder, ffd.cFileName);
+ mir_sntprintf(stzFile, _T("%s\\%s"), stzFolder, ffd.cFileName);
addFile(stzFile);
}
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index f2a2942636..7d98a18fbd 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -58,7 +58,7 @@ void PackerJob::getZipFilePath() GetTempPath(_countof(buff), buff);
- mir_sntprintf(m_tszFilePath, _countof(m_tszFilePath), _T("%s%s.zip"), buff, stzFileName);
+ mir_sntprintf(m_tszFilePath, _T("%s%s.zip"), buff, stzFileName);
mir_tstrcpy(m_tszFileName, Utils::getFileNameFromPath(m_tszFilePath));
if (opt.bSetZipName)
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp index 7610369e11..b5be374920 100644 --- a/plugins/FTPFileYM/src/serverlist.cpp +++ b/plugins/FTPFileYM/src/serverlist.cpp @@ -64,7 +64,7 @@ void ServerList::saveToDb() const ServerList::FTP::FTP(int index)
{
if (DB::getStringF(0, MODULE, "Name%d", index, m_stzName))
- mir_sntprintf(m_stzName, _countof(m_stzName), TranslateT("FTP Server %d"), index + 1);
+ mir_sntprintf(m_stzName, TranslateT("FTP Server %d"), index + 1);
DB::getAStringF(0, MODULE, "Password%d", index, m_szPass);
DB::getAStringF(0, MODULE, "Server%d", index, m_szServer);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 9e881ae705..8864263545 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -243,9 +243,9 @@ void FILEECHO::updateTitle() contactName = (char*)pcli->pfnGetContactDisplayName(hContact, 0);
if (iState == STATE_OPERATE && chunkCount != 0)
- mir_snprintf(newtitle, _countof(newtitle), "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName);
+ mir_snprintf(newtitle, "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName);
else
- mir_snprintf(newtitle, _countof(newtitle), "%s: %s", Translate(szFEMode[inSend]), contactName);
+ mir_snprintf(newtitle, "%s: %s", Translate(szFEMode[inSend]), contactName);
SetWindowText(hDlg, newtitle);
}
@@ -412,9 +412,9 @@ void FILEECHO::sendReq() if (*p == '\\')
mir_strcpy(filename, p + 1);
- mir_snprintf(sendbuf, _countof(sendbuf), Translate("Size: %d bytes"), fileSize);
+ mir_snprintf(sendbuf, Translate("Size: %d bytes"), fileSize);
SetDlgItemText(hDlg, IDC_FILESIZE, sendbuf);
- mir_snprintf(sendbuf, _countof(sendbuf), "?%c%c%d:%d \n" NOPLUGIN_MESSAGE, asBinary + '0', codeSymb, chunkCount, fileSize);
+ mir_snprintf(sendbuf, "?%c%c%d:%d \n" NOPLUGIN_MESSAGE, asBinary + '0', codeSymb, chunkCount, fileSize);
sendCmd(0, CMD_REQ, sendbuf, filename);
SetDlgItemText(hDlg, IDC_STATUS, Translate("Request sent. Awaiting of acceptance.."));
@@ -618,7 +618,7 @@ void FILEECHO::onSendTimer() }
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "%X,%X,%X>", chunkIndx + 1, chunkPos[chunkIndx], chksum);
+ mir_snprintf(prefix, "%X,%X,%X>", chunkIndx + 1, chunkPos[chunkIndx], chksum);
#ifdef DEBUG
overhead += mir_tstrlen((char*)buffer);
#endif
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 3629d57510..575fee086a 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -916,7 +916,7 @@ extern "C" int __declspec(dllexport) Load() COLORREF defColor = GetSysColor((i == FLT_FONTID_NOTONLIST) ? COLOR_3DSHADOW : COLOR_WINDOWTEXT);
char szId[20];
- mir_snprintf(szId, _countof(szId), "Font%d", i);
+ mir_snprintf(szId, "Font%d", i);
FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
}
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index 7ab90df3b8..255e2b11e9 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -199,7 +199,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETRANGE, TRUE, MAKELONG(0, 100));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETPOS, TRUE, btOpacity);
- mir_snprintf(szPercent, _countof(szPercent), "%d%%", btOpacity);
+ mir_snprintf(szPercent, "%d%%", btOpacity);
SetDlgItemTextA(hwndDlg, IDC_OPACITY, szPercent);
EnableWindow(GetDlgItem(hwndDlg, IDC_SLIDER_OPACITY), SetLayeredWindowAttributes != 0);
@@ -230,7 +230,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP fcOpt.thumbAlpha = (BYTE)((nPos * 255) / 100);
SetThumbsOpacity(fcOpt.thumbAlpha);
- mir_snprintf(szPercent, _countof(szPercent), "%d%%", nPos);
+ mir_snprintf(szPercent, "%d%%", nPos);
SetDlgItemTextA(hwndDlg, IDC_OPACITY, szPercent);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index 32835dc6cc..d0c5c3284a 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -123,7 +123,7 @@ static INT_PTR CALLBACK DlgProcVariables(HWND hWnd, UINT msg, WPARAM wParam, LPA switch (msg) {
case WM_INITDIALOG:
- mir_sntprintf(tszMessage, _countof(tszMessage), _T("%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s"),
+ mir_sntprintf(tszMessage, _T("%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s"),
TranslateT("Don't forget to click on Apply to save the changes. If you don't then the changes won't"),
TranslateT("be saved to the database, they will only be valid for this session."),
TranslateT("Variable string"),
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index ffe0b9665d..e36cadc554 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -87,7 +87,7 @@ int InitServices() pos = _tcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
TCHAR *szTemp = Utils_ReplaceVarsT(_T("%miranda_userdata%"));
- mir_sntprintf(szUserDataPath, _countof(szUserDataPath), szTemp);
+ mir_sntprintf(szUserDataPath, szTemp);
mir_free(szTemp);
CreateServiceFunction(MS_FOLDERS_GET_PATH, GetPathService);
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 176e0894cf..065d6c1b25 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -434,7 +434,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) { ofn.lStructSize = sizeof(OPENFILENAME);
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.*)%c*.*%c%c"), Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.*)%c*.*%c%c"), Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = pstNewShare->pszRealPath;
@@ -1208,7 +1208,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetDlgItemText(hwndDlg, IDC_PAGE_KEYWORD, szKeyWord, _countof(szKeyWord));
DWORD dwExternalIP = GetExternIP(szUrl, szKeyWord);
- mir_snprintf(szKeyWord, _countof(szKeyWord), Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
+ mir_snprintf(szKeyWord, Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
SplitIpAddress(dwExternalIP) ,
szUrl);
MessageBox(hwndDlg, szKeyWord, MSG_BOX_TITEL, MB_OK);
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index a4e2597fd7..b31694142a 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -231,7 +231,7 @@ void CLHttpUser::SendError(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuf[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf),
+ DWORD dwBytesToWrite = mir_snprintf(szBuf,
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -281,7 +281,7 @@ void CLHttpUser::SendRedir(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuff[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuff, _countof(szBuff),
+ DWORD dwBytesToWrite = mir_snprintf(szBuff,
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -546,7 +546,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { char szETag[ 50 ];
{
- int nETagLen = mir_snprintf(szETag, _countof(szETag), "\"%x-%x-%x\"",
+ int nETagLen = mir_snprintf(szETag, "\"%x-%x-%x\"",
nDataSize, stFileTime.dwHighDateTime, stFileTime.dwLowDateTime);
if (!apszParam[eIfRange] || (strncmp(szETag, apszParam[eIfRange], nETagLen) == 0)) {
@@ -616,7 +616,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf), szHttpPartial,
+ dwBytesToWrite = mir_snprintf(szBuf, szHttpPartial,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
@@ -638,7 +638,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf), szHttpOk,
+ dwBytesToWrite = mir_snprintf(szBuf, szHttpOk,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
diff --git a/plugins/HTTPServer/src/IndexHTML.cpp b/plugins/HTTPServer/src/IndexHTML.cpp index 04a991cb4e..6bf65357ac 100644 --- a/plugins/HTTPServer/src/IndexHTML.cpp +++ b/plugins/HTTPServer/src/IndexHTML.cpp @@ -62,7 +62,7 @@ bool LoadIndexHTMLTemplate() { char szDestBuf[10000];
char* pszDestBuf = szDestBuf;
- mir_snprintf(szBuf, _countof(szBuf), "%s%s", szPluginPath, szIndexHTMLTemplateFile);
+ mir_snprintf(szBuf, "%s%s", szPluginPath, szIndexHTMLTemplateFile);
HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -282,7 +282,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, // check if directory exists
char szMask[MAX_PATH];
- mir_snprintf(szMask, _countof(szMask), "%s*", pszRealPath);
+ mir_snprintf(szMask, "%s*", pszRealPath);
WIN32_FIND_DATAA fdFindFileData;
HANDLE hFind = FindFirstFile(szMask, &fdFindFileData);
diff --git a/plugins/HTTPServer/src/IndexXML.cpp b/plugins/HTTPServer/src/IndexXML.cpp index b6b79bab1d..6e25cfce28 100644 --- a/plugins/HTTPServer/src/IndexXML.cpp +++ b/plugins/HTTPServer/src/IndexXML.cpp @@ -64,7 +64,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace, bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath, const char * pszSrvPath, DWORD dwRemoteIP)
{
char szMask[MAX_PATH+1];
- mir_snprintf(szMask, _countof(szMask), "%s*", pszRealPath);
+ mir_snprintf(szMask, "%s*", pszRealPath);
WIN32_FIND_DATAA fdFindFileData;
HANDLE hFind = FindFirstFile(szMask, &fdFindFileData);
@@ -100,7 +100,7 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath, const WriteFile(hFile, szXmlHeader1, sizeof(szXmlHeader1) - 1, &dwBytesWritten, NULL);
// check if a index.xsl exists in the same directory otherwise use the global
- mir_snprintf(szMask, _countof(szMask), "%s%s", pszRealPath, "index.xsl");
+ mir_snprintf(szMask, "%s%s", pszRealPath, "index.xsl");
HANDLE hFileExists = CreateFile(szMask, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index d7ff1aa033..5b543738b9 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -350,7 +350,7 @@ bool bWriteConfigurationFile() } else {
CLFileShareNode * pclCur = pclFirstNode;
while (pclCur) {
- DWORD dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf), szXmlData ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, szXmlData ,
pclCur->st.pszSrvPath,
pclCur->pszOrigRealPath,
pclCur->st.nMaxDownloads,
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index f24461eb23..0292052253 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -76,7 +76,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) SetClassLongPtr(hDlg, GCLP_HICON, (LONG_PTR)LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON)));
WindowList_Add(hWindowList, hDlg, DlgParam->hContact);
- mir_sntprintf(title, _countof(title), _T("%s [%s]"), TranslateT("Linklist plugin"), pcli->pfnGetContactDisplayName(DlgParam->hContact, 0));
+ mir_sntprintf(title, _T("%s [%s]"), TranslateT("Linklist plugin"), pcli->pfnGetContactDisplayName(DlgParam->hContact, 0));
SetWindowText(hDlg, title);
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara WriteLinkList(hListDlg, flags, DlgParam->listStart, buffer, 0);
mir_free(buffer);
}
- mir_sntprintf(filter, _countof(filter), _T("%s: %s"), TXT_FILTER, TXT_SEARCHFILTER);
+ mir_sntprintf(filter, _T("%s: %s"), TXT_FILTER, TXT_SEARCHFILTER);
SetDlgItemText(hWndMain, IDC_STATUS, filter);
} break;
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index dcd2ddafd8..aca2c7dd56 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -306,7 +306,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc _tcscpy_s(cf.szFaceName, _T("Arial"));
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
- mir_sntprintf(searchText, _countof(searchText), _T("%s '%s': %d\n\n"), TranslateT("Matches for searchtext"), searchString, listCount);
+ mir_sntprintf(searchText, _T("%s '%s': %d\n\n"), TranslateT("Matches for searchtext"), searchString, listCount);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)searchText);
linePos += 2;
}
@@ -455,7 +455,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc type = _T("[UNK ]");
}
- mir_sntprintf(textLine, _countof(textLine), _T("%s%s%s%s%s%s%s\n"),
+ mir_sntprintf(textLine, _T("%s%s%s%s%s%s%s\n"),
options.showDirection ? (actualElement->direction==DIRECTION_IN?_T("[in ]"):_T("[out]")) : _T(""),
options.showDirection? _T(" ") : _T(""),
options.showType ? type : _T(""),
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index cdce105537..b01f1c2f32 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -62,7 +62,7 @@ void InitIcons(void) HICON LoadIconEx(const char* name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", ModuleName, name);
+ mir_snprintf(szSettingName, "%s_%s", ModuleName, name);
return IcoLib_GetIcon(szSettingName);
}
@@ -78,7 +78,7 @@ HANDLE GetIconHandle(const char* name) void ReleaseIconEx(const char* name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", ModuleName, name);
+ mir_snprintf(szSettingName, "%s_%s", ModuleName, name);
IcoLib_Release(szSettingName);
}
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 444966f79a..59dbde9186 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -605,7 +605,7 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar MarkChanges(2, hwndDlg);
break;
case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, _countof(filter), "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
UpdateTemplateIcons(hwndDlg, path);
@@ -613,21 +613,21 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar }
break;
case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, _countof(filter), "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
MarkChanges(2, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(2, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
MarkChanges(2, hwndDlg);
@@ -737,7 +737,7 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w MarkChanges(4, hwndDlg);
break;
case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, _countof(filter), "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
UpdateTemplateIcons(hwndDlg, path);
@@ -745,21 +745,21 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w }
break;
case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, _countof(filter), "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
MarkChanges(4, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(4, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
MarkChanges(4, hwndDlg);
@@ -870,7 +870,7 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA MarkChanges(8, hwndDlg);
break;
case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, _countof(filter), "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
UpdateTemplateIcons(hwndDlg, path);
@@ -878,21 +878,21 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA }
break;
case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, _countof(filter), "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
MarkChanges(8, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(8, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
MarkChanges(8, hwndDlg);
@@ -1495,13 +1495,13 @@ void Options::init() else continue;
/* SRMM settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
proto->setSRMMEnable(i == 0 ? true : 0 != db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
proto->setSRMMMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
proto->setSRMMFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1510,7 +1510,7 @@ void Options::init() proto->setSRMMBackgroundFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1519,7 +1519,7 @@ void Options::init() proto->setSRMMCssFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1528,13 +1528,13 @@ void Options::init() }
/* Group chat settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
proto->setChatEnable(i == 0 ? true : 0 != db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
proto->setChatMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
proto->setChatFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1543,7 +1543,7 @@ void Options::init() proto->setChatBackgroundFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1552,7 +1552,7 @@ void Options::init() proto->setChatCssFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1561,13 +1561,13 @@ void Options::init() }
/* History settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
proto->setHistoryEnable(i == 0 ? true : 0 != db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
proto->setHistoryMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
proto->setHistoryFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1576,7 +1576,7 @@ void Options::init() proto->setHistoryBackgroundFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1585,7 +1585,7 @@ void Options::init() proto->setHistoryCssFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1681,67 +1681,67 @@ void Options::saveProtocolSettings() char tmpPath[MAX_PATH];
proto->copyFromTemp();
/* SRMM settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->isSRMMEnable());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->getSRMMMode());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
db_set_dw(NULL, ieviewModuleName, dbsName, proto->getSRMMFlags());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
mir_strcpy(tmpPath, proto->getSRMMBackgroundFilename());
PathToRelative(proto->getSRMMBackgroundFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
mir_strcpy(tmpPath, proto->getSRMMCssFilename());
PathToRelative(proto->getSRMMCssFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
mir_strcpy(tmpPath, proto->getSRMMTemplateFilename());
PathToRelative(proto->getSRMMTemplateFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
/* Group Chat settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->isChatEnable());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->getChatMode());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
db_set_dw(NULL, ieviewModuleName, dbsName, proto->getChatFlags());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
mir_strcpy(tmpPath, proto->getChatBackgroundFilename());
PathToRelative(proto->getChatBackgroundFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
mir_strcpy(tmpPath, proto->getChatCssFilename());
PathToRelative(proto->getChatCssFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
mir_strcpy(tmpPath, proto->getChatTemplateFilename());
PathToRelative(proto->getChatTemplateFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
/* History settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->isHistoryEnable());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->getHistoryMode());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
db_set_dw(NULL, ieviewModuleName, dbsName, proto->getHistoryFlags());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
mir_strcpy(tmpPath, proto->getHistoryBackgroundFilename());
PathToRelative(proto->getHistoryBackgroundFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
mir_strcpy(tmpPath, proto->getHistoryCssFilename());
PathToRelative(proto->getHistoryCssFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
mir_strcpy(tmpPath, proto->getHistoryTemplateFilename());
PathToRelative(proto->getHistoryTemplateFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 6a20622f41..b8f692cf18 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -186,7 +186,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr szNameOut = mir_strdup(" ");
szNameIn = mir_strdup(" ");
}
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.png", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.png", tempBase);
TCHAR szNoAvatarPath[MAX_PATH];
_tcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
@@ -194,9 +194,9 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr *szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, _T("\\noavatar.png"));
if (_taccess(szNoAvatarPath, 0) == -1)
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.jpg", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.png", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.png", tempBase);
char *szNoAvatar = mir_utf8encode(tempStr);
char *szAvatarIn = getAvatar(event->hContact, szRealProto);
@@ -368,9 +368,9 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, *szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, _T("\\noavatar.png"));
if (_taccess(szNoAvatarPath, 0) == -1)
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.jpg", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.png", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.png", tempBase);
char *szNoAvatar = mir_utf8encode(tempStr);
char *szAvatarIn = NULL;
@@ -426,12 +426,12 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, if (isSent) {
szAvatar = szAvatarOut;
szUIN = szUINOut;
- mir_snprintf(szCID, _countof(szCID), "%d", 0);
+ mir_snprintf(szCID, "%d", 0);
}
else {
szAvatar = szAvatarIn;
szUIN = szUINIn;
- mir_snprintf(szCID, _countof(szCID), "%d", (int)event->hContact);
+ mir_snprintf(szCID, "%d", (int)event->hContact);
}
tmpltName[0] = groupTemplate;
tmpltName[1] = NULL;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index a382dcf0af..8f8a8f9934 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -713,7 +713,7 @@ void ImportMeta(DBCachedContact *ccSrc) ccDst->pSubs[i] = MapContact(ccSrc->pSubs[i]);
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "Handle%d", i);
+ mir_snprintf(szSettingName, "Handle%d", i);
db_set_dw(hDest, META_PROTO, szSettingName, ccDst->pSubs[i]);
db_set_b(ccDst->pSubs[i], META_PROTO, "IsSubcontact", 1);
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index d4cad24695..edcda4e3e8 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -33,7 +33,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * {
// find in Miranda profile subfolders
TCHAR searchspec[MAX_PATH];
- mir_sntprintf(searchspec, _countof(searchspec), _T("%s\\*.*"), mirandaPath);
+ mir_sntprintf(searchspec, _T("%s\\*.*"), mirandaPath);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(searchspec, &fd);
@@ -52,7 +52,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * TCHAR buf[MAX_PATH], profile[MAX_PATH];
mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), mirandaPath, fd.cFileName, fd.cFileName);
if (_taccess(buf, 0) == 0) {
- mir_sntprintf(profile, _countof(profile), _T("%s.dat"), fd.cFileName);
+ mir_sntprintf(profile, _T("%s.dat"), fd.cFileName);
int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)profile);
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)mir_tstrdup(buf));
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index fba56a5d6c..1b11915e45 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -40,11 +40,11 @@ BOOL OpenKeyboardDevice() TCHAR aux1[MAX_PATH+1], aux2[MAX_PATH+1];
do {
- mir_sntprintf(aux1, _countof(aux1), _T("Kbd%d"), i);
- mir_sntprintf(aux2, _countof(aux2), _T("\\Device\\KeyboardClass%d"), i);
+ mir_sntprintf(aux1, _T("Kbd%d"), i);
+ mir_sntprintf(aux2, _T("\\Device\\KeyboardClass%d"), i);
DefineDosDevice(DDD_RAW_TARGET_PATH, aux1, aux2);
- mir_sntprintf(aux1, _countof(aux1), _T("\\\\.\\Kbd%d"), i);
+ mir_sntprintf(aux1, _T("\\\\.\\Kbd%d"), i);
hKbdDev[i] = CreateFile(aux1, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
} while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES);
@@ -80,7 +80,7 @@ void CloseKeyboardDevice() if (hKbdDev[i] != INVALID_HANDLE_VALUE)
CloseHandle(hKbdDev[i]);
- mir_sntprintf(aux, _countof(aux), _T("Kbd%d"), i);
+ mir_sntprintf(aux, _T("Kbd%d"), i);
DefineDosDevice(DDD_REMOVE_DEFINITION, aux, NULL);
} while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 183aeb0f4e..0ae9e613f0 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -721,9 +721,9 @@ static int ModulesLoaded(WPARAM, LPARAM) // Create some synchronisation objects createEventPrefix(eventPrefix, MAX_PATH - 11); - mir_sntprintf(eventName, _countof(eventName), _T("%s/FlashEvent"), eventPrefix); + mir_sntprintf(eventName, _T("%s/FlashEvent"), eventPrefix); hFlashEvent = CreateEvent(NULL, FALSE, FALSE, eventName); - mir_sntprintf(eventName, _countof(eventName), _T("%s/ExitEvent"), eventPrefix); + mir_sntprintf(eventName, _T("%s/ExitEvent"), eventPrefix); hExitEvent = CreateEvent(NULL, FALSE, FALSE, eventName); hThread = mir_forkthread(FlashThreadFunction, 0); diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 855b12087a..c781f6c380 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -779,11 +779,11 @@ void checkthread(void*) if (attSize) {
WCHAR field_attachments_UNICODE[MAX_FIELD];
- mir_sntprintf(field_attachments_UNICODE, _countof(field_attachments_UNICODE), TranslateW(L"Attachments: %d bytes"), attSize);
- mir_sntprintf(msgSubject, _countof(msgSubject), L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
+ mir_sntprintf(field_attachments_UNICODE, TranslateW(L"Attachments: %d bytes"), attSize);
+ mir_sntprintf(msgSubject, L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
}
else {
- mir_sntprintf(msgSubject, _countof(msgSubject), L"%S\n%s", field_date, field_subject_UNICODE);
+ mir_sntprintf(msgSubject, L"%S\n%s", field_date, field_subject_UNICODE);
}
//check if this is not filtered msg
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index f0d217e5da..fffb4499ad 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -300,7 +300,7 @@ int StatusMsgExists(MCONTACT hContact) for (int i = 0; i < _countof(statusMsg); i++) {
if (statusMsg[i].flag & 8)
- mir_snprintf(par, _countof(par), "%s/%s", module, statusMsg[i].name);
+ mir_snprintf(par, "%s/%s", module, statusMsg[i].name);
else
strncpy(par, statusMsg[i].name, _countof(par)-1);
@@ -342,9 +342,9 @@ void getIP(MCONTACT hContact, LPSTR szProto, LPSTR szIP) DWORD mIP = db_get_dw(hContact, szProto, "IP", 0);
DWORD rIP = db_get_dw(hContact, szProto, "RealIP", 0);
if (mIP)
- mir_snprintf(szmIP, _countof(szmIP), "External IP: %d.%d.%d.%d\r\n", mIP >> 24, (mIP >> 16) & 0xFF, (mIP >> 8) & 0xFF, mIP & 0xFF);
+ mir_snprintf(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP >> 24, (mIP >> 16) & 0xFF, (mIP >> 8) & 0xFF, mIP & 0xFF);
if (rIP)
- mir_snprintf(szrIP, _countof(szrIP), "Internal IP: %d.%d.%d.%d\r\n", rIP >> 24, (rIP >> 16) & 0xFF, (rIP >> 8) & 0xFF, rIP & 0xFF);
+ mir_snprintf(szrIP, "Internal IP: %d.%d.%d.%d\r\n", rIP >> 24, (rIP >> 16) & 0xFF, (rIP >> 8) & 0xFF, rIP & 0xFF);
mir_strcpy(szIP, szrIP);
mir_strcat(szIP, szmIP);
}
@@ -507,7 +507,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) szID[MAX_IDLEN + 1] = 0;
}
- mir_sntprintf(buffer, _countof(buffer), _T("%s [%S]"), TranslateT("Copy ID"), szID);
+ mir_sntprintf(buffer, _T("%s [%S]"), TranslateT("Copy ID"), szID);
Menu_ModifyItem(hmenuCopyID, buffer, hIconCID);
}
else Menu_ModifyItem(hmenuCopyID, LPGENT("Copy ID"), hIconCID);
@@ -620,7 +620,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) buffer[0] = 0;
for (int i = 0; i < _countof(statusMsg); i++) {
if (statusMsg[i].flag & 8)
- mir_snprintf(par, _countof(par), "%s/%s", module, statusMsg[i].name);
+ mir_snprintf(par, "%s/%s", module, statusMsg[i].name);
else
strncpy(par, statusMsg[i].name, _countof(par) - 1);
diff --git a/plugins/MirFox/src/MirfoxMiranda.cpp b/plugins/MirFox/src/MirfoxMiranda.cpp index 06e02dd65c..5d5e851cc1 100644 --- a/plugins/MirFox/src/MirfoxMiranda.cpp +++ b/plugins/MirFox/src/MirfoxMiranda.cpp @@ -116,7 +116,7 @@ void CMirfoxMiranda::initializeSharedMemoryData(MirfoxData& mirfoxData, SharedMe } else {
mirfoxData.processCsmId = result.processCsmId;
wchar_t prefix[7];
- mir_sntprintf(prefix, _countof(prefix), L"MNG%d", result.processCsmId);
+ mir_sntprintf(prefix, L"MNG%d", result.processCsmId);
logger->set6CharsPrefix(prefix);
}
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index 898cffe408..b9b14c92c8 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -42,9 +42,9 @@ INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact)); const TCHAR *name = contact_get_nameT(hContact); - mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto); + mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto); SetWindowText(hwndDlg, title); - mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_PROGRESS_DESC), name, proto); + mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_DESC), name, proto); mir_free(proto); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEADPRO, title); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); @@ -329,7 +329,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA MCONTACT hContact = (UINT_PTR)context->app_data; TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + mir_sntprintf(title, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, title); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title); @@ -421,7 +421,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_QUESTION), 255) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { TCHAR msg[512]; - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(msg); } else { @@ -445,7 +445,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA else if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_PASSWORD), 255) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { TCHAR msg[512]; - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(msg); } else { @@ -746,7 +746,7 @@ unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, "verified"); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; @@ -755,7 +755,7 @@ unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, NULL); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 2c727f9fbb..217e535f07 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -750,8 +750,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, _countof(buff) - 1, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); - buff[_countof(buff) - 1] = '\0'; + mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else { @@ -781,8 +780,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, _countof(buff) - 1, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); - buff[_countof(buff) - 1] = '\0'; + mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else otrl_context_forget_fingerprint(it->first, 1); diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 94f2dc0919..a624520afd 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -68,7 +68,7 @@ void VerifyFingerprintMessage(ConnContext *context, bool verify) { MCONTACT hContact = (UINT_PTR)context->app_data; TCHAR msg[1024]; - mir_sntprintf(msg, _countof(msg), (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); } @@ -155,7 +155,7 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA if ( !options.bHavePopups) { TCHAR title[256]; - mir_sntprintf(title, _countof(title), _T("%s Message"), _T(MODULENAME)); + mir_sntprintf(title, _T("%s Message"), _T(MODULENAME)); if(line1 && line2) { int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3); @@ -205,7 +205,7 @@ void ShowWarning(TCHAR *msg) { if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL; if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB; - mir_sntprintf(buffer, _countof(buffer), _T("%s Warning"), _T(MODULENAME)); + mir_sntprintf(buffer, _T("%s Warning"), _T(MODULENAME)); TCHAR *message; switch(disp) { @@ -251,7 +251,7 @@ void ShowError(TCHAR *msg) { if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL; if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB; - mir_sntprintf(buffer, _countof(buffer), _T("%s Error"), _T(MODULENAME)); + mir_sntprintf(buffer, _T("%s Error"), _T(MODULENAME)); TCHAR *message; diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 48f9da6346..337cad2886 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -22,7 +22,7 @@ void CConfig::Initialize() {
CConfig::LoadSettings();
m_hOptionsInitHook = HookEvent(ME_OPT_INITIALISE, CConfig::InitOptionsDialog);
-
+
}
void CConfig::Shutdown()
@@ -33,80 +33,80 @@ void CConfig::Shutdown() void CConfig::LoadSettings()
{
- m_abBoolSettings[SKIP_DRIVER_ERROR] = db_get_dw(NULL, "MirandaG15", "SkipDriverError",0) != 0;
-
- m_abBoolSettings[SCREENSAVER_LOCK] = db_get_dw(NULL, "MirandaG15", "ScreensaverLock",1) != 0;
- m_abBoolSettings[NOTIFY_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "NotifyShowProto",0) != 0;
- m_abBoolSettings[NOTIFY_NICKCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoff",0) != 0;
- m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoff",0) != 0;
-
- m_abBoolSettings[TRANSITIONS] = db_get_dw(NULL, "MirandaG15", "Transitions",0) != 0;
- m_abBoolSettings[TIMESTAMP_SECONDS] = db_get_dw(NULL, "MirandaG15", "TimestampSeconds",0) != 0;
- m_abBoolSettings[SESSION_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "SessionTimestamps",0) != 0;
- m_abBoolSettings[NOTIFY_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "NotifyTimestamps",0) != 0;
-
- m_abBoolSettings[CONTROL_BACKLIGHTS] = db_get_dw(NULL, "MirandaG15", "ControlBacklights",0) != 0;
- m_abBoolSettings[HOOK_VOLUMEWHEEL] = db_get_dw(NULL, "MirandaG15", "HookVolumeWheel",0) != 0;
-
- m_abBoolSettings[CLIST_SELECTION] = db_get_dw(NULL, "MirandaG15", "CListSelection",1) != 0;
- m_abBoolSettings[CLIST_COLUMNS] = db_get_dw(NULL, "MirandaG15", "CListColumns",0) != 0;
- m_abBoolSettings[CLIST_HIDEOFFLINE] = db_get_dw(NULL, "MirandaG15", "CListHideOffline",1) != 0;
- m_abBoolSettings[CLIST_USEIGNORE] = db_get_dw(NULL, "MirandaG15", "CListUseIgnore",1) != 0;
- m_abBoolSettings[CLIST_USEGROUPS] = db_get_dw(NULL, "MirandaG15", "CListUseGroups",1) != 0;
- m_abBoolSettings[CLIST_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "CListShowProto",1) != 0;
- m_abBoolSettings[CLIST_DRAWLINES] = db_get_dw(NULL, "MirandaG15", "CListDrawLines",1) != 0;
- m_abBoolSettings[CLIST_COUNTERS] = db_get_dw(NULL, "MirandaG15", "CListCounters",1) != 0;
- m_abBoolSettings[CLIST_POSITION] = db_get_dw(NULL, "MirandaG15", "CListPosition",0) != 0;
-
- m_abBoolSettings[NOTIFY_IRC_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCMessages", 1) != 0;
- m_abBoolSettings[NOTIFY_IRC_USERS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCUsers", 0) != 0;
- m_abBoolSettings[NOTIFY_IRC_EMOTES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCEmotes", 0) != 0;
- m_abBoolSettings[NOTIFY_IRC_NOTICES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCNotices", 1) != 0;
- m_abBoolSettings[NOTIFY_IRC_CHANNEL] = db_get_dw(NULL, "MirandaG15", "NotifyIRCChannel", 0) != 0;
- m_abBoolSettings[NOTIFY_IRC_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCStatus", 0) != 0;
-
- m_abBoolSettings[NOTIFY_PROTO_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyProtoStatus", 0) != 0;
- m_abBoolSettings[NOTIFY_PROTO_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOn", 1) != 0;
- m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] =db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOff", 1) != 0;
- m_abBoolSettings[NOTIFY_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyMessages", 1) != 0;
- m_abBoolSettings[NOTIFY_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySignOn", 1) != 0;
- m_abBoolSettings[NOTIFY_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySignOff", 1) != 0;
- m_abBoolSettings[NOTIFY_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyStatus", 0) != 0;
- m_abBoolSettings[NOTIFY_SKIP_MESSAGES] =db_get_dw(NULL, "MirandaG15", "NotifySkipMessages", 1) != 0;
- m_abBoolSettings[NOTIFY_SKIP_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOn", 0) != 0;
- m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOff", 0) != 0;
- m_abBoolSettings[NOTIFY_SKIP_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifySkipStatus", 1) != 0;
- m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = db_get_dw(NULL, "MirandaG15", "NotifyNoSkipReply",1) != 0;
- m_abBoolSettings[NOTIFY_URL] = db_get_dw(NULL, "MirandaG15", "NotifyURL", 1) != 0;
- m_abBoolSettings[NOTIFY_FILE] = db_get_dw(NULL, "MirandaG15", "NotifyFile", 1) != 0;
- m_abBoolSettings[NOTIFY_CONTACTS] = db_get_dw(NULL, "MirandaG15", "NotifyContacts", 1) != 0;
-
- m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionScrollMaximized", 1) != 0;
- m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionReplyMaximized", 1) != 0;
- m_abBoolSettings[SESSION_LOADDB] = db_get_dw(NULL, "MirandaG15", "SessionLoadDB", 0) != 0;
- m_abBoolSettings[SESSION_MARKREAD] = db_get_dw(NULL, "MirandaG15", "SessionMarkRead", 1) != 0;
- m_abBoolSettings[SESSION_SENDRETURN] = db_get_dw(NULL, "MirandaG15", "SessionSendReturn",0) != 0;
- m_abBoolSettings[SESSION_SHOWTYPING] = db_get_dw(NULL, "MirandaG15", "SessionShowTyping",1) != 0;
- m_abBoolSettings[SESSION_SENDTYPING] = db_get_dw(NULL, "MirandaG15", "SessionSendTyping",1) != 0;
- m_abBoolSettings[SESSION_SYMBOLS] = db_get_dw(NULL, "MirandaG15", "SessionSymbols",0) != 0;
- m_abBoolSettings[SESSION_CLOSE] = db_get_dw(NULL, "MirandaG15", "SessionClose",1) != 0;
-
- m_abBoolSettings[SHOW_LABELS] = db_get_dw(NULL, "MirandaG15", "ShowLabels", 1) != 0;
- m_abBoolSettings[MAXIMIZED_TITLE] = db_get_dw(NULL, "MirandaG15", "MaximizedTitle", 0) != 0;
- m_abBoolSettings[MAXIMIZED_LABELS] = db_get_dw(NULL, "MirandaG15", "MaximizedLabels", 1) != 0;
+ m_abBoolSettings[SKIP_DRIVER_ERROR] = db_get_dw(NULL, "MirandaG15", "SkipDriverError", 0) != 0;
+
+ m_abBoolSettings[SCREENSAVER_LOCK] = db_get_dw(NULL, "MirandaG15", "ScreensaverLock", 1) != 0;
+ m_abBoolSettings[NOTIFY_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "NotifyShowProto", 0) != 0;
+ m_abBoolSettings[NOTIFY_NICKCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoff", 0) != 0;
+ m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoff", 0) != 0;
+
+ m_abBoolSettings[TRANSITIONS] = db_get_dw(NULL, "MirandaG15", "Transitions", 0) != 0;
+ m_abBoolSettings[TIMESTAMP_SECONDS] = db_get_dw(NULL, "MirandaG15", "TimestampSeconds", 0) != 0;
+ m_abBoolSettings[SESSION_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "SessionTimestamps", 0) != 0;
+ m_abBoolSettings[NOTIFY_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "NotifyTimestamps", 0) != 0;
+
+ m_abBoolSettings[CONTROL_BACKLIGHTS] = db_get_dw(NULL, "MirandaG15", "ControlBacklights", 0) != 0;
+ m_abBoolSettings[HOOK_VOLUMEWHEEL] = db_get_dw(NULL, "MirandaG15", "HookVolumeWheel", 0) != 0;
+
+ m_abBoolSettings[CLIST_SELECTION] = db_get_dw(NULL, "MirandaG15", "CListSelection", 1) != 0;
+ m_abBoolSettings[CLIST_COLUMNS] = db_get_dw(NULL, "MirandaG15", "CListColumns", 0) != 0;
+ m_abBoolSettings[CLIST_HIDEOFFLINE] = db_get_dw(NULL, "MirandaG15", "CListHideOffline", 1) != 0;
+ m_abBoolSettings[CLIST_USEIGNORE] = db_get_dw(NULL, "MirandaG15", "CListUseIgnore", 1) != 0;
+ m_abBoolSettings[CLIST_USEGROUPS] = db_get_dw(NULL, "MirandaG15", "CListUseGroups", 1) != 0;
+ m_abBoolSettings[CLIST_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "CListShowProto", 1) != 0;
+ m_abBoolSettings[CLIST_DRAWLINES] = db_get_dw(NULL, "MirandaG15", "CListDrawLines", 1) != 0;
+ m_abBoolSettings[CLIST_COUNTERS] = db_get_dw(NULL, "MirandaG15", "CListCounters", 1) != 0;
+ m_abBoolSettings[CLIST_POSITION] = db_get_dw(NULL, "MirandaG15", "CListPosition", 0) != 0;
+
+ m_abBoolSettings[NOTIFY_IRC_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCMessages", 1) != 0;
+ m_abBoolSettings[NOTIFY_IRC_USERS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCUsers", 0) != 0;
+ m_abBoolSettings[NOTIFY_IRC_EMOTES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCEmotes", 0) != 0;
+ m_abBoolSettings[NOTIFY_IRC_NOTICES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCNotices", 1) != 0;
+ m_abBoolSettings[NOTIFY_IRC_CHANNEL] = db_get_dw(NULL, "MirandaG15", "NotifyIRCChannel", 0) != 0;
+ m_abBoolSettings[NOTIFY_IRC_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCStatus", 0) != 0;
+
+ m_abBoolSettings[NOTIFY_PROTO_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyProtoStatus", 0) != 0;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOn", 1) != 0;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOff", 1) != 0;
+ m_abBoolSettings[NOTIFY_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyMessages", 1) != 0;
+ m_abBoolSettings[NOTIFY_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySignOn", 1) != 0;
+ m_abBoolSettings[NOTIFY_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySignOff", 1) != 0;
+ m_abBoolSettings[NOTIFY_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyStatus", 0) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifySkipMessages", 1) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOn", 0) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOff", 0) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifySkipStatus", 1) != 0;
+ m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = db_get_dw(NULL, "MirandaG15", "NotifyNoSkipReply", 1) != 0;
+ m_abBoolSettings[NOTIFY_URL] = db_get_dw(NULL, "MirandaG15", "NotifyURL", 1) != 0;
+ m_abBoolSettings[NOTIFY_FILE] = db_get_dw(NULL, "MirandaG15", "NotifyFile", 1) != 0;
+ m_abBoolSettings[NOTIFY_CONTACTS] = db_get_dw(NULL, "MirandaG15", "NotifyContacts", 1) != 0;
+
+ m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionScrollMaximized", 1) != 0;
+ m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionReplyMaximized", 1) != 0;
+ m_abBoolSettings[SESSION_LOADDB] = db_get_dw(NULL, "MirandaG15", "SessionLoadDB", 0) != 0;
+ m_abBoolSettings[SESSION_MARKREAD] = db_get_dw(NULL, "MirandaG15", "SessionMarkRead", 1) != 0;
+ m_abBoolSettings[SESSION_SENDRETURN] = db_get_dw(NULL, "MirandaG15", "SessionSendReturn", 0) != 0;
+ m_abBoolSettings[SESSION_SHOWTYPING] = db_get_dw(NULL, "MirandaG15", "SessionShowTyping", 1) != 0;
+ m_abBoolSettings[SESSION_SENDTYPING] = db_get_dw(NULL, "MirandaG15", "SessionSendTyping", 1) != 0;
+ m_abBoolSettings[SESSION_SYMBOLS] = db_get_dw(NULL, "MirandaG15", "SessionSymbols", 0) != 0;
+ m_abBoolSettings[SESSION_CLOSE] = db_get_dw(NULL, "MirandaG15", "SessionClose", 1) != 0;
+
+ m_abBoolSettings[SHOW_LABELS] = db_get_dw(NULL, "MirandaG15", "ShowLabels", 1) != 0;
+ m_abBoolSettings[MAXIMIZED_TITLE] = db_get_dw(NULL, "MirandaG15", "MaximizedTitle", 0) != 0;
+ m_abBoolSettings[MAXIMIZED_LABELS] = db_get_dw(NULL, "MirandaG15", "MaximizedLabels", 1) != 0;
m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", 10);
m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", 10);
- m_aiIntSettings[NOTIFY_DURATION] = db_get_dw(NULL, "MirandaG15", "NotifyDuration", 4);
- m_aiIntSettings[NOTIFY_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "NotifyLogSize", 10);
- m_aiIntSettings[SESSION_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "SessionLogSize", 10);
- m_aiIntSettings[SESSION_AUTOSCROLL] = db_get_dw(NULL, "MirandaG15", "SessionAutoScroll", SESSION_AUTOSCROLL_FIRST);
- m_aiIntSettings[SESSION_CLOSETIMER] = db_get_dw(NULL, "MirandaG15", "SessionCloseTimer", 15);
- m_aiIntSettings[NOTIFY_TITLE] = db_get_dw(NULL, "MirandaG15", "NotifyTitle", NOTIFY_TITLE_NAME);
- m_aiIntSettings[CLIST_GA] = db_get_dw(NULL, "MirandaG15", "CListGA",CLIST_GA_NONE);
- m_aiIntSettings[DEVICE] = db_get_dw(NULL, "MirandaG15", "Device",0);
-
- for(int i=0;i<FONT_SETTINGS;i++)
+ m_aiIntSettings[NOTIFY_DURATION] = db_get_dw(NULL, "MirandaG15", "NotifyDuration", 4);
+ m_aiIntSettings[NOTIFY_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "NotifyLogSize", 10);
+ m_aiIntSettings[SESSION_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "SessionLogSize", 10);
+ m_aiIntSettings[SESSION_AUTOSCROLL] = db_get_dw(NULL, "MirandaG15", "SessionAutoScroll", SESSION_AUTOSCROLL_FIRST);
+ m_aiIntSettings[SESSION_CLOSETIMER] = db_get_dw(NULL, "MirandaG15", "SessionCloseTimer", 15);
+ m_aiIntSettings[NOTIFY_TITLE] = db_get_dw(NULL, "MirandaG15", "NotifyTitle", NOTIFY_TITLE_NAME);
+ m_aiIntSettings[CLIST_GA] = db_get_dw(NULL, "MirandaG15", "CListGA", CLIST_GA_NONE);
+ m_aiIntSettings[DEVICE] = db_get_dw(NULL, "MirandaG15", "Device", 0);
+
+ for (int i = 0; i < FONT_SETTINGS; i++)
LoadFontSettings(i);
// Load protocol specific settings
@@ -117,8 +117,7 @@ void CConfig::LoadSettings() tstring strSetting;
Proto_EnumAccounts(&iCount, &ppAccounts);
- for(int i=0;i<iCount;i++)
- {
+ for (int i = 0; i < iCount; i++) {
/*if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL)
continue;*/
if (ppAccounts[i]->bIsEnabled == 0)
@@ -127,220 +126,223 @@ void CConfig::LoadSettings() iProtoCount++;
pProtoFilter = new CProtoFilter();
pProtoFilter->strName = toTstring(ppAccounts[i]->szModuleName);
-
+
strSetting = _T("ProtoFilter_") + pProtoFilter->strName;
- pProtoFilter->bNotificationFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1) != 0;
+ pProtoFilter->bNotificationFilter = db_get_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), 1) != 0;
strSetting = _T("ProtoCListFilter_") + pProtoFilter->strName;
- pProtoFilter->bContactlistFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1) != 0;
+ pProtoFilter->bContactlistFilter = db_get_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), 1) != 0;
m_ProtoList.push_back(pProtoFilter);
}
}
void CConfig::SaveSettings()
{
- db_set_dw(NULL, "MirandaG15", "SkipDriverError", m_abBoolSettings[SKIP_DRIVER_ERROR]);
-
- db_set_dw(NULL, "MirandaG15", "ScreensaverLock", m_abBoolSettings[SCREENSAVER_LOCK]);
- db_set_dw(NULL, "MirandaG15", "NotifyShowProto", m_abBoolSettings[NOTIFY_SHOWPROTO]);
- db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoff", m_abBoolSettings[NOTIFY_CHANNELCUTOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifyNickCutoff", m_abBoolSettings[NOTIFY_NICKCUTOFF]);
- db_set_dw(NULL, "MirandaG15", "Transitions", m_abBoolSettings[TRANSITIONS]);
- db_set_dw(NULL, "MirandaG15", "TimestampSeconds", m_abBoolSettings[TIMESTAMP_SECONDS]);
- db_set_dw(NULL, "MirandaG15", "SessionTimestamps", m_abBoolSettings[SESSION_TIMESTAMPS]);
- db_set_dw(NULL, "MirandaG15", "NotifyTimestamps", m_abBoolSettings[NOTIFY_TIMESTAMPS]);
-
- db_set_dw(NULL, "MirandaG15", "ControlBacklights", m_abBoolSettings[CONTROL_BACKLIGHTS]);
- db_set_dw(NULL, "MirandaG15", "HookVolumeWheel", m_abBoolSettings[HOOK_VOLUMEWHEEL]);
-
- db_set_dw(NULL, "MirandaG15", "CListSelection", m_abBoolSettings[CLIST_SELECTION]);
- db_set_dw(NULL, "MirandaG15", "CListColumns", m_abBoolSettings[CLIST_COLUMNS]);
- db_set_dw(NULL, "MirandaG15", "CListHideOffline", m_abBoolSettings[CLIST_HIDEOFFLINE]);
- db_set_dw(NULL, "MirandaG15", "CListUseIgnore", m_abBoolSettings[CLIST_USEIGNORE]);
- db_set_dw(NULL, "MirandaG15", "CListUseGroups", m_abBoolSettings[CLIST_USEGROUPS]);
- db_set_dw(NULL, "MirandaG15", "CListShowProto", m_abBoolSettings[CLIST_SHOWPROTO]);
- db_set_dw(NULL, "MirandaG15", "CListDrawLines", m_abBoolSettings[CLIST_DRAWLINES]);
- db_set_dw(NULL, "MirandaG15", "CListCounters", m_abBoolSettings[CLIST_COUNTERS]);
- db_set_dw(NULL, "MirandaG15", "CListPosition", m_abBoolSettings[CLIST_POSITION]);
-
- db_set_dw(NULL, "MirandaG15", "NotifyIRCMessages", m_abBoolSettings[NOTIFY_IRC_MESSAGES]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCUsers", m_abBoolSettings[NOTIFY_IRC_USERS]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCEmotes", m_abBoolSettings[NOTIFY_IRC_EMOTES]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCNotices", m_abBoolSettings[NOTIFY_IRC_NOTICES]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCChannel", m_abBoolSettings[NOTIFY_IRC_CHANNEL]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCStatus", m_abBoolSettings[NOTIFY_IRC_STATUS]);
-
- db_set_dw(NULL, "MirandaG15", "NotifyProtoStatus", m_abBoolSettings[NOTIFY_PROTO_STATUS]);
- db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOn", m_abBoolSettings[NOTIFY_PROTO_SIGNON]);
- db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOff",m_abBoolSettings[NOTIFY_PROTO_SIGNOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifyMessages", m_abBoolSettings[NOTIFY_MESSAGES]);
- db_set_dw(NULL, "MirandaG15", "NotifySignOn", m_abBoolSettings[NOTIFY_SIGNON]);
- db_set_dw(NULL, "MirandaG15", "NotifySignOff", m_abBoolSettings[NOTIFY_SIGNOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifyStatus", m_abBoolSettings[NOTIFY_STATUS]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipMessages", m_abBoolSettings[NOTIFY_SKIP_MESSAGES]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipSignOn", m_abBoolSettings[NOTIFY_SKIP_SIGNON]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipSignOff", m_abBoolSettings[NOTIFY_SKIP_SIGNOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipStatus", m_abBoolSettings[NOTIFY_SKIP_STATUS]);
- db_set_dw(NULL, "MirandaG15", "NotifyNoSkipReply", m_abBoolSettings[NOTIFY_NO_SKIP_REPLY]);
- db_set_dw(NULL, "MirandaG15", "NotifyURL", m_abBoolSettings[NOTIFY_URL]);
- db_set_dw(NULL, "MirandaG15", "NotifyFile", m_abBoolSettings[NOTIFY_FILE]);
- db_set_dw(NULL, "MirandaG15", "NotifyContacts", m_abBoolSettings[NOTIFY_CONTACTS]);
-
- db_set_dw(NULL, "MirandaG15", "SessionScrollMaximized",m_abBoolSettings[SESSION_SCROLL_MAXIMIZED]);
- db_set_dw(NULL, "MirandaG15", "SessionReplyMaximized",m_abBoolSettings[SESSION_REPLY_MAXIMIZED]);
- db_set_dw(NULL, "MirandaG15", "SessionShowTyping", m_abBoolSettings[SESSION_SHOWTYPING]);
- db_set_dw(NULL, "MirandaG15", "SessionSendTyping", m_abBoolSettings[SESSION_SENDTYPING]);
- db_set_dw(NULL, "MirandaG15", "SessionLoadDB", m_abBoolSettings[SESSION_LOADDB]);
- db_set_dw(NULL, "MirandaG15", "SessionSendReturn", m_abBoolSettings[SESSION_SENDRETURN]);
- db_set_dw(NULL, "MirandaG15", "SessionMarkRead", m_abBoolSettings[SESSION_MARKREAD]);
- db_set_dw(NULL, "MirandaG15", "SessionSymbols", m_abBoolSettings[SESSION_SYMBOLS]);
- db_set_dw(NULL, "MirandaG15", "SessionClose", m_abBoolSettings[SESSION_CLOSE]);
-
- db_set_dw(NULL, "MirandaG15", "ShowLabels", m_abBoolSettings[SHOW_LABELS]);
- db_set_dw(NULL, "MirandaG15", "MaximizedTitle", m_abBoolSettings[MAXIMIZED_TITLE]);
- db_set_dw(NULL, "MirandaG15", "MaximizedLabels", m_abBoolSettings[MAXIMIZED_LABELS]);
-
- db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET]);
- db_set_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET]);
- db_set_dw(NULL, "MirandaG15", "NotifyDuration", m_aiIntSettings[NOTIFY_DURATION]);
- db_set_dw(NULL, "MirandaG15", "NotifyLogSize", m_aiIntSettings[NOTIFY_LOGSIZE]);
- db_set_dw(NULL, "MirandaG15", "SessionLogSize", m_aiIntSettings[SESSION_LOGSIZE]);
- db_set_dw(NULL, "MirandaG15", "NotifyTitle", m_aiIntSettings[NOTIFY_TITLE]);
- db_set_dw(NULL, "MirandaG15", "SessionAutoScroll", m_aiIntSettings[SESSION_AUTOSCROLL]);
- db_set_dw(NULL, "MirandaG15", "SessionCloseTimer", m_aiIntSettings[SESSION_CLOSETIMER]);
- db_set_dw(NULL, "MirandaG15", "CListGA", m_aiIntSettings[CLIST_GA]);
- db_set_dw(NULL, "MirandaG15", "Device", m_aiIntSettings[DEVICE]);
+ db_set_dw(NULL, "MirandaG15", "SkipDriverError", m_abBoolSettings[SKIP_DRIVER_ERROR]);
+
+ db_set_dw(NULL, "MirandaG15", "ScreensaverLock", m_abBoolSettings[SCREENSAVER_LOCK]);
+ db_set_dw(NULL, "MirandaG15", "NotifyShowProto", m_abBoolSettings[NOTIFY_SHOWPROTO]);
+ db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoff", m_abBoolSettings[NOTIFY_CHANNELCUTOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifyNickCutoff", m_abBoolSettings[NOTIFY_NICKCUTOFF]);
+ db_set_dw(NULL, "MirandaG15", "Transitions", m_abBoolSettings[TRANSITIONS]);
+ db_set_dw(NULL, "MirandaG15", "TimestampSeconds", m_abBoolSettings[TIMESTAMP_SECONDS]);
+ db_set_dw(NULL, "MirandaG15", "SessionTimestamps", m_abBoolSettings[SESSION_TIMESTAMPS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyTimestamps", m_abBoolSettings[NOTIFY_TIMESTAMPS]);
+
+ db_set_dw(NULL, "MirandaG15", "ControlBacklights", m_abBoolSettings[CONTROL_BACKLIGHTS]);
+ db_set_dw(NULL, "MirandaG15", "HookVolumeWheel", m_abBoolSettings[HOOK_VOLUMEWHEEL]);
+
+ db_set_dw(NULL, "MirandaG15", "CListSelection", m_abBoolSettings[CLIST_SELECTION]);
+ db_set_dw(NULL, "MirandaG15", "CListColumns", m_abBoolSettings[CLIST_COLUMNS]);
+ db_set_dw(NULL, "MirandaG15", "CListHideOffline", m_abBoolSettings[CLIST_HIDEOFFLINE]);
+ db_set_dw(NULL, "MirandaG15", "CListUseIgnore", m_abBoolSettings[CLIST_USEIGNORE]);
+ db_set_dw(NULL, "MirandaG15", "CListUseGroups", m_abBoolSettings[CLIST_USEGROUPS]);
+ db_set_dw(NULL, "MirandaG15", "CListShowProto", m_abBoolSettings[CLIST_SHOWPROTO]);
+ db_set_dw(NULL, "MirandaG15", "CListDrawLines", m_abBoolSettings[CLIST_DRAWLINES]);
+ db_set_dw(NULL, "MirandaG15", "CListCounters", m_abBoolSettings[CLIST_COUNTERS]);
+ db_set_dw(NULL, "MirandaG15", "CListPosition", m_abBoolSettings[CLIST_POSITION]);
+
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCMessages", m_abBoolSettings[NOTIFY_IRC_MESSAGES]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCUsers", m_abBoolSettings[NOTIFY_IRC_USERS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCEmotes", m_abBoolSettings[NOTIFY_IRC_EMOTES]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCNotices", m_abBoolSettings[NOTIFY_IRC_NOTICES]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCChannel", m_abBoolSettings[NOTIFY_IRC_CHANNEL]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCStatus", m_abBoolSettings[NOTIFY_IRC_STATUS]);
+
+ db_set_dw(NULL, "MirandaG15", "NotifyProtoStatus", m_abBoolSettings[NOTIFY_PROTO_STATUS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOn", m_abBoolSettings[NOTIFY_PROTO_SIGNON]);
+ db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOff", m_abBoolSettings[NOTIFY_PROTO_SIGNOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifyMessages", m_abBoolSettings[NOTIFY_MESSAGES]);
+ db_set_dw(NULL, "MirandaG15", "NotifySignOn", m_abBoolSettings[NOTIFY_SIGNON]);
+ db_set_dw(NULL, "MirandaG15", "NotifySignOff", m_abBoolSettings[NOTIFY_SIGNOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifyStatus", m_abBoolSettings[NOTIFY_STATUS]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipMessages", m_abBoolSettings[NOTIFY_SKIP_MESSAGES]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipSignOn", m_abBoolSettings[NOTIFY_SKIP_SIGNON]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipSignOff", m_abBoolSettings[NOTIFY_SKIP_SIGNOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipStatus", m_abBoolSettings[NOTIFY_SKIP_STATUS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyNoSkipReply", m_abBoolSettings[NOTIFY_NO_SKIP_REPLY]);
+ db_set_dw(NULL, "MirandaG15", "NotifyURL", m_abBoolSettings[NOTIFY_URL]);
+ db_set_dw(NULL, "MirandaG15", "NotifyFile", m_abBoolSettings[NOTIFY_FILE]);
+ db_set_dw(NULL, "MirandaG15", "NotifyContacts", m_abBoolSettings[NOTIFY_CONTACTS]);
+
+ db_set_dw(NULL, "MirandaG15", "SessionScrollMaximized", m_abBoolSettings[SESSION_SCROLL_MAXIMIZED]);
+ db_set_dw(NULL, "MirandaG15", "SessionReplyMaximized", m_abBoolSettings[SESSION_REPLY_MAXIMIZED]);
+ db_set_dw(NULL, "MirandaG15", "SessionShowTyping", m_abBoolSettings[SESSION_SHOWTYPING]);
+ db_set_dw(NULL, "MirandaG15", "SessionSendTyping", m_abBoolSettings[SESSION_SENDTYPING]);
+ db_set_dw(NULL, "MirandaG15", "SessionLoadDB", m_abBoolSettings[SESSION_LOADDB]);
+ db_set_dw(NULL, "MirandaG15", "SessionSendReturn", m_abBoolSettings[SESSION_SENDRETURN]);
+ db_set_dw(NULL, "MirandaG15", "SessionMarkRead", m_abBoolSettings[SESSION_MARKREAD]);
+ db_set_dw(NULL, "MirandaG15", "SessionSymbols", m_abBoolSettings[SESSION_SYMBOLS]);
+ db_set_dw(NULL, "MirandaG15", "SessionClose", m_abBoolSettings[SESSION_CLOSE]);
+
+ db_set_dw(NULL, "MirandaG15", "ShowLabels", m_abBoolSettings[SHOW_LABELS]);
+ db_set_dw(NULL, "MirandaG15", "MaximizedTitle", m_abBoolSettings[MAXIMIZED_TITLE]);
+ db_set_dw(NULL, "MirandaG15", "MaximizedLabels", m_abBoolSettings[MAXIMIZED_LABELS]);
+
+ db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET]);
+ db_set_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET]);
+ db_set_dw(NULL, "MirandaG15", "NotifyDuration", m_aiIntSettings[NOTIFY_DURATION]);
+ db_set_dw(NULL, "MirandaG15", "NotifyLogSize", m_aiIntSettings[NOTIFY_LOGSIZE]);
+ db_set_dw(NULL, "MirandaG15", "SessionLogSize", m_aiIntSettings[SESSION_LOGSIZE]);
+ db_set_dw(NULL, "MirandaG15", "NotifyTitle", m_aiIntSettings[NOTIFY_TITLE]);
+ db_set_dw(NULL, "MirandaG15", "SessionAutoScroll", m_aiIntSettings[SESSION_AUTOSCROLL]);
+ db_set_dw(NULL, "MirandaG15", "SessionCloseTimer", m_aiIntSettings[SESSION_CLOSETIMER]);
+ db_set_dw(NULL, "MirandaG15", "CListGA", m_aiIntSettings[CLIST_GA]);
+ db_set_dw(NULL, "MirandaG15", "Device", m_aiIntSettings[DEVICE]);
// Save font settings
- for(int i=0;i<FONT_SETTINGS;i++)
+ for (int i = 0; i < FONT_SETTINGS; i++)
SaveFontSettings(i);
// save protocol specific settings
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
tstring strSetting = _T("");
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
strSetting = _T("ProtoFilter_") + (*iter)->strName;
- db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(),(*iter)->bNotificationFilter);
+ db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), (*iter)->bNotificationFilter);
strSetting = _T("ProtoCListFilter_") + (*iter)->strName;
- db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(),(*iter)->bContactlistFilter);
+ db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), (*iter)->bContactlistFilter);
iter++;
}
// Notify OutputManager of configuration change
- if(CAppletManager::GetInstance()->IsInitialized())
+ if (CAppletManager::GetInstance()->IsInitialized())
CAppletManager::GetInstance()->OnConfigChanged();
}
void CConfig::UpdateFontSettings(int iFont)
{
- if(m_hSampleFont[iFont])
+ if (m_hSampleFont[iFont])
DeleteObject(m_hSampleFont[iFont]);
- m_hSampleFont[iFont] = CreateFontIndirect(&m_logfont[iFont]);
+ m_hSampleFont[iFont] = CreateFontIndirect(&m_logfont[iFont]);
HDC hDC = CreateCompatibleDC(NULL);
- SelectObject(hDC, m_hSampleFont[iFont]);
- GetTextMetrics(hDC,&m_tmFontInfo[iFont]);
+ SelectObject(hDC, m_hSampleFont[iFont]);
+ GetTextMetrics(hDC, &m_tmFontInfo[iFont]);
DeleteObject(hDC);
}
-void CConfig::OnConnectionChanged() {
+void CConfig::OnConnectionChanged()
+{
FillDeviceBox(CConfig::hDeviceBox);
}
int CConfig::InitOptionsDialog(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.position = 847000000;
- odp.hInstance = hInstance;
- odp.pszGroup = LPGEN("MirandaG15");
- odp.flags = ODPF_BOLDGROUPS;
+ odp.position = 847000000;
+ odp.hInstance = hInstance;
+ odp.pszGroup = LPGEN("MirandaG15");
+ odp.flags = ODPF_BOLDGROUPS;
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_FONTS);
- odp.pszTitle = LPGEN("Appearance");
- odp.pszGroup = LPGEN("MirandaG15");
- odp.pfnDlgProc = CConfig::AppearanceDlgProc;
+ odp.pszTitle = LPGEN("Appearance");
+ odp.pszGroup = LPGEN("MirandaG15");
+ odp.pfnDlgProc = CConfig::AppearanceDlgProc;
Options_AddPage(wParam, &odp);
-
+
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_NOTIFICATIONS);
- odp.pszTitle = LPGEN("Notifications");
- odp.pfnDlgProc = CConfig::NotificationsDlgProc;
+ odp.pszTitle = LPGEN("Notifications");
+ odp.pfnDlgProc = CConfig::NotificationsDlgProc;
Options_AddPage(wParam, &odp);
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CHAT);
- odp.pszTitle = LPGEN("Chat sessions");
- odp.pfnDlgProc = CConfig::ChatDlgProc;
+ odp.pszTitle = LPGEN("Chat sessions");
+ odp.pfnDlgProc = CConfig::ChatDlgProc;
Options_AddPage(wParam, &odp);
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CLIST);
- odp.pszTitle = LPGEN("Contact list");
- odp.pfnDlgProc = CConfig::ContactlistDlgProc;
+ odp.pszTitle = LPGEN("Contact list");
+ odp.pfnDlgProc = CConfig::ContactlistDlgProc;
Options_AddPage(wParam, &odp);
return 0;
}
void CConfig::SaveFontSettings(int iFont)
{
- if(iFont > FONT_SETTINGS -1 || iFont < 0)
+ if (iFont > FONT_SETTINGS - 1 || iFont < 0)
return;
char szSetting[128];
// Height
- mir_snprintf(szSetting,_countof(szSetting),"Font%dHeight",iFont);
+ mir_snprintf(szSetting, "Font%dHeight", iFont);
db_set_b(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfHeight);
+
// Style
int style = 0;
- if(m_logfont[iFont].lfWeight == FW_BOLD)
+ if (m_logfont[iFont].lfWeight == FW_BOLD)
style |= FONTF_BOLD;
- if(m_logfont[iFont].lfItalic)
+ if (m_logfont[iFont].lfItalic)
style |= FONTF_ITALIC;
- mir_snprintf(szSetting,_countof(szSetting),"Font%dStyle",iFont);
+ mir_snprintf(szSetting, "Font%dStyle", iFont);
db_set_b(NULL, "MirandaG15", szSetting, style);
+
// Charset
- mir_snprintf(szSetting,_countof(szSetting),"Font%dCharset",iFont);
+ mir_snprintf(szSetting, "Font%dCharset", iFont);
db_set_b(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfCharSet);
+
// Name
- mir_snprintf(szSetting,_countof(szSetting),"Font%dName",iFont);
+ mir_snprintf(szSetting, "Font%dName", iFont);
db_set_ts(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfFaceName);
-
+
UpdateFontSettings(iFont);
}
void CConfig::LoadFontSettings(int iFont)
{
- if(iFont > FONT_SETTINGS -1 || iFont < 0)
+ 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,_countof(szSetting),"Font%dHeight",iFont);
- m_logfont[iFont].lfHeight = (char) db_get_b(NULL, "MirandaG15", szSetting, -MulDiv(6, 96, 72));
+ mir_snprintf(szSetting, "Font%dHeight", iFont);
+ m_logfont[iFont].lfHeight = (char)db_get_b(NULL, "MirandaG15", szSetting, -MulDiv(6, 96, 72));
// Style
- mir_snprintf(szSetting,_countof(szSetting),"Font%dStyle",iFont);
+ mir_snprintf(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;
+ m_logfont[iFont].lfItalic = style & FONTF_ITALIC ? 1 : 0;
// Charset
- mir_snprintf(szSetting,_countof(szSetting),"Font%dCharset",iFont);
+ mir_snprintf(szSetting, "Font%dCharset", iFont);
m_logfont[iFont].lfCharSet = db_get_b(NULL, "MirandaG15", szSetting, DEFAULT_CHARSET);
// Name
- mir_snprintf(szSetting,_countof(szSetting),"Font%dName",iFont);
+ mir_snprintf(szSetting, "Font%dName", iFont);
DBVARIANT dbv;
if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv))
- mir_tstrcpy(m_logfont[iFont].lfFaceName,_T("Small Fonts"));
- else {
+ mir_tstrcpy(m_logfont[iFont].lfFaceName, _T("Small Fonts"));
+ else {
mir_tstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
- db_free(&dbv);
- }
+ db_free(&dbv);
+ }
UpdateFontSettings(iFont);
}
@@ -357,8 +359,7 @@ int CConfig::GetFontHeight(int iFont) int CConfig::GetSampleField(int iFont)
{
- switch(iFont)
- {
+ switch (iFont) {
case 0: return IDC_SAMPLE1;
case 1: return IDC_SAMPLE2;
case 2: return IDC_SAMPLE3;
@@ -370,54 +371,51 @@ int CConfig::GetSampleField(int iFont) INT_PTR CALLBACK CConfig::AppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
-
+
// Translate the dialog
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SKIP_DRIVER_ERROR, m_abBoolSettings[SKIP_DRIVER_ERROR] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_SCREENSAVER_LOCK, m_abBoolSettings[SCREENSAVER_LOCK] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRANSITIONS, m_abBoolSettings[TRANSITIONS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CONTROL_BACKLIGHTS, m_abBoolSettings[CONTROL_BACKLIGHTS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_LABELS, m_abBoolSettings[SHOW_LABELS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HOOK_VOLUMEWHEEL, m_abBoolSettings[HOOK_VOLUMEWHEEL] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TIMESTAMP_SECONDS, m_abBoolSettings[TIMESTAMP_SECONDS] ? BST_CHECKED : BST_UNCHECKED);
-
- for(int i=0;i<FONT_SETTINGS;i++)
- {
+ CheckDlgButton(hwndDlg, IDC_SKIP_DRIVER_ERROR, m_abBoolSettings[SKIP_DRIVER_ERROR] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_SCREENSAVER_LOCK, m_abBoolSettings[SCREENSAVER_LOCK] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRANSITIONS, m_abBoolSettings[TRANSITIONS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONTROL_BACKLIGHTS, m_abBoolSettings[CONTROL_BACKLIGHTS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_LABELS, m_abBoolSettings[SHOW_LABELS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HOOK_VOLUMEWHEEL, m_abBoolSettings[HOOK_VOLUMEWHEEL] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TIMESTAMP_SECONDS, m_abBoolSettings[TIMESTAMP_SECONDS] ? BST_CHECKED : BST_UNCHECKED);
+
+ for (int i = 0; i < FONT_SETTINGS; i++) {
m_templogfont[i] = m_logfont[i];
- SendDlgItemMessage(hwndDlg,CConfig::GetSampleField(i),WM_SETFONT,(WPARAM)m_hSampleFont[i],(LPARAM)true);
+ SendDlgItemMessage(hwndDlg, CConfig::GetSampleField(i), WM_SETFONT, (WPARAM)m_hSampleFont[i], (LPARAM)true);
}
-
+
// fill device box
- CConfig::hDeviceBox = GetDlgItem(hwndDlg,IDC_DEVICE);
+ CConfig::hDeviceBox = GetDlgItem(hwndDlg, IDC_DEVICE);
FillDeviceBox(CConfig::hDeviceBox);
-
+
m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[SKIP_DRIVER_ERROR] = IsDlgButtonChecked(hwndDlg,IDC_SKIP_DRIVER_ERROR) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SKIP_DRIVER_ERROR] = IsDlgButtonChecked(hwndDlg, IDC_SKIP_DRIVER_ERROR) == BST_CHECKED ? true : false;
- m_abBoolSettings[SCREENSAVER_LOCK] = IsDlgButtonChecked(hwndDlg,IDC_SCREENSAVER_LOCK) == BST_CHECKED ? true : false;
- m_abBoolSettings[TRANSITIONS] = IsDlgButtonChecked(hwndDlg,IDC_TRANSITIONS) == BST_CHECKED ? true : false;
- m_abBoolSettings[SHOW_LABELS] = IsDlgButtonChecked(hwndDlg,IDC_SHOW_LABELS) == BST_CHECKED ? true : false;
- m_abBoolSettings[CONTROL_BACKLIGHTS] = IsDlgButtonChecked(hwndDlg,IDC_CONTROL_BACKLIGHTS) == BST_CHECKED ? true : false;
- m_abBoolSettings[HOOK_VOLUMEWHEEL] = IsDlgButtonChecked(hwndDlg,IDC_HOOK_VOLUMEWHEEL) == BST_CHECKED ? true : false;
- m_abBoolSettings[TIMESTAMP_SECONDS] = IsDlgButtonChecked(hwndDlg,IDC_TIMESTAMP_SECONDS) == BST_CHECKED ? true : false;
- m_aiIntSettings[DEVICE] = SendDlgItemMessage(hwndDlg,IDC_DEVICE,CB_GETCURSEL ,0,0);
+ m_abBoolSettings[SCREENSAVER_LOCK] = IsDlgButtonChecked(hwndDlg, IDC_SCREENSAVER_LOCK) == BST_CHECKED ? true : false;
+ m_abBoolSettings[TRANSITIONS] = IsDlgButtonChecked(hwndDlg, IDC_TRANSITIONS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SHOW_LABELS] = IsDlgButtonChecked(hwndDlg, IDC_SHOW_LABELS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CONTROL_BACKLIGHTS] = IsDlgButtonChecked(hwndDlg, IDC_CONTROL_BACKLIGHTS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[HOOK_VOLUMEWHEEL] = IsDlgButtonChecked(hwndDlg, IDC_HOOK_VOLUMEWHEEL) == BST_CHECKED ? true : false;
+ m_abBoolSettings[TIMESTAMP_SECONDS] = IsDlgButtonChecked(hwndDlg, IDC_TIMESTAMP_SECONDS) == BST_CHECKED ? true : false;
+ m_aiIntSettings[DEVICE] = SendDlgItemMessage(hwndDlg, IDC_DEVICE, CB_GETCURSEL, 0, 0);
- for(int i=0;i<FONT_SETTINGS;i++)
+ for (int i = 0; i < FONT_SETTINGS; i++)
m_logfont[i] = m_templogfont[i];
CConfig::SaveSettings();
@@ -427,17 +425,15 @@ INT_PTR CALLBACK CConfig::AppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
- if(LOWORD(wParam) == IDC_CREDITS)
- {
+ if (LOWORD(wParam) == IDC_CREDITS) {
CAppletManager::GetInstance()->ActivateCreditsScreen();
break;
}
int iFont = LOWORD(wParam);
- switch(iFont)
- {
+ switch (iFont) {
case IDC_CHOOSEFONT1: iFont = 0; break;
case IDC_CHOOSEFONT2: iFont = 1; break;
case IDC_CHOOSEFONT3: iFont = 2; break;
@@ -446,23 +442,21 @@ INT_PTR CALLBACK CConfig::AppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar default: iFont = -1;
};
- if(iFont >= 0)
- {
+ if (iFont >= 0) {
CHOOSEFONT cf = { 0 };
cf.lStructSize = sizeof(cf);
cf.hwndOwner = hwndDlg;
cf.lpLogFont = &m_templogfont[iFont];
cf.Flags = CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
- if (ChooseFont(&cf))
- {
- if(m_hSampleFont[iFont])
+ if (ChooseFont(&cf)) {
+ if (m_hSampleFont[iFont])
DeleteObject(m_hSampleFont[iFont]);
- m_hSampleFont[iFont] = CreateFontIndirect(&m_templogfont[iFont]);
- SendDlgItemMessage(hwndDlg,CConfig::GetSampleField(iFont),WM_SETFONT,(WPARAM)m_hSampleFont[iFont],(LPARAM)true);
+ m_hSampleFont[iFont] = CreateFontIndirect(&m_templogfont[iFont]);
+ SendDlgItemMessage(hwndDlg, CConfig::GetSampleField(iFont), WM_SETFONT, (WPARAM)m_hSampleFont[iFont], (LPARAM)true);
TRACE(_T("Font selected!"));
}
}
- if(LOWORD(wParam) == IDC_DEVICE && SendDlgItemMessage(hwndDlg,IDC_DEVICE,CB_GETCURSEL ,0,0) != m_aiIntSettings[DEVICE]) {
+ if (LOWORD(wParam) == IDC_DEVICE && SendDlgItemMessage(hwndDlg, IDC_DEVICE, CB_GETCURSEL, 0, 0) != m_aiIntSettings[DEVICE]) {
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
@@ -480,74 +474,72 @@ INT_PTR CALLBACK CConfig::ChatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP {
char buf[128];
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
-
+
// Translate the dialog
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_MAXIMIZED_TITLE, m_abBoolSettings[MAXIMIZED_TITLE] ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_MAXIMIZED_LABELS, m_abBoolSettings[MAXIMIZED_LABELS] ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_REPLY_MAXIMIZED, m_abBoolSettings[SESSION_REPLY_MAXIMIZED]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLL_MAXIMIZED, m_abBoolSettings[SESSION_SCROLL_MAXIMIZED]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SHOWTYPING, m_abBoolSettings[SESSION_SHOWTYPING]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SENDTYPING, m_abBoolSettings[SESSION_SENDTYPING]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_LOADDB, m_abBoolSettings[SESSION_LOADDB]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_MARKREAD, m_abBoolSettings[SESSION_MARKREAD]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SYMBOLS, m_abBoolSettings[SESSION_SYMBOLS]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_TIMESTAMPS, m_abBoolSettings[SESSION_TIMESTAMPS]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_CLOSE, m_abBoolSettings[SESSION_CLOSE]? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_SESSION_SENDRETURN, m_abBoolSettings[SESSION_SENDRETURN]? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLNONE, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_NONE? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLFIRST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_FIRST? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLLAST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_LAST? BST_CHECKED : BST_UNCHECKED);
-
+ CheckDlgButton(hwndDlg, IDC_MAXIMIZED_TITLE, m_abBoolSettings[MAXIMIZED_TITLE] ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAXIMIZED_LABELS, m_abBoolSettings[MAXIMIZED_LABELS] ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_REPLY_MAXIMIZED, m_abBoolSettings[SESSION_REPLY_MAXIMIZED] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLL_MAXIMIZED, m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SHOWTYPING, m_abBoolSettings[SESSION_SHOWTYPING] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SENDTYPING, m_abBoolSettings[SESSION_SENDTYPING] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_LOADDB, m_abBoolSettings[SESSION_LOADDB] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_MARKREAD, m_abBoolSettings[SESSION_MARKREAD] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SYMBOLS, m_abBoolSettings[SESSION_SYMBOLS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_TIMESTAMPS, m_abBoolSettings[SESSION_TIMESTAMPS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_CLOSE, m_abBoolSettings[SESSION_CLOSE] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_SESSION_SENDRETURN, m_abBoolSettings[SESSION_SENDRETURN] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLNONE, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_NONE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLFIRST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_FIRST ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLLAST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_LAST ? BST_CHECKED : BST_UNCHECKED);
+
_itoa_s(m_aiIntSettings[SESSION_LOGSIZE], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_SESSION_LOGSIZE, buf);
-
+
_itoa_s(m_aiIntSettings[SESSION_CLOSETIMER], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_SESSION_CLOSETIMER, buf);
m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SCROLL_MAXIMIZED) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_REPLY_MAXIMIZED) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SHOWTYPING] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SHOWTYPING) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SENDTYPING] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SENDTYPING) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_LOADDB] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_LOADDB) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SENDRETURN] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SENDRETURN) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_MARKREAD] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_MARKREAD) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SYMBOLS] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SYMBOLS) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_TIMESTAMPS) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_CLOSE] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_CLOSE) == BST_CHECKED ? true : false;
-
- if(IsDlgButtonChecked(hwndDlg,IDC_SESSION_SCROLLNONE) == BST_CHECKED)
+ m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SCROLL_MAXIMIZED) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_REPLY_MAXIMIZED) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SHOWTYPING] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SHOWTYPING) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SENDTYPING] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SENDTYPING) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_LOADDB] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_LOADDB) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SENDRETURN] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SENDRETURN) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_MARKREAD] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_MARKREAD) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SYMBOLS] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SYMBOLS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_TIMESTAMPS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_CLOSE] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_CLOSE) == BST_CHECKED ? true : false;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_SESSION_SCROLLNONE) == BST_CHECKED)
m_aiIntSettings[SESSION_AUTOSCROLL] = SESSION_AUTOSCROLL_NONE;
- else if(IsDlgButtonChecked(hwndDlg,IDC_SESSION_SCROLLFIRST) == BST_CHECKED)
+ else if (IsDlgButtonChecked(hwndDlg, IDC_SESSION_SCROLLFIRST) == BST_CHECKED)
m_aiIntSettings[SESSION_AUTOSCROLL] = SESSION_AUTOSCROLL_FIRST;
else
m_aiIntSettings[SESSION_AUTOSCROLL] = SESSION_AUTOSCROLL_LAST;
- m_abBoolSettings[MAXIMIZED_TITLE] = IsDlgButtonChecked(hwndDlg,IDC_MAXIMIZED_TITLE) == BST_UNCHECKED ? true : false;
- m_abBoolSettings[MAXIMIZED_LABELS] = IsDlgButtonChecked(hwndDlg,IDC_MAXIMIZED_LABELS) == BST_UNCHECKED ? true : false;
+ m_abBoolSettings[MAXIMIZED_TITLE] = IsDlgButtonChecked(hwndDlg, IDC_MAXIMIZED_TITLE) == BST_UNCHECKED ? true : false;
+ m_abBoolSettings[MAXIMIZED_LABELS] = IsDlgButtonChecked(hwndDlg, IDC_MAXIMIZED_LABELS) == BST_UNCHECKED ? true : false;
+
+ GetDlgItemTextA(hwndDlg, IDC_SESSION_LOGSIZE, buf, _countof(buf));
+ m_aiIntSettings[SESSION_LOGSIZE] = atoi(buf) > 0 ? atoi(buf) : 1;
- GetDlgItemTextA(hwndDlg,IDC_SESSION_LOGSIZE,buf,_countof(buf));
- m_aiIntSettings[SESSION_LOGSIZE] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_SESSION_CLOSETIMER,buf,_countof(buf));
- m_aiIntSettings[SESSION_CLOSETIMER] = atoi(buf) >= 0 ? atoi(buf):1;
+ GetDlgItemTextA(hwndDlg, IDC_SESSION_CLOSETIMER, buf, _countof(buf));
+ m_aiIntSettings[SESSION_CLOSETIMER] = atoi(buf) >= 0 ? atoi(buf) : 1;
CConfig::SaveSettings();
SendMessage(hwndDlg, WM_INITDIALOG, 0, 0);
@@ -556,7 +548,7 @@ INT_PTR CALLBACK CConfig::ChatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
// Activate the apply button
if (!m_bInitializingDialog && ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)))
@@ -572,9 +564,8 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w {
char buf[128];
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
@@ -582,46 +573,46 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w TranslateDialogDefault(hwndDlg);
// Initialize the protocol filter list
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOCOLS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOCOLS),GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLS), GWL_STYLE) | TVS_NOHSCROLL);
int iRes = 0;
-
+
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_NOTICK)));
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_TICK)));
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_PROTOCOLS),himlCheckBoxes,TVSIL_NORMAL);
-
- FillTree(GetDlgItem(hwndDlg,IDC_PROTOCOLS));
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TIMESTAMPS, m_abBoolSettings[NOTIFY_TIMESTAMPS] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SHOWPROTO, m_abBoolSettings[NOTIFY_SHOWPROTO] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF, m_abBoolSettings[NOTIFY_CHANNELCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_NICKCUTOFF, m_abBoolSettings[NOTIFY_NICKCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_MESSAGES, m_abBoolSettings[NOTIFY_IRC_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_USERS, m_abBoolSettings[NOTIFY_IRC_USERS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_EMOTES, m_abBoolSettings[NOTIFY_IRC_EMOTES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_NOTICES, m_abBoolSettings[NOTIFY_IRC_NOTICES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_CHANNEL, m_abBoolSettings[NOTIFY_IRC_CHANNEL] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_STATUS, m_abBoolSettings[NOTIFY_IRC_STATUS] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_STATUS, m_abBoolSettings[NOTIFY_PROTO_STATUS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNON, m_abBoolSettings[NOTIFY_PROTO_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNOFF, m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNON, m_abBoolSettings[NOTIFY_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNOFF, m_abBoolSettings[NOTIFY_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_STATUS, m_abBoolSettings[NOTIFY_STATUS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_MESSAGES, m_abBoolSettings[NOTIFY_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_FILE, m_abBoolSettings[NOTIFY_FILE] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_CONTACTS, m_abBoolSettings[NOTIFY_CONTACTS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_URL, m_abBoolSettings[NOTIFY_URL] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_NO_SKIP_REPLY, m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNON, m_abBoolSettings[NOTIFY_SKIP_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNOFF, m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_STATUS, m_abBoolSettings[NOTIFY_SKIP_STATUS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES, m_abBoolSettings[NOTIFY_SKIP_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
-
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NOTICK)));
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TICK)));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_PROTOCOLS), himlCheckBoxes, TVSIL_NORMAL);
+
+ FillTree(GetDlgItem(hwndDlg, IDC_PROTOCOLS));
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TIMESTAMPS, m_abBoolSettings[NOTIFY_TIMESTAMPS] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SHOWPROTO, m_abBoolSettings[NOTIFY_SHOWPROTO] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF, m_abBoolSettings[NOTIFY_CHANNELCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_NICKCUTOFF, m_abBoolSettings[NOTIFY_NICKCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_MESSAGES, m_abBoolSettings[NOTIFY_IRC_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_USERS, m_abBoolSettings[NOTIFY_IRC_USERS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_EMOTES, m_abBoolSettings[NOTIFY_IRC_EMOTES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_NOTICES, m_abBoolSettings[NOTIFY_IRC_NOTICES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_CHANNEL, m_abBoolSettings[NOTIFY_IRC_CHANNEL] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_STATUS, m_abBoolSettings[NOTIFY_IRC_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_STATUS, m_abBoolSettings[NOTIFY_PROTO_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNON, m_abBoolSettings[NOTIFY_PROTO_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNOFF, m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNON, m_abBoolSettings[NOTIFY_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNOFF, m_abBoolSettings[NOTIFY_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_STATUS, m_abBoolSettings[NOTIFY_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_MESSAGES, m_abBoolSettings[NOTIFY_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_FILE, m_abBoolSettings[NOTIFY_FILE] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_CONTACTS, m_abBoolSettings[NOTIFY_CONTACTS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_URL, m_abBoolSettings[NOTIFY_URL] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_NO_SKIP_REPLY, m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNON, m_abBoolSettings[NOTIFY_SKIP_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNOFF, m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_STATUS, m_abBoolSettings[NOTIFY_SKIP_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES, m_abBoolSettings[NOTIFY_SKIP_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
+
_itoa_s(m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF_OFFSET, buf);
@@ -630,98 +621,95 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w _itoa_s(m_aiIntSettings[NOTIFY_LOGSIZE], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_NOTIFY_LOGSIZE, buf);
-
+
_itoa_s(m_aiIntSettings[NOTIFY_DURATION], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_NOTIFY_DURATION, buf);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEHIDE, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_HIDE? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLENAME, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_NAME? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEINFO, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_INFO? BST_CHECKED : BST_UNCHECKED);
-
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEHIDE, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_HIDE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLENAME, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_NAME ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEINFO, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_INFO ? BST_CHECKED : BST_UNCHECKED);
+
m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- if(((LPNMHDR)lParam)->idFrom == IDC_PROTOCOLS)
- {
- if(((LPNMHDR)lParam)->code != NM_CLICK)
+ if (((LPNMHDR)lParam)->idFrom == IDC_PROTOCOLS) {
+ if (((LPNMHDR)lParam)->code != NM_CLICK)
return 0;
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMICON) {
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((CProtoFilter *)tvi.lParam)->bTempNotificationFilter=tvi.iImage != 0;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((CProtoFilter *)tvi.lParam)->bTempNotificationFilter = tvi.iImage != 0;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
-
+
}
break;
}
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[NOTIFY_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_TIMESTAMPS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_CHANNELCUTOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_NICKCUTOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_NICKCUTOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SHOWPROTO] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SHOWPROTO) == BST_CHECKED ? true : false;
-
- m_abBoolSettings[NOTIFY_IRC_MESSAGES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_MESSAGES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_USERS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_USERS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_EMOTES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_EMOTES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_NOTICES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_NOTICES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_CHANNEL] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_CHANNEL) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_STATUS) == BST_CHECKED ? true : false;
-
- m_abBoolSettings[NOTIFY_PROTO_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_PROTO_STATUS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_PROTO_SIGNON] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_PROTO_SIGNON) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_PROTO_SIGNOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_MESSAGES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_MESSAGES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SIGNON] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SIGNON) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SIGNOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SIGNOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_STATUS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_URL] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_URL) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_FILE] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_FILE) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_CONTACTS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_CONTACTS) == BST_CHECKED ? true : false;
-
- m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_NO_SKIP_REPLY) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_MESSAGES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_MESSAGES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_SIGNON] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_SIGNON) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_SIGNOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_STATUS) == BST_CHECKED ? true : false;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_CHANNELCUTOFF_OFFSET,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_NICKCUTOFF_OFFSET,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_DURATION,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_DURATION] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_LOGSIZE,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_LOGSIZE] = atoi(buf) > 0 ? atoi(buf):1;
-
- if(IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_TITLEHIDE) == BST_CHECKED)
+ m_abBoolSettings[NOTIFY_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_TIMESTAMPS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_NICKCUTOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_NICKCUTOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SHOWPROTO] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SHOWPROTO) == BST_CHECKED ? true : false;
+
+ m_abBoolSettings[NOTIFY_IRC_MESSAGES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_MESSAGES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_USERS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_USERS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_EMOTES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_EMOTES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_NOTICES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_NOTICES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_CHANNEL] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_CHANNEL) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_STATUS) == BST_CHECKED ? true : false;
+
+ m_abBoolSettings[NOTIFY_PROTO_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_PROTO_STATUS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNON] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_PROTO_SIGNON) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_PROTO_SIGNOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_MESSAGES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_MESSAGES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SIGNON] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SIGNON) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SIGNOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SIGNOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_STATUS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_URL] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_URL) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_FILE] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FILE) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_CONTACTS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_CONTACTS) == BST_CHECKED ? true : false;
+
+ m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_NO_SKIP_REPLY) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_MESSAGES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNON] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_SIGNON) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_SIGNOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_STATUS) == BST_CHECKED ? true : false;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF_OFFSET, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_NICKCUTOFF_OFFSET, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_DURATION, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_DURATION] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_LOGSIZE, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_LOGSIZE] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_TITLEHIDE) == BST_CHECKED)
m_aiIntSettings[NOTIFY_TITLE] = NOTIFY_TITLE_HIDE;
- else if(IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_TITLENAME) == BST_CHECKED)
+ else if (IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_TITLENAME) == BST_CHECKED)
m_aiIntSettings[NOTIFY_TITLE] = NOTIFY_TITLE_NAME;
else
m_aiIntSettings[NOTIFY_TITLE] = NOTIFY_TITLE_INFO;
// apply all contactlist protocol filters
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
(*iter)->bNotificationFilter = (*iter)->bTempNotificationFilter;
iter++;
}
@@ -733,7 +721,7 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
// Activate the apply button
if (!m_bInitializingDialog && ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)))
@@ -747,40 +735,39 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
-
+
// Translate the dialog
TranslateDialogDefault(hwndDlg);
// Initialize the protocol filter list
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), GWL_STYLE) | TVS_NOHSCROLL);
int iRes = 0;
-
+
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_NOTICK)));
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_TICK)));
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),himlCheckBoxes,TVSIL_NORMAL);
-
- FillTree(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),true);
-
- CheckDlgButton(hwndDlg, IDC_CLIST_SELECTION, m_abBoolSettings[CLIST_SELECTION] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_COLUMNS, m_abBoolSettings[CLIST_COLUMNS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_HIDEOFFLINE, m_abBoolSettings[CLIST_HIDEOFFLINE] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_USEIGNORE, m_abBoolSettings[CLIST_USEIGNORE] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_USEGROUPS, m_abBoolSettings[CLIST_USEGROUPS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_SHOWPROTO, m_abBoolSettings[CLIST_SHOWPROTO]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_DRAWLINES, m_abBoolSettings[CLIST_DRAWLINES]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_POSITION, m_abBoolSettings[CLIST_POSITION]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_COUNTERS, m_abBoolSettings[CLIST_COUNTERS]? BST_CHECKED : BST_UNCHECKED);
-
- if(m_aiIntSettings[CLIST_GA] == CLIST_GA_NONE)
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NOTICK)));
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TICK)));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), himlCheckBoxes, TVSIL_NORMAL);
+
+ FillTree(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), true);
+
+ CheckDlgButton(hwndDlg, IDC_CLIST_SELECTION, m_abBoolSettings[CLIST_SELECTION] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_COLUMNS, m_abBoolSettings[CLIST_COLUMNS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_HIDEOFFLINE, m_abBoolSettings[CLIST_HIDEOFFLINE] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_USEIGNORE, m_abBoolSettings[CLIST_USEIGNORE] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_USEGROUPS, m_abBoolSettings[CLIST_USEGROUPS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_SHOWPROTO, m_abBoolSettings[CLIST_SHOWPROTO] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_DRAWLINES, m_abBoolSettings[CLIST_DRAWLINES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_POSITION, m_abBoolSettings[CLIST_POSITION] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_COUNTERS, m_abBoolSettings[CLIST_COUNTERS] ? BST_CHECKED : BST_UNCHECKED);
+
+ if (m_aiIntSettings[CLIST_GA] == CLIST_GA_NONE)
CheckDlgButton(hwndDlg, IDC_CLIST_GA_NONE, BST_CHECKED);
- else if(m_aiIntSettings[CLIST_GA] == CLIST_GA_COLLAPSE)
+ else if (m_aiIntSettings[CLIST_GA] == CLIST_GA_COLLAPSE)
CheckDlgButton(hwndDlg, IDC_CLIST_GA_COLLAPSE, BST_CHECKED);
else
CheckDlgButton(hwndDlg, IDC_CLIST_GA_EXPAND, BST_CHECKED);
@@ -788,55 +775,52 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- if(((LPNMHDR)lParam)->idFrom == IDC_CLIST_PROTOFILTER)
- {
- if(((LPNMHDR)lParam)->code != NM_CLICK)
+ if (((LPNMHDR)lParam)->idFrom == IDC_CLIST_PROTOFILTER) {
+ if (((LPNMHDR)lParam)->code != NM_CLICK)
return 0;
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMICON) {
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((CProtoFilter *)tvi.lParam)->bTempContactlistFilter=tvi.iImage != 0;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((CProtoFilter *)tvi.lParam)->bTempContactlistFilter = tvi.iImage != 0;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
}
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[CLIST_SELECTION] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_SELECTION) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_COLUMNS] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_COLUMNS) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_HIDEOFFLINE] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_HIDEOFFLINE) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_USEGROUPS] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_USEGROUPS) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_USEIGNORE] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_USEIGNORE) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_SHOWPROTO] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_SHOWPROTO) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_DRAWLINES] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_DRAWLINES) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_POSITION] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_POSITION) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_COUNTERS] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_COUNTERS) == BST_CHECKED ? true : false;
-
- if(IsDlgButtonChecked(hwndDlg,IDC_CLIST_GA_NONE) == BST_CHECKED)
+ m_abBoolSettings[CLIST_SELECTION] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_SELECTION) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_COLUMNS] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_COLUMNS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_HIDEOFFLINE] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_HIDEOFFLINE) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_USEGROUPS] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_USEGROUPS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_USEIGNORE] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_USEIGNORE) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_SHOWPROTO] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_SHOWPROTO) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_DRAWLINES] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_DRAWLINES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_POSITION] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_POSITION) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_COUNTERS] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_COUNTERS) == BST_CHECKED ? true : false;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_CLIST_GA_NONE) == BST_CHECKED)
m_aiIntSettings[CLIST_GA] = CLIST_GA_NONE;
- else if(IsDlgButtonChecked(hwndDlg,IDC_CLIST_GA_COLLAPSE) == BST_CHECKED)
+ else if (IsDlgButtonChecked(hwndDlg, IDC_CLIST_GA_COLLAPSE) == BST_CHECKED)
m_aiIntSettings[CLIST_GA] = CLIST_GA_COLLAPSE;
else
m_aiIntSettings[CLIST_GA] = CLIST_GA_EXPAND;
// apply all contactlist protocol filters
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
(*iter)->bContactlistFilter = (*iter)->bTempContactlistFilter;
iter++;
}
@@ -847,7 +831,7 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
// Activate the apply button
if (!m_bInitializingDialog && ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)))
@@ -863,9 +847,8 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa bool CConfig::GetProtocolContactlistFilter(tstring strProtocol)
{
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
- if((*iter)->strName == strProtocol)
+ while (iter != m_ProtoList.end()) {
+ if ((*iter)->strName == strProtocol)
return (*iter)->bContactlistFilter;
iter++;
}
@@ -875,9 +858,8 @@ bool CConfig::GetProtocolContactlistFilter(tstring strProtocol) bool CConfig::GetProtocolNotificationFilter(tstring strProtocol)
{
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
- if((*iter)->strName == strProtocol)
+ while (iter != m_ProtoList.end()) {
+ if ((*iter)->strName == strProtocol)
return (*iter)->bNotificationFilter;
iter++;
}
@@ -886,14 +868,14 @@ bool CConfig::GetProtocolNotificationFilter(tstring strProtocol) bool CConfig::GetBoolSetting(int iSetting)
{
- if(iSetting >= 0 && iSetting < BOOL_SETTINGS)
+ if (iSetting >= 0 && iSetting < BOOL_SETTINGS)
return m_abBoolSettings[iSetting];
return false;
}
int CConfig::GetIntSetting(int iSetting)
{
- if(iSetting >= 0 && iSetting < INT_SETTINGS)
+ if (iSetting >= 0 && iSetting < INT_SETTINGS)
return m_aiIntSettings[iSetting];
return false;
}
@@ -903,21 +885,22 @@ void CConfig::ClearTree(HWND hTree) TreeView_DeleteAllItems(hTree);
}
-void CConfig::FillDeviceBox(HWND hBox) {
+void CConfig::FillDeviceBox(HWND hBox)
+{
CLCDConnection *connection = CAppletManager::GetInstance()->GetLCDConnection();
- SendMessage(hBox,CB_RESETCONTENT,0,0);
+ SendMessage(hBox, CB_RESETCONTENT, 0, 0);
int count = 0;
for (int i = 0; i < 10; i++) {
CLCDDevice *device = connection->GetAttachedDevice(i);
if (device != NULL) {
- SendMessage(hBox,CB_ADDSTRING,0,(LPARAM)device->GetDisplayName().c_str());
+ SendMessage(hBox, CB_ADDSTRING, 0, (LPARAM)device->GetDisplayName().c_str());
count++;
}
}
if (!count) {
- SendMessage(hBox,CB_ADDSTRING,0,(LPARAM)TranslateT("No device attached"));
+ SendMessage(hBox, CB_ADDSTRING, 0, (LPARAM)TranslateT("No device attached"));
}
int iDevice = CConfig::GetIntSetting(DEVICE);
@@ -927,33 +910,30 @@ void CConfig::FillDeviceBox(HWND hBox) { SendMessage(hBox, CB_SETCURSEL, iDevice, 0);
}
-void CConfig::FillTree(HWND hTree,bool bCList)
+void CConfig::FillTree(HWND hTree, bool bCList)
{
TreeView_DeleteAllItems(hTree);
TVINSERTSTRUCT tvis;
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
-
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
tvis.item.lParam = (LPARAM)(*iter);
- tvis.item.pszText= (LPTSTR)(*iter)->strName.c_str();
- if(!bCList)
- {
- tvis.item.iImage= (*iter)->bNotificationFilter;
+ tvis.item.pszText = (LPTSTR)(*iter)->strName.c_str();
+ if (!bCList) {
+ tvis.item.iImage = (*iter)->bNotificationFilter;
(*iter)->bTempNotificationFilter = (*iter)->bNotificationFilter;
}
- else
- {
- tvis.item.iImage= (*iter)->bContactlistFilter;
+ else {
+ tvis.item.iImage = (*iter)->bContactlistFilter;
(*iter)->bTempContactlistFilter = (*iter)->bContactlistFilter;
}
- tvis.item.iSelectedImage= tvis.item.iImage;
-
- TreeView_InsertItem(hTree,&tvis);
+ tvis.item.iSelectedImage = tvis.item.iImage;
+
+ TreeView_InsertItem(hTree, &tvis);
iter++;
}
-}
\ No newline at end of file +}
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 3bc56ce52c..7fc9aa8d42 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -199,9 +199,9 @@ void LoadConfig() {
for (int indx = 0; indx < 4; indx++) {
char szNameFG[4], szNameBG[4], szNameTO[4];
- mir_snprintf(szNameFG, _countof(szNameFG), "FG%d", indx);
- mir_snprintf(szNameBG, _countof(szNameBG), "BG%d", indx);
- mir_snprintf(szNameTO, _countof(szNameTO), "TO%d", indx);
+ mir_snprintf(szNameFG, "FG%d", indx);
+ mir_snprintf(szNameBG, "BG%d", indx);
+ mir_snprintf(szNameTO, "TO%d", indx);
options.FG[indx] = db_get_dw(NULL, SERVICENAME, szNameFG, optionsDefault.FG[indx]);
options.BG[indx] = db_get_dw(NULL, SERVICENAME, szNameBG, optionsDefault.BG[indx]);
options.Timeout[indx] = db_get_dw(NULL, SERVICENAME, szNameTO, (DWORD)optionsDefault.Timeout[indx]);
diff --git a/plugins/MsgPopup/src/options.cpp b/plugins/MsgPopup/src/options.cpp index 7ef6719f42..bb095620a5 100644 --- a/plugins/MsgPopup/src/options.cpp +++ b/plugins/MsgPopup/src/options.cpp @@ -99,9 +99,9 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l char szNameTO[4];
for (int indx = 0; indx < 4; indx++) {
- mir_snprintf(szNameFG, _countof(szNameFG), "FG%d", indx);
- mir_snprintf(szNameBG, _countof(szNameBG), "BG%d", indx);
- mir_snprintf(szNameTO, _countof(szNameTO), "TO%d", indx);
+ mir_snprintf(szNameFG, "FG%d", indx);
+ mir_snprintf(szNameBG, "BG%d", indx);
+ mir_snprintf(szNameTO, "TO%d", indx);
DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameFG, options.FG[indx], optionsDefault.FG[indx]);
DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameBG, options.BG[indx], optionsDefault.BG[indx]);
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index b68b96a430..c39b00d719 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -191,14 +191,8 @@ int CLStreamRTFInfo::nWriteHeader(char *pszTarget, int nLen) COLORREF cMyText = db_get_dw(NULL, "SRMsg", "Font3Col", RGB(64, 0, 128));
COLORREF cYourText = db_get_dw(NULL, "SRMsg", "Font0Col", RGB(240, 0, 0));
- /* original header !!
- "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n"
- "{\\colortbl ;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}\r\n"
- "\\viewkind4\\uc1\\pard\\cf2\\lang1033\\f0\\fs16 ",
-
- */
char szRtfHeader[400];
- int nSrcLen = mir_snprintf(szRtfHeader, _countof(szRtfHeader),
+ int nSrcLen = mir_snprintf(szRtfHeader,
"{\\rtf1\\ansi\r\n"
"{\\colortbl ;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}\r\n"
"\\viewkind4\\uc1\\pard\\cf2 ",
@@ -625,9 +619,9 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) TCHAR szTmp[1500];
if (nDBCount == -1)
- mir_sntprintf(szTmp, _countof(szTmp), TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
+ mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
else
- mir_sntprintf(szTmp, _countof(szTmp), TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
+ mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
SETTEXTEX stText = { 0 };
stText.codepage = 1200;
@@ -674,7 +668,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) CloseHandle(hFile);
TCHAR szTmp[100];
- mir_sntprintf(szTmp, _countof(szTmp), _T("File open time %d\n"), GetTickCount() - dwStart);
+ mir_sntprintf(szTmp, _T("File open time %d\n"), GetTickCount() - dwStart);
OutputDebugString(szTmp);
GETTEXTLENGTHEX sData = { 0 };
@@ -686,7 +680,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) if (!bScrollToBottom)
SendMessage(hRichEdit, EM_SETSCROLLPOS, 0, (LPARAM)&ptOldPos);
- mir_sntprintf(szTmp, _countof(szTmp), TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
+ mir_sntprintf(szTmp, TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
OutputDebugString(szTmp);
return true;
}
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 3a46bc8617..6611f692da 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -706,7 +706,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar DWORD dwUIN = db_get_dw(hContact, sTmpA.c_str(), "UIN", 0);
TCHAR szTmp[50];
- mir_sntprintf(szTmp, _countof(szTmp), _T("%d"), dwUIN);
+ mir_sntprintf(szTmp, _T("%d"), dwUIN);
sItem.iSubItem = 3;
sItem.pszText = szTmp;
ListView_SetItem(hMapUser, &sItem);
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index f078536f62..2cc790b844 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -464,7 +464,7 @@ bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize) char cBuf[10];
BYTE *p = (BYTE*)pData;
for (int n = 0; n < nSize; n++) {
- mir_snprintf(cBuf, _countof(cBuf), "%.2X ", p[n]);
+ mir_snprintf(cBuf, "%.2X ", p[n]);
if (!bWriteToFile(hFile, cBuf, 3))
return false;
}
@@ -702,7 +702,7 @@ void ReplaceDefines(MCONTACT hContact, tstring & sTarget) tstring sReplaceUin;
if (dwUIN) {
TCHAR sTmp[20];
- mir_sntprintf(sTmp, _countof(sTmp), _T("%d"), dwUIN);
+ mir_sntprintf(sTmp, _T("%d"), dwUIN);
sReplaceUin = sTmp;
}
else sReplaceUin = FileNickFromHandle(hContact);
@@ -784,11 +784,11 @@ void ReplaceTimeVariables(tstring &sRet) GetLocalTime(&stTime);
TCHAR sTmp[20];
- mir_sntprintf(sTmp, _countof(sTmp), _T("%d"), stTime.wYear);
+ mir_sntprintf(sTmp, _T("%d"), stTime.wYear);
ReplaceAll(sRet, _T("%year%"), sTmp);
- mir_sntprintf(sTmp, _countof(sTmp), _T("%.2d"), stTime.wMonth);
+ mir_sntprintf(sTmp, _T("%.2d"), stTime.wMonth);
ReplaceAll(sRet, _T("%month%"), sTmp);
- mir_sntprintf(sTmp, _countof(sTmp), _T("%.2d"), stTime.wDay);
+ mir_sntprintf(sTmp, _T("%.2d"), stTime.wDay);
ReplaceAll(sRet, _T("%day%"), sTmp);
}
}
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 1bd0754b8f..638d0a928f 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -134,7 +134,7 @@ int Protocol::GetStatus() else {
TCHAR *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
if (tszXStatusMessage[0])
- mir_sntprintf(status_name, _countof(status_name), _T("%s: %s"), p, tszXStatusMessage);
+ mir_sntprintf(status_name, _T("%s: %s"), p, tszXStatusMessage);
else
lcopystr(status_name, p, _countof(status_name));
}
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 8bf2303ab8..f51ce6a877 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1474,7 +1474,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Enable listening to for %s"), proto->description);
+ mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1712,7 +1712,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my avatar for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1752,7 +1752,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my nickname for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1800,7 +1800,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (protocols->CanSetStatusMsgPerProtocol()) {
// Add this proto to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1819,7 +1819,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
// Add this to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1882,7 +1882,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Enable listening to for %s"), proto->description);
+ mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1898,7 +1898,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
// Add this to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -1917,7 +1917,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (protocols->CanSetStatusMsgPerProtocol()) {
// Add this proto to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -1935,7 +1935,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
}
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my nickname for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -1952,7 +1952,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my avatar for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index 726ae3c5c0..2cb64f53bd 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -70,7 +70,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam Protocol *proto = protocols->Get(proto_num);
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my nickname for %s"), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my nickname for %s"), proto->description);
SetWindowText(hwndDlg, tmp);
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w }
TCHAR title[256];
- mir_sntprintf(title, _countof(title), TranslateT("Set my status message for %s"), proto->description);
+ mir_sntprintf(title, TranslateT("Set my status message for %s"), proto->description);
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(NULL, data->status));
TCHAR title[256];
- mir_sntprintf(title, _countof(title), TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
+ mir_sntprintf(title, TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 06df823b98..e3f7547623 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -306,11 +306,11 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) // the protocol supports status message sending for current status, or autoreplying
if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) ||
((Flag1 & PF1_IM) == PF1_IM && (i < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[i].DisableReplyCtlID))))
- mir_sntprintf(szSetStr, _countof(szSetStr), TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szSetStr, TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
// the protocol supports status message reading for contact's status
if (Flag1 & PF1_MODEMSGRECV && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iContactMode)) {
- mir_sntprintf(szReadStr, _countof(szReadStr), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
+ mir_sntprintf(szReadStr, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
hReadMsgIcon = Skin_LoadProtoIcon(szProto, iContactMode);
}
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index 2d004aa625..66f7160ccf 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -69,7 +69,7 @@ void ShowLog(TCString &LogFilePath) INT_PTR Result = (INT_PTR)ShellExecute(NULL, _T("open"), LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) {
TCHAR szError[64];
- mir_sntprintf(szError, _countof(szError), TranslateT("Error #%d"), Result);
+ mir_sntprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
}
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 849633183a..6eb8f63e33 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -70,10 +70,10 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam char *szProto = GetContactProto(awayData->hContact);
TCHAR *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status, contactName);
+ mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
GetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status);
+ mir_sntprintf(str, format, status);
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, str);
}
return true;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 6d0f2ae624..d974547d69 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -433,7 +433,7 @@ void UpdateCheckboxesState(CCList *CList) HICON g_LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "", name);
+ mir_snprintf(szSettingName, "%s_%s", "", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -848,7 +848,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA return true;
}
TCHAR BtnTitle[64];
- mir_sntprintf(BtnTitle, _countof(BtnTitle), TranslateT("Closing in %d"), Countdown);
+ mir_sntprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
Countdown--;
}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 0dad1d5e4e..089db2de2b 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -231,7 +231,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) if (pcBlob >= pcEnd)
break;
}
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Received %d contacts."), nContacts);
+ mir_sntprintf(szBuf, TranslateT("Received %d contacts."), nContacts);
comment1 = mir_tstrdup(szBuf);
}
commentFix = POPUP_COMMENT_CONTACTS;
@@ -254,7 +254,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
char *pszEmail = pszLast + mir_strlen(pszLast) + 1;
- mir_snprintf(szUin, _countof(szUin), "%d", *((DWORD*)dbei->pBlob));
+ mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
szNick = mir_utf8decodeT(pszNick);
@@ -290,7 +290,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
char *pszEmail = pszLast + mir_strlen(pszLast) + 1;
- mir_snprintf(szUin, _countof(szUin), "%d", *((DWORD*)dbei->pBlob));
+ mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
szNick = mir_utf8decodeT(pszNick);
@@ -540,12 +540,12 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) TCHAR lpzText[MAX_SECONDLINE*2] = _T("\0\0");
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(lpzText, _countof(lpzText), TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
+ mir_sntprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
int doReverse = pdata->pluginOptions->bShowON;
if ((pdata->firstShowEventData != pdata->firstEventData && doReverse) || (pdata->firstShowEventData != pdata->lastEventData && !doReverse))
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s...\n"), lpzText);
+ mir_sntprintf(lpzText, _T("%s...\n"), lpzText);
//take the active event as starting one
EVENT_DATA_EX *eventData = pdata->firstShowEventData;
@@ -578,12 +578,12 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) mir_tstrncat(formatTime, _T(" %H:%M"), _countof(formatTime) - mir_tstrlen(formatTime));
time_t localTime = dbe.timestamp;
_tcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s[b][i]%s[/i][/b]\n"), lpzText, timestamp);
+ mir_sntprintf(lpzText, _T("%s[b][i]%s[/i][/b]\n"), lpzText, timestamp);
}
// prepare event preview
TCHAR* szEventPreview = GetEventPreview(&dbe);
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s%s"), lpzText, szEventPreview);
+ mir_sntprintf(lpzText, _T("%s%s"), lpzText, szEventPreview);
mir_free(szEventPreview);
if (dbe.pBlob)
@@ -595,11 +595,11 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) else if ((iEvent >= pdata->pluginOptions->iNumberMsg && pdata->pluginOptions->iNumberMsg) || !eventData->prev)
break;
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s\n"), lpzText);
+ mir_sntprintf(lpzText, _T("%s\n"), lpzText);
}
if ((doReverse && eventData->next) || (!doReverse && eventData->prev))
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s\n..."), lpzText);
+ mir_sntprintf(lpzText, _T("%s\n..."), lpzText);
PUChangeTextT(pdata->hWnd, lpzText);
return 0;
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 89488d3843..01a12dcdde 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -72,9 +72,9 @@ TCHAR *SelectSound(HWND hwndDlg, TCHAR *buff, size_t bufflen) ofn.hInstance = hInst;
TCHAR filter[MAX_PATH];
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(filter, _countof(filter), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
- mir_sntprintf(filter, _countof(filter), _T("%s (*.wav)%c*.wav%c%s (*.*)%c*%c"), TranslateT("Wave files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.wav)%c*.wav%c%s (*.*)%c*%c"), TranslateT("Wave files"), 0, 0, TranslateT("All files"), 0, 0);
ofn.lpstrFilter = filter;
ofn.lpstrFile = buff;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR;
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index e4091cb972..b2eead3fa9 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -88,7 +88,7 @@ BYTE GetGender(MCONTACT hContact) HANDLE GetIconHandle(char *szIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, szIcon);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, szIcon);
return IcoLib_GetIconHandle(szSettingName);
}
@@ -416,8 +416,8 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) // check if that proto from which we received statuschange notification, isn't in autodisable list
if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
- mir_snprintf(statusIDs, _countof(statusIDs), "s%d", myStatus);
- mir_snprintf(statusIDp, _countof(statusIDp), "p%d", myStatus);
+ mir_snprintf(statusIDs, "s%d", myStatus);
+ mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : TRUE;
bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : TRUE;
}
@@ -442,7 +442,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) if (opt.BlinkIcon && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, newStatus) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
+ mir_sntprintf(str, TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
BlinkIcon(hContact, hIcon, str);
}
@@ -458,7 +458,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("HH':'mm"), stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("dd/MM/yyyy"), stzDate, _countof(stzDate));
- mir_sntprintf(stzText, _countof(stzText), TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
+ mir_sntprintf(stzText, TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText,
StatusList[Index(oldStatus)].lpzStandardText);
LogToFile(stzText);
@@ -552,7 +552,7 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) }
else if (strstr(cws->szSetting, "text")) {
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%s", szSetting, "Msg");
+ mir_snprintf(dbSetting, "%s%s", szSetting, "Msg");
smi.compare = CompareStatusMsg(&smi, cws, dbSetting);
if (smi.compare == COMPARE_SAME) {
replaceStrT(smi.newstatusmsg, 0);
@@ -650,11 +650,11 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) goto skip_notify;
char dbSetting[64];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto);
+ mir_snprintf(dbSetting, "%s_enabled", szProto);
// this proto is not set for status message notifications
if (db_get_b(NULL, MODULE, dbSetting, 1) == 0)
goto skip_notify;
- mir_snprintf(dbSetting, _countof(dbSetting), "%d", IDC_CHK_STATUS_MESSAGE);
+ mir_snprintf(dbSetting, "%d", IDC_CHK_STATUS_MESSAGE);
// status message change notifications are disabled
if (db_get_b(NULL, MODULE, dbSetting, 1) == 0)
goto skip_notify;
@@ -665,8 +665,8 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) // check if our status isn't on autodisable list
if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
- mir_snprintf(statusIDs, _countof(statusIDs), "s%d", myStatus);
- mir_snprintf(statusIDp, _countof(statusIDp), "p%d", myStatus);
+ mir_snprintf(statusIDs, "s%d", myStatus);
+ mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : bEnableSound;
bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : bEnablePopup;
}
@@ -694,7 +694,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) TCHAR *str;
if (smi.compare == COMPARE_DEL) {
char protoname[MAX_PATH];
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgRemoved", szProto);
+ mir_snprintf(protoname, "%s_TPopupSMsgRemoved", szProto);
DBVARIANT dbVar = { 0 };
if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED);
@@ -706,7 +706,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) }
else {
char protoname[MAX_PATH];
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgChanged", szProto);
+ mir_snprintf(protoname, "%s_TPopupSMsgChanged", szProto);
DBVARIANT dbVar = { 0 };
if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED);
@@ -732,7 +732,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (opt.BlinkIcon && opt.BlinkIcon_ForMsgs && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, db_get_w(hContact, szProto, "Status", ID_STATUS_ONLINE)) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
+ mir_sntprintf(str, TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
BlinkIcon(hContact, hIcon, str);
}
@@ -759,7 +759,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) else
str = GetStr(&smi, templates.LogSMsgChanged);
- mir_sntprintf(stzText, _countof(stzText), _T("%s, %s. %s %s\r\n"), stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), str);
+ mir_sntprintf(stzText, _T("%s, %s. %s %s\r\n"), stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), str);
LogToFile(stzText);
mir_free(str);
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 9096d049ba..d97a4993bb 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -218,7 +218,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
//Statuses notified
char status[8];
- mir_snprintf(status, _countof(status), "%d", i);
+ mir_snprintf(status, "%d", i);
CheckDlgButton(hwndDlg, i, db_get_b(0, MODULE, status, 1) ? BST_CHECKED : BST_UNCHECKED);
}
CheckDlgButton(hwndDlg, IDC_CHK_FROMOFFLINE, opt.FromOffline ? BST_CHECKED : BST_UNCHECKED);
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ofn.nMaxFile = MAX_PATH;
ofn.hwndOwner = hwndDlg;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c"), TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c"), TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 2;
ofn.lpstrInitialDir = buff;
@@ -289,7 +289,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA //Notified statuses
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
char status[8];
- mir_snprintf(status, _countof(status), "%d", i);
+ mir_snprintf(status, "%d", i);
db_set_b(NULL, MODULE, status, (BYTE)IsDlgButtonChecked(hwndDlg, i));
}
opt.FromOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_FROMOFFLINE);
@@ -729,7 +729,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DBVARIANT dbVar = { 0 };
char protoname[MAX_PATH] = { 0 };
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgChanged", protos[i]->szModuleName);
+ mir_snprintf(protoname, "%s_TPopupSMsgChanged", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
_tcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
@@ -737,7 +737,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA db_free(&dbVar);
}
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
+ mir_snprintf(protoname, "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
_tcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
@@ -749,7 +749,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ProtoTemplates.insert(prototemplate, ProtoTemplates.getCount());
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULE, dbSetting, TRUE));
lvItem.iItem++;
}
@@ -862,7 +862,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_GetItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
+ mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam);
db_set_b(NULL, MODULE, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 98de23ac0b..7aed434811 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -85,7 +85,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) TCHAR stzText[1024];
if (pstzLast)
- mir_sntprintf(stzText, _countof(stzText), _T("%s\n%s"), pstzLast, tszStatus);
+ mir_sntprintf(stzText, _T("%s\n%s"), pstzLast, tszStatus);
else
_tcsncpy(stzText, tszStatus, _countof(stzText));
SendMessage(pdp->hWnd, WM_SETREDRAW, FALSE, 0);
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 644134d4da..55696fc3c4 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -226,7 +226,7 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc) HICON hIcon = NULL;
TCHAR str[256] = { 0 };
TCHAR stzType[32];
- mir_sntprintf(str, _countof(str), TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
+ mir_sntprintf(str, TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
if (opt.BlinkIcon_Status) {
DBVARIANT dbv;
@@ -337,7 +337,7 @@ void LogChangeToFile(XSTATUSCHANGE *xsc) Template = templates.LogXMsgRemoved; break;
}
- mir_sntprintf(stzText, _countof(stzText), _T("%s, %s. %s %s\r\n"), stzDate, stzTime,
+ mir_sntprintf(stzText, _T("%s, %s. %s %s\r\n"), stzDate, stzTime,
pcli->pfnGetContactDisplayName(xsc->hContact, 0), ReplaceVars(xsc, Template).GetString());
LogToFile(stzText);
@@ -369,8 +369,8 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
WORD myStatus = (WORD)CallProtoService(xsc->szProto, PS_GETSTATUS, 0, 0);
- mir_snprintf(statusIDs, _countof(statusIDs), "s%d", myStatus);
- mir_snprintf(statusIDp, _countof(statusIDp), "p%d", myStatus);
+ mir_snprintf(statusIDs, "s%d", myStatus);
+ mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : bEnableSound;
bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : bEnablePopup;
}
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index a838e205b6..83a78ee173 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -57,7 +57,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) HXML child = xmlGetChild(chan, j);
if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, _T("koi8-r"))) {
TCHAR buf[MAX_PATH];
@@ -74,7 +74,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) HXML child = xmlGetChild(node, j);
if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, _T("koi8-r"))) {
TCHAR buf[MAX_PATH];
@@ -93,7 +93,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) }
Netlib_LogfT(hNetlibUser, _T("%s is not a valid feed's address."), tszURL);
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis not a valid feed's address."), tszURL);
+ mir_sntprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR);
return NULL;
}
@@ -229,7 +229,7 @@ void CheckCurrentFeed(MCONTACT hContact) LPCTSTR szAttrName = xmlGetAttrName(node, i);
if (!mir_tstrcmpi(szAttrName, _T("version"))) {
TCHAR ver[MAX_PATH];
- mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xmlGetAttrValue(node, szAttrName));
+ mir_sntprintf(ver, _T("RSS %s"), xmlGetAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
}
@@ -346,7 +346,7 @@ void CheckCurrentFeed(MCONTACT hContact) CMString filename = szNick;
filename.Replace(_T("/"), _T("_"));
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename.c_str(), ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename.c_str(), ext);
CreateDirectoryTreeT(tszRoot);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -487,7 +487,7 @@ void CheckCurrentFeed(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -632,7 +632,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -665,7 +665,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index fe4b799d76..20384c3e18 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -130,7 +130,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if ( !group)
group = (TCHAR *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
else {
- mir_sntprintf(tmpgroup, _countof(tmpgroup), _T("%s\\%s"), xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
+ mir_sntprintf(tmpgroup, _T("%s\\%s"), xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
group = tmpgroup;
}
break;
@@ -209,9 +209,9 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
TCHAR mes[MAX_PATH];
if (DUPES)
- mir_sntprintf(mes, _countof(mes), TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
+ mir_sntprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
else
- mir_sntprintf(mes, _countof(mes), TranslateT("Imported %d feed(s)."), count);
+ mir_sntprintf(mes, TranslateT("Imported %d feed(s)."), count);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
}
}
@@ -228,7 +228,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.opml, *.xml)%c*.opml;*.xml%c%c"), TranslateT("OPML files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.opml, *.xml)%c*.opml;*.xml%c%c"), TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
@@ -491,7 +491,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.opml)%c*.opml%c%c"), TranslateT("OPML files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.opml)%c*.opml%c%c"), TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/NewsAggregator/Src/Icons.cpp b/plugins/NewsAggregator/Src/Icons.cpp index 9a25f711c1..8cfd2716e2 100644 --- a/plugins/NewsAggregator/Src/Icons.cpp +++ b/plugins/NewsAggregator/Src/Icons.cpp @@ -39,7 +39,7 @@ void InitIcons() HICON LoadIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, name);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index dfdf630c21..80810f8a26 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -95,7 +95,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_TAGHELP:
TCHAR tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, _countof(tszTagHelp), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTagHelp, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("#<title>#"), TranslateT("The title of the item."),
_T("#<description>#"), TranslateT("The item synopsis."),
_T("#<link>#"), TranslateT("The URL of the item."),
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP:
TCHAR tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, _countof(tszTagHelp), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTagHelp, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("#<title>#"), TranslateT("The title of the item."),
_T("#<description>#"), TranslateT("The item synopsis."),
_T("#<link>#"), TranslateT("The URL of the item."),
@@ -418,7 +418,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP:
TCHAR tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, _countof(tszTagHelp), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTagHelp, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("#<title>#"), TranslateT("The title of the item."),
_T("#<description>#"), TranslateT("The item synopsis."),
_T("#<link>#"), TranslateT("The URL of the item."),
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 33c9778e0f..855d2eef6f 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -157,7 +157,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (!db_get_w(NULL, MODNAME, "Timer", 1))
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, TranslateT("Non-IM Contact protocol timer is Disabled"));
else {
- mir_sntprintf(string, _countof(string), TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"), db_get_w(NULL, MODNAME, "Timer", 1));
+ mir_sntprintf(string, TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"), db_get_w(NULL, MODNAME, "Timer", 1));
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, string);
}
}
@@ -200,7 +200,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case IDC_OPEN_FOLDER:
if (BrowseForFolder(hwnd, szFileName)) {
- mir_snprintf(szFileName, _countof(szFileName), "%s ,/e", szFileName);
+ mir_snprintf(szFileName, "%s ,/e", szFileName);
SetDlgItemTextA(hwnd, IDC_LINK, "explorer.exe");
SetDlgItemTextA(hwnd, IDC_PARAMS, szFileName);
}
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index c5fdf36770..469fd1ee73 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -288,7 +288,7 @@ void DoPropertySheet(MCONTACT hContact) psh.hInstance = g_hInst;
psh.pszIcon = MAKEINTRESOURCEA(IDI_MAIN);
db_get_static(hContact, MODNAME, "Nick", nick, _countof(nick));
- mir_snprintf(title, _countof(title), Translate("Edit Non-IM Contact \"%s\""), nick);
+ mir_snprintf(title, Translate("Edit Non-IM Contact \"%s\""), nick);
psh.pszCaption = title;
psh.nPages = _countof(psp);
psh.ppsp = (LPCPROPSHEETPAGEA)&psp;
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp index c97369d641..9f37274b1f 100644 --- a/plugins/Non-IM Contact/src/files.cpp +++ b/plugins/Non-IM Contact/src/files.cpp @@ -114,7 +114,7 @@ void readFile(HWND hwnd) }
if (!strncmp("http://", szFileName, mir_strlen("http://")) || !strncmp("https://", szFileName, mir_strlen("https://")))
- mir_snprintf(szFileName, _countof(szFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
+ mir_snprintf(szFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
FILE *filen = fopen(szFileName, "r");
if (!filen) {
@@ -130,7 +130,7 @@ void readFile(HWND hwnd) else if (temp[mir_strlen(temp) - 1] == '\n')
temp[mir_strlen(temp) - 1] = '\0';
else temp[mir_strlen(temp)] = '\0';
- mir_snprintf(temp1, _countof(temp1), Translate("line(%-3d) = | %s"), lineNumber, temp);
+ mir_snprintf(temp1, Translate("line(%-3d) = | %s"), lineNumber, temp);
SendDlgItemMessageA(hwnd, IDC_FILE_CONTENTS, LB_ADDSTRING, 0, (LPARAM)temp1);
lineNumber++;
fileLength++;
@@ -186,7 +186,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (!db_get_static(NULL, MODNAME, fn, text, _countof(text)))
break;
}
- mir_snprintf(szFileName, _countof(szFileName), "%s\\plugins\\%s.html", getMimDir(temp), fn);
+ mir_snprintf(szFileName, "%s\\plugins\\%s.html", getMimDir(temp), fn);
if (savehtml(szFileName)) {
mir_snprintf(fn, "fn%d", i);
db_set_s(NULL, MODNAME, fn, url);
diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 973d689ee3..32237af843 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -3,7 +3,7 @@ int readFileIntoArray(int fileNumber, char *FileContents[])
{
char dbSetting[20], temp[MAX_STRING_LENGTH];
- mir_snprintf(dbSetting, _countof(dbSetting), "fn%d", fileNumber);
+ mir_snprintf(dbSetting, "fn%d", fileNumber);
char *szVar = db_get_sa(NULL, MODNAME, dbSetting);
if (szVar == NULL)
@@ -11,7 +11,7 @@ int readFileIntoArray(int fileNumber, char *FileContents[]) char tszFileName[MAX_PATH];
if (!strncmp("http://", szVar, 7) || !strncmp("https://", szVar, 7))
- mir_snprintf(tszFileName, _countof(tszFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
+ mir_snprintf(tszFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
else
mir_strncpy(tszFileName, szVar, _countof(tszFileName));
mir_free(szVar);
@@ -405,7 +405,7 @@ int lastChecked(CMStringA &szNewStr, const char *str) return 0;
if (!strncmp("http://", szVar, 7) || !strncmp("https://", szVar, 8))
- mir_snprintf(tszFileName, _countof(tszFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), file);
+ mir_snprintf(tszFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), file);
else
mir_strncpy(tszFileName, szVar, _countof(tszFileName));
mir_free(szVar);
@@ -417,7 +417,7 @@ int lastChecked(CMStringA &szNewStr, const char *str) if (GetLastWriteTime(hFile, tszFileName)) {
CloseHandle(hFile);
szNewStr.Append(tszFileName);
- mir_snprintf(tszFileName, _countof(tszFileName), "%s%d))", szPattern, file);
+ mir_snprintf(tszFileName, "%s%d))", szPattern, file);
return (int)mir_strlen(tszFileName);
}
CloseHandle(hFile);
@@ -540,7 +540,7 @@ int stringReplacer(const char *oldString, CMStringA &szNewString, MCONTACT hCont return ERROR_NO_FILE;
}
else {
- mir_snprintf(tempString, _countof(tempString), "fn%d", tempInt);
+ mir_snprintf(tempString, "fn%d", tempInt);
if (db_get_static(NULL, MODNAME, tempString, tempString, _countof(tempString)))
szNewString.Append(tempString);
else return ERROR_NO_FILE;
@@ -623,7 +623,7 @@ void replaceAllStrings(MCONTACT hContact) /* tooltips*/
WriteSetting(hContact, MODNAME, "ToolTip", "UserInfo", "MyNotes");
if (db_get_static(hContact, MODNAME, "Program", tmp1, _countof(tmp1)) && db_get_static(hContact, MODNAME, "ProgramParams", tmp2, _countof(tmp2))) {
- mir_snprintf(tmp3, _countof(tmp3), "%s %s", tmp1, tmp2);
+ mir_snprintf(tmp3, "%s %s", tmp1, tmp2);
db_set_s(hContact, "UserInfo", "FirstName", tmp3);
}
else if (db_get_static(hContact, MODNAME, "Program", tmp1, _countof(tmp1))) {
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp index 3bf775e6fa..b7851eb1d1 100644 --- a/plugins/Non-IM Contact/src/timer.cpp +++ b/plugins/Non-IM Contact/src/timer.cpp @@ -32,7 +32,7 @@ void timerFunc(void*) int timer = db_get_w(NULL, MODNAME, fn, 60);
if (timer && !(timerCount % timer)) {
if (!InternetDownloadFile(text)) {
- mir_snprintf(szFileName, _countof(szFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), i);
+ mir_snprintf(szFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), i);
savehtml(szFileName);
}
}
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 8ad6753abf..b017f04e94 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -381,7 +381,7 @@ void LoadNotes(BOOL bIsStartup) { char *DelPos; - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); if (Value) { @@ -694,7 +694,7 @@ void PurgeNotes(void) NotesCount = db_get_dw(0,MODULENAME,"NotesData",0); for(I = 0; I < NotesCount; I++) { - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); db_unset(0,MODULENAME,ValueName); } } @@ -940,7 +940,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) Value[0xffff] = 0; } - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB + mir_snprintf(ValueName, "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB db_set_blob(0, MODULENAME, ValueName, Value, n+1); @@ -956,7 +956,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) // delete any left over DB note entries for(; I < OldNotesCount; I++) { - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); db_unset(0,MODULENAME,ValueName); } diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 8e4238cff7..e356728c4a 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -215,7 +215,7 @@ void PurgeReminders(void) ReminderCount = db_get_dw(0,MODULENAME,"RemindersData",0);
for(I = 0;I < ReminderCount;I++)
{
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -287,7 +287,7 @@ void JustSaveReminders(void) Value[0xffff] = 0;
}
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
+ mir_snprintf(ValueName, "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
db_set_blob(0, MODULENAME, ValueName, Value, n+1);
@@ -297,7 +297,7 @@ void JustSaveReminders(void) // delete any left over DB reminder entries
for(; I < OldReminderCount; I++)
{
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -317,7 +317,7 @@ void LoadReminders(void) {
Size = 65535;
Value = NULL;
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
ReadSettingBlob(0, MODULENAME, ValueName, &Size, (void**)&Value);
@@ -607,7 +607,7 @@ INT_PTR OpenTriggeredReminder(WPARAM w, LPARAM l) pReminder->handle = H = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_NOTIFYREMINDER), 0, DlgProcNotifyReminder);
- mir_snprintf(S, _countof(S), "%s! - %s", Translate("Reminder"), S1);
+ mir_snprintf(S, "%s! - %s", Translate("Reminder"), S1);
SetWindowText(H, S);
if (pReminder->Reminder)
@@ -642,7 +642,7 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName) char szShort[MAX_PATH];
char s[512];
GetShortPathNameA(szFull, szShort, sizeof(szShort));
- mir_snprintf(s, _countof(s), "play \"%s\"", szShort);
+ mir_snprintf(s, "play \"%s\"", szShort);
mciSendStringA(s, NULL, 0, NULL);
}
@@ -1055,7 +1055,7 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S const int m = (i&1) ? 30 : 0;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
// item data contains time offset from midnight in seconds (bit 31 is set to flag that
// combo box items are absolute times and not relative times like below
@@ -1086,35 +1086,35 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S FileTimeToTzLocalST((FILETIME*)&li, &tm2);
wCurHour = tm2.wHour;
wCurMinute = tm2.wMinute;
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 5 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 10 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 15 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 30 minutes
li.QuadPart += (ULONGLONG)15 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
@@ -1142,13 +1142,13 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S }
// icq-style display 1.0, 1.5 etc. hours even though that isn't accurate due to rounding
- //mir_snprintf(s, _countof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
+ //mir_snprintf(s, "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
// display delta time more accurately to match reformatting (that icq doesn't do)
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(s, _countof(s), "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
else
- mir_snprintf(s, _countof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
+ mir_snprintf(s, "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDTime,CB_SETITEMDATA,n, dt*60);
@@ -1179,39 +1179,39 @@ static void PopulateTimeOffsetCombo(HWND Dialog, UINT nIDCombo) // 5 - 55 minutes (in 5 minute steps)
for (i = 1; i < 12; i++)
{
- mir_snprintf(s, _countof(s), "%d %s", i*5, lpszMinutes);
+ mir_snprintf(s, "%d %s", i*5, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, i*5);
}
// 1 hour
- mir_snprintf(s, _countof(s), "1 %s", lpszHour);
+ mir_snprintf(s, "1 %s", lpszHour);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 60);
// 2, 4, 8 hours
for (i = 2; i <= 8; i+=2)
{
- mir_snprintf(s, _countof(s), "%d %s", i, lpszHours);
+ mir_snprintf(s, "%d %s", i, lpszHours);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*60);
}
// 1 day
- mir_snprintf(s, _countof(s), "1 %s", lpszDay);
+ mir_snprintf(s, "1 %s", lpszDay);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 24*60);
// 2-4 days
for (i = 2; i <= 4; i++)
{
- mir_snprintf(s, _countof(s), "%d %s", i, lpszDays);
+ mir_snprintf(s, "%d %s", i, lpszDays);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*24*60);
}
// 1 week
- mir_snprintf(s, _countof(s), "1 %s", lpszWeek);
+ mir_snprintf(s, "1 %s", lpszWeek);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 7*24*60);
}
@@ -1570,7 +1570,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP // which could potentially mess up things otherwise)
{
char s[32];
- mir_snprintf(s, _countof(s), "%I64x", li.QuadPart);
+ mir_snprintf(s, "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1915,7 +1915,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA // which could potentially mess up things otherwise)
{
char s[32];
- mir_snprintf(s, _countof(s), "%I64x", li.QuadPart);
+ mir_snprintf(s, "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1938,7 +1938,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA {
int n;
char s[32];
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
// search for preset first
n = SendDlgItemMessage(Dialog, IDC_TIME, CB_FINDSTRING, (WPARAM)-1, (LPARAM)s);
@@ -1966,33 +1966,33 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)Translate("Never"));
SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_SETITEMDATA, n, 0);
- mir_snprintf(s, _countof(s), "%s 5 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 5 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)5);
- mir_snprintf(s, _countof(s), "%s 10 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 10 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)10);
- mir_snprintf(s, _countof(s), "%s 15 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 15 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)15);
- mir_snprintf(s, _countof(s), "%s 20 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 20 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)20);
- mir_snprintf(s, _countof(s), "%s 30 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 30 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)30);
- mir_snprintf(s, _countof(s), "%s 60 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 60 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)60);
if (NewReminderVisible == 2 && pEditReminder->RepeatSound)
{
- mir_snprintf(s, _countof(s), "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
+ mir_snprintf(s, "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
SetDlgItemText(Dialog, IDC_COMBO_REPEATSND, s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETCURSEL, SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)s), 0);
}
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 53fc784290..526d7010b5 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -51,7 +51,7 @@ INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam) int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
TCHAR msg[500];
- mir_sntprintf(msg, _countof(msg), TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
+ mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
CNudgeElement &p = arNudges[i];
@@ -208,8 +208,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) void LoadProtocols(void)
{
//Load the default nudge
- mir_snprintf(DefaultNudge.ProtocolName, _countof(DefaultNudge.ProtocolName), "Default");
- mir_snprintf(DefaultNudge.NudgeSoundname, _countof(DefaultNudge.NudgeSoundname), "Nudge : Default");
+ mir_snprintf(DefaultNudge.ProtocolName, "Default");
+ mir_snprintf(DefaultNudge.NudgeSoundname, "Nudge : Default");
SkinAddNewSoundEx(DefaultNudge.NudgeSoundname, LPGEN("Nudge"), LPGEN("Default Nudge"));
DefaultNudge.Load();
@@ -513,7 +513,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) // Add a specific sound per protocol
CNudgeElement *p = new CNudgeElement();
- mir_snprintf(p->NudgeSoundname, _countof(p->NudgeSoundname), "%s: Nudge", proto->szModuleName);
+ mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);
strcpy_s(p->ProtocolName, proto->szModuleName);
_tcscpy_s(p->AccountName, proto->tszAccountName);
@@ -522,7 +522,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) p->hEvent = hevent;
TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
- mir_sntprintf(soundDesc, _countof(soundDesc), LPGENT("Nudge for %s"), proto->tszAccountName);
+ mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);
arNudges.insert(p);
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 65b56df049..1e0d6a0576 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -3,55 +3,55 @@ void CNudge::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "useByProtocol");
+ mir_snprintf(SectionName, "useByProtocol");
db_set_b(NULL, MODULENAME, SectionName, this->useByProtocol);
- mir_snprintf(SectionName, _countof(SectionName), "RecvTimeSec");
+ mir_snprintf(SectionName, "RecvTimeSec");
db_set_dw(NULL, MODULENAME, SectionName, this->recvTimeSec);
- mir_snprintf(SectionName, _countof(SectionName), "SendTimeSec");
+ mir_snprintf(SectionName, "SendTimeSec");
db_set_dw(NULL, MODULENAME, SectionName, this->sendTimeSec);
- mir_snprintf(SectionName, _countof(SectionName), "ResendDelaySec");
+ mir_snprintf(SectionName, "ResendDelaySec");
db_set_dw(NULL, MODULENAME, SectionName, this->resendDelaySec);
}
void CNudge::Load(void)
{
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "useByProtocol");
+ mir_snprintf(SectionName, "useByProtocol");
this->useByProtocol = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "RecvTimeSec");
+ mir_snprintf(SectionName, "RecvTimeSec");
this->recvTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30);
- mir_snprintf(SectionName, _countof(SectionName), "SendTimeSec");
+ mir_snprintf(SectionName, "SendTimeSec");
this->sendTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30);
- mir_snprintf(SectionName, _countof(SectionName), "ResendDelaySec");
+ mir_snprintf(SectionName, "ResendDelaySec");
this->resendDelaySec = db_get_dw(NULL, MODULENAME, SectionName, 3);
}
void CNudgeElement::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "%s-openMessageWindow", ProtocolName);
+ mir_snprintf(SectionName, "%s-openMessageWindow", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->openMessageWindow);
- mir_snprintf(SectionName, _countof(SectionName), "%s-openContactList", ProtocolName);
+ mir_snprintf(SectionName, "%s-openContactList", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->openContactList);
- mir_snprintf(SectionName, _countof(SectionName), "%s-useIgnore", ProtocolName);
+ mir_snprintf(SectionName, "%s-useIgnore", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->useIgnoreSettings);
- mir_snprintf(SectionName, _countof(SectionName), "%s-showStatus", ProtocolName);
+ mir_snprintf(SectionName, "%s-showStatus", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->showStatus);
- mir_snprintf(SectionName, _countof(SectionName), "%s-showPopup", ProtocolName);
+ mir_snprintf(SectionName, "%s-showPopup", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->showPopup);
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeClist", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeClist", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->shakeClist);
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeChat", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeChat", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->shakeChat);
- mir_snprintf(SectionName, _countof(SectionName), "%s-enabled", ProtocolName);
+ mir_snprintf(SectionName, "%s-enabled", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->enabled);
- mir_snprintf(SectionName, _countof(SectionName), "%s-autoResend", ProtocolName);
+ mir_snprintf(SectionName, "%s-autoResend", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->autoResend);
- mir_snprintf(SectionName, _countof(SectionName), "%s-statusFlags", ProtocolName);
+ mir_snprintf(SectionName, "%s-statusFlags", ProtocolName);
db_set_dw(NULL, MODULENAME, SectionName, this->statusFlags);
- mir_snprintf(SectionName, _countof(SectionName), "%s-recText", ProtocolName);
+ mir_snprintf(SectionName, "%s-recText", ProtocolName);
db_set_ts(NULL, MODULENAME, SectionName, this->recText);
- mir_snprintf(SectionName, _countof(SectionName), "%s-senText", ProtocolName);
+ mir_snprintf(SectionName, "%s-senText", ProtocolName);
db_set_ts(NULL, MODULENAME, SectionName, this->senText);
}
@@ -59,28 +59,28 @@ void CNudgeElement::Load(void) {
DBVARIANT dbv;
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "%s-openMessageWindow", ProtocolName);
+ mir_snprintf(SectionName, "%s-openMessageWindow", ProtocolName);
this->openMessageWindow = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-openContactList", ProtocolName);
+ mir_snprintf(SectionName, "%s-openContactList", ProtocolName);
this->openContactList = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-useIgnore", ProtocolName);
+ mir_snprintf(SectionName, "%s-useIgnore", ProtocolName);
this->useIgnoreSettings = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-showStatus", ProtocolName);
+ mir_snprintf(SectionName, "%s-showStatus", ProtocolName);
this->showStatus = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-showPopup", ProtocolName);
+ mir_snprintf(SectionName, "%s-showPopup", ProtocolName);
this->showPopup = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeClist", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeClist", ProtocolName);
this->shakeClist = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeChat", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeChat", ProtocolName);
this->shakeChat = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-enabled", ProtocolName);
+ mir_snprintf(SectionName, "%s-enabled", ProtocolName);
this->enabled = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-autoResend", ProtocolName);
+ mir_snprintf(SectionName, "%s-autoResend", ProtocolName);
this->autoResend = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-statusFlags", ProtocolName);
+ mir_snprintf(SectionName, "%s-statusFlags", ProtocolName);
this->statusFlags = db_get_dw(NULL, MODULENAME, SectionName, 967);
- mir_snprintf(SectionName,_countof(SectionName),"%s-recText", ProtocolName);
+ mir_snprintf(SectionName, "%s-recText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
_tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
if (_tcsclen(this->recText) < 1)
@@ -89,7 +89,7 @@ void CNudgeElement::Load(void) }
else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
- mir_snprintf(SectionName, _countof(SectionName), "%s-senText", ProtocolName);
+ mir_snprintf(SectionName, "%s-senText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
_tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
if (_tcsclen(this->senText) < 1)
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index 959fafd6bd..57c3da1c79 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -94,14 +94,14 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM TranslateDialogDefault(hwnd);
{
TCHAR szBuf[20];
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nMoveClist);
+ mir_sntprintf(szBuf, _T("%d"), shake.nMoveClist);
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nMoveChat);
+ mir_sntprintf(szBuf, _T("%d"), shake.nMoveChat);
SetDlgItemText(hwnd, IDC_LNUMBER_CHAT, szBuf);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nScaleClist);
+ mir_sntprintf(szBuf, _T("%d"), shake.nScaleClist);
SetDlgItemText(hwnd, IDC_LSCALE_CLIST, szBuf);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nScaleChat);
+ mir_sntprintf(szBuf, _T("%d"), shake.nScaleChat);
SetDlgItemText(hwnd, IDC_LSCALE_CHAT, szBuf);
}
@@ -132,7 +132,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
TCHAR szBuf[20];
DWORD dwPos = SendMessage((HWND)lParam, TBM_GETPOS, 0, 0);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), dwPos);
+ mir_sntprintf(szBuf, _T("%d"), dwPos);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST))
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT))
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 09aa256d42..58c9860669 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -64,7 +64,7 @@ static int ModulesLoaded(WPARAM, LPARAM) HICON LoadIconExEx(const char* IcoLibName, int)
{
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", OPENFOLDER_MODULE_NAME, IcoLibName);
+ mir_snprintf(szSettingName, "%s_%s", OPENFOLDER_MODULE_NAME, IcoLibName);
return IcoLib_GetIcon(szSettingName);
}
diff --git a/plugins/OpenSSL/src/ssl_openssl.cpp b/plugins/OpenSSL/src/ssl_openssl.cpp index 076b36d69e..22f6ba39ca 100644 --- a/plugins/OpenSSL/src/ssl_openssl.cpp +++ b/plugins/OpenSSL/src/ssl_openssl.cpp @@ -270,7 +270,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) } TCHAR szMsgBuf2[512]; - mir_sntprintf(szMsgBuf2, _countof(szMsgBuf2), _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); + mir_sntprintf(szMsgBuf2, _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); char* szMsg = Utf8EncodeT(szMsgBuf2); SslLog(szMsg); diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 656219ef27..bbd50f4347 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -349,33 +349,33 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam if (todo[i].enabled) {
switch (todo[i].FileType) {
case 1:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Pack"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Pack"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 2:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Plugins"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Plugins"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 3:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Icons"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Icons"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 4:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Others"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Others"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 5:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Others"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Others"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
default:
mir_tstrncpy(tszFileDest, tszRoot, _countof(tszFileDest));
break;
}
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%s\\Backups"), tszRoot);
+ mir_sntprintf(tszBuff, _T("%s\\Backups"), tszRoot);
CreateDirectory(tszBuff, NULL);
mir_tstrncpy(tszFileName, todo[i].File.tszDiskPath, _countof(tszFileName));
- mir_sntprintf(todo[i].File.tszDiskPath, _countof(todo[i].File.tszDiskPath), _T("%s\\%s"), tszFileDest, tszFileName);
+ mir_sntprintf(todo[i].File.tszDiskPath, _T("%s\\%s"), tszFileDest, tszFileName);
UpdatesCount++;
tszExt = &todo[i].File.tszDownloadURL[mir_tstrlen(todo[i].File.tszDownloadURL) - 5];
@@ -400,7 +400,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
}
mir_tstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, _countof(todo[i].tszCurVer));
- mir_snprintf(szKey, _countof(szKey), "File_%d_CurrentVersion", todo[i].FileNum);
+ mir_snprintf(szKey, "File_%d_CurrentVersion", todo[i].FileNum);
db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
arFilePath.push_back(todo[i].File.tszDiskPath);
@@ -452,10 +452,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 2:
tszUtilRootPlug = Utils_ReplaceVarsT(_T("%miranda_path%\\Plugins"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootPlug, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootPlug, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootPlug, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootPlug, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRootPlug);
@@ -465,10 +465,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 3:
tszUtilRootIco = Utils_ReplaceVarsT(_T("%miranda_path%\\Icons"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootIco, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootIco, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootIco, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootIco, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRootIco);
@@ -478,10 +478,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 4:
tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRoot);
@@ -491,10 +491,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 5:
tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRoot);
@@ -505,7 +505,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam else { //reminder for not installed pack update
if (Reminder && (UpdatesCount == 1) && (arFileType[0] == 1))
db_set_b(NULL, MODNAME, "Reminder", 2);
- mir_sntprintf(tszBuff, _countof(tszBuff), TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
+ mir_sntprintf(tszBuff, TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
Title = TranslateT("Pack Updater");
Text = tszBuff;
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 53a498be66..c01a16a3e6 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) //Popups nitified
for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
- mir_snprintf(str2, _countof(str2), "Popups%dM", i);
+ mir_snprintf(str2, "Popups%dM", i);
CheckDlgButton(hdlg, (i + 40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hdlg, (i + 1024), (db_get_b(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hdlg, (i + 40071)))
@@ -373,7 +373,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071))));
- mir_snprintf(str2, _countof(str2), "Popups%dM", i);
+ mir_snprintf(str2, "Popups%dM", i);
db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024))));
}
return TRUE;
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 5c2d660079..5b9351986c 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -206,7 +206,7 @@ static void CheckUpdates(void *) // Download version info
pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl));
mir_tstrncpy(pFileUrl->tszDownloadURL, tszDownloadURL, _countof(pFileUrl->tszDownloadURL));
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%s\\tmp.ini"), tszRoot);
+ mir_sntprintf(tszBuff, _T("%s\\tmp.ini"), tszRoot);
mir_tstrncpy(pFileUrl->tszDiskPath, tszBuff, _countof(pFileUrl->tszDiskPath));
mir_tstrncpy(tszTmpIni, tszBuff, _countof(tszTmpIni));
Title = TranslateT("Pack Updater");
@@ -221,14 +221,14 @@ static void CheckUpdates(void *) for (CurrentFile = 0; CurrentFile < FileCount; CurrentFile++) {
FILEINFO FileInfo = { _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), { _T(""), _T("") } };
- mir_snprintf(szKey, _countof(szKey), "File_%d_CurrentVersion", CurrentFile + 1);
+ mir_snprintf(szKey, "File_%d_CurrentVersion", CurrentFile + 1);
ptrT tszCurVer(db_get_tsa(NULL, MODNAME, szKey));
if (tszCurVer)
mir_tstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer));
else
mir_tstrncpy(FileInfo.tszCurVer, _T(""), _countof(FileInfo.tszCurVer));
- mir_snprintf(szKey, _countof(szKey), "File_%d_LastVersion", CurrentFile + 1);
+ mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
ptrT tszLastVer(db_get_tsa(NULL, MODNAME, szKey));
if (tszLastVer)
mir_tstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer));
@@ -238,7 +238,7 @@ static void CheckUpdates(void *) Files.push_back(FileInfo);
// Read version info
- mir_sntprintf(tszFileInfo, _countof(tszFileInfo), _T("FileInfo_%d"), CurrentFile + 1);
+ mir_sntprintf(tszFileInfo, _T("FileInfo_%d"), CurrentFile + 1);
GetPrivateProfileString(tszFileInfo, _T("FileVersion"), _T(""), Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszNewVer), tszTmpIni);
GetPrivateProfileString(tszFileInfo, _T("Message"), _T(""), Files[CurrentFile].tszMessage, _countof(Files[CurrentFile].tszMessage), tszTmpIni);
GetPrivateProfileString(tszFileInfo, _T("DownloadURL"), _T(""), Files[CurrentFile].File.tszDownloadURL, _countof(Files[CurrentFile].File.tszDownloadURL), tszTmpIni);
@@ -265,9 +265,9 @@ static void CheckUpdates(void *) if (Files[CurrentFile].FileType == 2) {
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszBuff, _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszBuff, _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
TCHAR pluginFolderName[MAX_PATH];
PathToAbsoluteT(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
@@ -294,26 +294,26 @@ static void CheckUpdates(void *) case 2: {
VARST tszUtilRootPlug(_T("%miranda_path%\\Plugins"));
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
case 3: {
VARST tszUtilRootIco(_T("%miranda_path%\\Icons"));
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
case 4:
case 5: {
VARST tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%"));
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
}//end* switch (Files[CurrentFile].FileType)
@@ -322,7 +322,7 @@ static void CheckUpdates(void *) UpdateFiles.push_back(Files[CurrentFile]);
// Save last version
mir_tstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer));
- mir_snprintf(szKey, _countof(szKey), "File_%d_LastVersion", CurrentFile + 1);
+ mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
} // end compare versions
} //end checking all files in for ()
diff --git a/plugins/PasteIt/src/PasteToWeb.cpp b/plugins/PasteIt/src/PasteToWeb.cpp index c57cd58c38..6c5ad07296 100644 --- a/plugins/PasteIt/src/PasteToWeb.cpp +++ b/plugins/PasteIt/src/PasteToWeb.cpp @@ -384,7 +384,7 @@ void PasteToWeb::FromFile(std::wstring file) {
if (fileSize.QuadPart > 512000LL)
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024);
+ mir_sntprintf(bufErr, TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024);
if (MessageBox(NULL, bufErr, TranslateT("Are You sure?"), MB_YESNO | MB_ICONQUESTION) != IDYES)
{
CloseHandle(hFile);
@@ -399,7 +399,7 @@ void PasteToWeb::FromFile(std::wstring file) mir_free(fromFileData.content);
fromFileData.content = NULL;
fromFileData.contentLen = 0;
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Cannot read file '%s'"), file.c_str());
+ mir_sntprintf(bufErr, TranslateT("Cannot read file '%s'"), file.c_str());
error = bufErr;
}
}
@@ -413,7 +413,7 @@ void PasteToWeb::FromFile(std::wstring file) }
else
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Cannot open file '%s'"), file.c_str());
+ mir_sntprintf(bufErr, TranslateT("Cannot open file '%s'"), file.c_str());
error = bufErr;
}
@@ -491,7 +491,7 @@ void PasteToWeb::FromFile(std::wstring file) }
else
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("File '%s' is empty"), file.c_str());
+ mir_sntprintf(bufErr, TranslateT("File '%s' is empty"), file.c_str());
error = bufErr;
}
mir_free(fromFileData.content);
diff --git a/plugins/PasteIt/src/PasteToWeb1.cpp b/plugins/PasteIt/src/PasteToWeb1.cpp index ecf6dd2055..c301b00b6e 100644 --- a/plugins/PasteIt/src/PasteToWeb1.cpp +++ b/plugins/PasteIt/src/PasteToWeb1.cpp @@ -304,7 +304,7 @@ void PasteToWeb1::SendToServer(std::wstring str, std::wstring fileName, std::wst {
if (memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0)
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Error during sending text to web page: %s"), resCont + 17);
+ mir_sntprintf(bufErr, TranslateT("Error during sending text to web page: %s"), resCont + 17);
error = bufErr;
}
else
@@ -336,7 +336,7 @@ std::wstring PasteToWeb1::GetUserKey(std::wstring& user, std::wstring& password) {
if (memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0)
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Error during getting user key from web page: %s"), resCont + 17);
+ mir_sntprintf(bufErr, TranslateT("Error during getting user key from web page: %s"), resCont + 17);
MessageBox(NULL, bufErr, TranslateT("Error"), MB_OK | MB_ICONERROR);
}
else
diff --git a/plugins/Ping/src/icmp.cpp b/plugins/Ping/src/icmp.cpp index c8b8fbdb21..f54c356998 100644 --- a/plugins/Ping/src/icmp.cpp +++ b/plugins/Ping/src/icmp.cpp @@ -68,7 +68,7 @@ bool ICMP::ping(char *host, ICMP_ECHO_REPLY &reply) {
char winmsg[512], msg[1024];
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, code, 0, winmsg, 512, 0);
- mir_snprintf(msg, _countof(msg), "Ping error (%d): %s", code, winmsg);
+ mir_snprintf(msg, "Ping error (%d): %s", code, winmsg);
PUShowMessage(msg, SM_NOTIFY);
return false;
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 467bd008bb..6d270c713a 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_LOGBROWSE:
{
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.txt%c%s%c*.*%c"), TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.txt%c%s%c*.*%c"), TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile = options.log_filename;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index ca291c835d..b2124a6169 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -308,9 +308,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
TCHAR TBcapt[255];
if (total > 0)
- mir_sntprintf(TBcapt, _countof(TBcapt), _T("Ping (%d/%d)"), upCount, total);
+ mir_sntprintf(TBcapt, _T("Ping (%d/%d)"), upCount, total);
else
- mir_sntprintf(TBcapt, _countof(TBcapt), _T("Ping"));
+ mir_sntprintf(TBcapt, _T("Ping"));
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 60f3d2a623..da34ebfc80 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -53,10 +53,10 @@ static void ApplyDownloads(void *param) //create needed folders after escalating priviledges. Folders creates when we actually install updates
TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, _countof(tszFileBack), _T("%s\\Backups"), g_tszRoot);
+ mir_sntprintf(tszFileBack, _T("%s\\Backups"), g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, _countof(tszFileTemp), _T("%s\\Temp"), g_tszRoot);
+ mir_sntprintf(tszFileTemp, _T("%s\\Temp"), g_tszRoot);
SafeCreateDirectory(tszFileTemp);
VARST tszMirandaPath(_T("%miranda_path%"));
@@ -113,7 +113,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP TCHAR *p = _tcschr(tszFileName, L'.'); *p = 0;
TCHAR link[MAX_PATH];
- mir_sntprintf(link, _countof(link), PLUGIN_INFO_URL, tszFileName);
+ mir_sntprintf(link, PLUGIN_INFO_URL, tszFileName);
Utils_OpenUrlT(link);
}
}
@@ -355,8 +355,8 @@ static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* t tp = _tcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
_tcslwr(tp);
- mir_sntprintf(FileInfo->File.tszDiskPath, _countof(FileInfo->File.tszDiskPath), _T("%s\\Temp\\%s.zip"), g_tszRoot, tszFileName);
- mir_sntprintf(FileInfo->File.tszDownloadURL, _countof(FileInfo->File.tszDownloadURL), _T("%s/%s.zip"), tszBaseUrl, tszRelFileName);
+ mir_sntprintf(FileInfo->File.tszDiskPath, _T("%s\\Temp\\%s.zip"), g_tszRoot, tszFileName);
+ mir_sntprintf(FileInfo->File.tszDownloadURL, _T("%s/%s.zip"), tszBaseUrl, tszRelFileName);
for (tp = _tcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = _tcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
@@ -386,7 +386,7 @@ static void GetList(void *) ServListEntry &hash = hashes[i];
TCHAR tszPath[MAX_PATH];
- mir_sntprintf(tszPath, _countof(tszPath), _T("%s\\%s"), dirname, hash.m_name);
+ mir_sntprintf(tszPath, _T("%s\\%s"), dirname, hash.m_name);
if (GetFileAttributes(tszPath) == INVALID_FILE_ATTRIBUTES) {
FILEINFO *FileInfo = ServerEntryToFileInfo(hash, baseUrl, tszPath);
@@ -469,7 +469,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) VARST dirName(_T("%miranda_path%"));
TCHAR tszPath[MAX_PATH];
- mir_sntprintf(tszPath, _countof(tszPath), _T("%s\\%s"), dirName, hash->m_name);
+ mir_sntprintf(tszPath, _T("%s\\%s"), dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);
FILELIST *fileList = new FILELIST(1);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 8b77616451..b3298611f1 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -59,9 +59,9 @@ static void ApplyUpdates(void *param) HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, _countof(tszFileBack), _T("%s\\Backups"), g_tszRoot);
+ mir_sntprintf(tszFileBack, _T("%s\\Backups"), g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, _countof(tszFileTemp), _T("%s\\Temp"), g_tszRoot);
+ mir_sntprintf(tszFileTemp, _T("%s\\Temp"), g_tszRoot);
SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
@@ -101,7 +101,7 @@ static void ApplyUpdates(void *param) if (p.bDeleteOnly) {
// we need only to backup the old file
TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, ptszRelPath);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
else {
@@ -109,8 +109,8 @@ static void ApplyUpdates(void *param) // otherwise it would be replaced by unzip
if ( _tcsicmp(p.tszOldName, p.tszNewName)) {
TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
- mir_sntprintf(tszSrcPath, _countof(tszSrcPath), _T("%s\\%s"), tszMirandaPath, p.tszOldName);
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, p.tszOldName);
+ mir_sntprintf(tszSrcPath, _T("%s\\%s"), tszMirandaPath, p.tszOldName);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
}
@@ -377,10 +377,10 @@ static void DlgUpdateSilent(void *param) //create needed folders after escalating priviledges. Folders creates when we actually install updates
TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, _countof(tszFileBack), _T("%s\\Backups"), g_tszRoot);
+ mir_sntprintf(tszFileBack, _T("%s\\Backups"), g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, _countof(tszFileTemp), _T("%s\\Temp"), g_tszRoot);
+ mir_sntprintf(tszFileTemp, _T("%s\\Temp"), g_tszRoot);
SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
@@ -418,7 +418,7 @@ static void DlgUpdateSilent(void *param) if (p.bDeleteOnly) {
// we need only to backup the old file
TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, ptszRelPath);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
else {
@@ -426,8 +426,8 @@ static void DlgUpdateSilent(void *param) // otherwise it would be replaced by unzip
if (_tcsicmp(p.tszOldName, p.tszNewName)) {
TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
- mir_sntprintf(tszSrcPath, _countof(tszSrcPath), _T("%s\\%s"), tszMirandaPath, p.tszOldName);
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, p.tszOldName);
+ mir_sntprintf(tszSrcPath, _T("%s\\%s"), tszMirandaPath, p.tszOldName);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
}
@@ -455,7 +455,7 @@ static void DlgUpdateSilent(void *param) // 5) Prepare Restart
TCHAR tszTitle[100];
- mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("%d component(s) was updated"), count);
+ mir_sntprintf(tszTitle, TranslateT("%d component(s) was updated"), count);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
ShowPopup(tszTitle,TranslateT("You need to restart your Miranda to apply installed updates."),POPUP_TYPE_MSG);
@@ -477,7 +477,7 @@ static void DlgUpdateSilent(void *param) if (!notified) {
// Error, let's try to show MessageBox as last way to inform user about successful update
TCHAR tszText[200];
- mir_sntprintf(tszText, _countof(tszText), _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
+ mir_sntprintf(tszText, _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(NULL, tszText, tszTitle, MB_ICONINFORMATION | MB_YESNO) == IDYES)
#if MIRANDA_VER >= 0x0A00
@@ -599,7 +599,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const return 0;
TCHAR tszBuf[MAX_PATH];
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s\\*"), tszFolder);
+ mir_sntprintf(tszBuf, _T("%s\\*"), tszFolder);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(tszBuf, &ffd);
@@ -613,7 +613,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// Scan recursively all subfolders
if (_tcscmp(ffd.cFileName, _T(".")) && _tcscmp(ffd.cFileName, _T(".."))) {
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s\\%s"), tszFolder, ffd.cFileName);
+ mir_sntprintf(tszBuf, _T("%s\\%s"), tszFolder, ffd.cFileName);
count += ScanFolder(tszBuf, cbBaseLen, level + 1, tszBaseUrl, hashes, UpdateFiles);
}
}
@@ -624,12 +624,12 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const if (level == 0)
_tcsncpy(tszNewName, ffd.cFileName, MAX_PATH);
else
- mir_sntprintf(tszNewName, _countof(tszNewName), _T("%s\\%s"), tszFolder + cbBaseLen, ffd.cFileName);
+ mir_sntprintf(tszNewName, _T("%s\\%s"), tszFolder + cbBaseLen, ffd.cFileName);
}
TCHAR *ptszUrl;
int MyCRC;
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s\\%s"), tszFolder, ffd.cFileName);
+ mir_sntprintf(tszBuf, _T("%s\\%s"), tszFolder, ffd.cFileName);
bool bDeleteOnly = (tszNewName[0] == 0);
// this file is not marked for deletion
@@ -709,8 +709,8 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const p = (p) ? p + 1 : tszBuf;
_tcslwr(p);
- mir_sntprintf(FileInfo->File.tszDiskPath, _countof(FileInfo->File.tszDiskPath), _T("%s\\Temp\\%s.zip"), g_tszRoot, p);
- mir_sntprintf(FileInfo->File.tszDownloadURL, _countof(FileInfo->File.tszDownloadURL), _T("%s/%s.zip"), tszBaseUrl, tszBuf);
+ mir_sntprintf(FileInfo->File.tszDiskPath, _T("%s\\Temp\\%s.zip"), g_tszRoot, p);
+ mir_sntprintf(FileInfo->File.tszDownloadURL, _T("%s/%s.zip"), tszBaseUrl, tszBuf);
for (p = _tcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = _tcschr(p, '\\'))
*p++ = '/';
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index de54bb43e5..d2cae3353b 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -71,7 +71,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hPopup, UINT uMsg, WPARAM wParam, LPAR static void _stdcall RestartPrompt(void *)
{
TCHAR tszText[200];
- mir_sntprintf(tszText, _countof(tszText), _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
+ mir_sntprintf(tszText, _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(0, tszText, TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION | MB_TOPMOST) == IDYES)
CallService(MS_SYSTEM_RESTART, db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 8b983b49da..30f212abe1 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -151,8 +151,8 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) // Download version info
FILEURL pFileUrl;
- mir_sntprintf(pFileUrl.tszDownloadURL, _countof(pFileUrl.tszDownloadURL), _T("%s/hashes.zip"), baseUrl);
- mir_sntprintf(pFileUrl.tszDiskPath, _countof(pFileUrl.tszDiskPath), _T("%s\\hashes.zip"), g_tszTempPath);
+ mir_sntprintf(pFileUrl.tszDownloadURL, _T("%s/hashes.zip"), baseUrl);
+ mir_sntprintf(pFileUrl.tszDiskPath, _T("%s\\hashes.zip"), g_tszTempPath);
pFileUrl.CRCsum = 0;
HANDLE nlc;
@@ -176,7 +176,7 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) DeleteFile(pFileUrl.tszDiskPath);
TCHAR tszTmpIni[MAX_PATH] = {0};
- mir_sntprintf(tszTmpIni, _countof(tszTmpIni), _T("%s\\hashes.txt"), g_tszTempPath);
+ mir_sntprintf(tszTmpIni, _T("%s\\hashes.txt"), g_tszTempPath);
FILE *fp = _tfopen(tszTmpIni, _T("r"));
if (!fp) {
Netlib_LogfT(hNetlibUser,_T("Opening %s failed"), g_tszTempPath);
@@ -284,7 +284,7 @@ bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc) else {
// try to write it via PU stub
TCHAR tszTempFile[MAX_PATH];
- mir_sntprintf(tszTempFile, _countof(tszTempFile), _T("%s\\pulocal.tmp"), g_tszTempPath);
+ mir_sntprintf(tszTempFile, _T("%s\\pulocal.tmp"), g_tszTempPath);
hFile = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwBytes;
@@ -510,7 +510,7 @@ bool PrepareEscalation() else {
// Elevate the process. Create a pipe for a stub first
TCHAR tszPipeName[MAX_PATH];
- mir_sntprintf(tszPipeName, _countof(tszPipeName), _T("\\\\.\\pipe\\Miranda_Pu_%d"), GetCurrentProcessId());
+ mir_sntprintf(tszPipeName, _T("\\\\.\\pipe\\Miranda_Pu_%d"), GetCurrentProcessId());
hPipe = CreateNamedPipe(tszPipeName, PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
hPipe = NULL;
@@ -520,7 +520,7 @@ bool PrepareEscalation() GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath));
if ((p = _tcsrchr(szPath, '\\')) != 0)
_tcscpy(p+1, _T("pu_stub.exe"));
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("%d"), GetCurrentProcessId());
+ mir_sntprintf(cmdLine, _T("%d"), GetCurrentProcessId());
// Launch a stub
SHELLEXECUTEINFO sei = { sizeof(sei) };
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 2cd803f1f0..9a256efe23 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -40,28 +40,28 @@ void InitFonts() mir_tstrncpy(fid.deffontsettings.szFace, _T("Tahoma"), _countof(fid.deffontsettings.szFace));
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
FontRegisterT(&fid);
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index ebdc53219e..be9c78a595 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -186,7 +186,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) FontID fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, _countof(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -194,17 +194,17 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) fontid.deffontsettings.size = -11;
mir_strncpy(fontid.deffontsettings.szFace, "MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
- mir_snprintf(fontid.name, _countof(fontid.name), "%s (colors only)", notification->lpzName);
- mir_snprintf(fontid.prefix, _countof(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(fontid.name, "%s (colors only)", notification->lpzName);
+ mir_snprintf(fontid.prefix, "{%s/%s}text", notification->lpzGroup, notification->lpzName);
fontid.deffontsettings.style = 0;
FontRegister(&fontid);
ColourID colourid = { 0 };
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, _countof(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(colourid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(colourid.dbSettingsGroup, "PopupNotifications");
- mir_snprintf(colourid.name, _countof(colourid.name), "%s (colors only)", notification->lpzName);
- mir_snprintf(colourid.setting, _countof(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(colourid.name, "%s (colors only)", notification->lpzName);
+ mir_snprintf(colourid.setting, "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
colourid.defcolour = ptd->notification.colorBack;
ColourRegister(&colourid);
@@ -237,14 +237,14 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen) LOGFONTA lf; // dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
FontID fontid = { 0 }; // use ansi version of fontID coz POPUPNOTIFICATION use char
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, _countof(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
- mir_snprintf(fontid.name, _countof(fontid.name), "%s (colors only)", ptd->notification.lpzName);
+ mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(fontid.name, "%s (colors only)", ptd->notification.lpzName);
ppd->colorText = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fontid, (LPARAM)&lf);
ColourID colourid = { 0 }; // use ansi version of ColourID coz POPUPNOTIFICATION use char
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, _countof(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
- mir_snprintf(colourid.name, _countof(colourid.name), "%s (colors only)", ptd->notification.lpzName);
+ mir_snprintf(colourid.group, PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(colourid.name, "%s (colors only)", ptd->notification.lpzName);
ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
ppd->lchIcon = IcoLib_GetIconByHandle(ptd->hIcoLib);
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index b5fa1f5d20..d4adb4adb7 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -161,7 +161,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopupOptions.Alpha);
mir_subclassWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), AlphaTrackBarWndProc);
- mir_sntprintf(tstr, _countof(tstr), _T("%d%%"), Byte2Percentile(PopupOptions.Alpha));
+ mir_sntprintf(tstr, _T("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopupOptions.OpaqueOnHover ? BST_CHECKED : BST_UNCHECKED);
{
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_TRANS_SLIDER:
PopupOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
- mir_sntprintf(tstr, _countof(tstr), TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
+ mir_sntprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 25a1f78d6f..558dfcd321 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -191,11 +191,11 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (p->typ == 1) { // Treeview part for typ 1 (notification)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIconByHandle(p->hIcoLib));
- mir_sntprintf(itemName, _countof(itemName), _T("%s/%s"), p->pszTreeRoot, p->pszDescription);
+ mir_sntprintf(itemName, _T("%s/%s"), p->pszTreeRoot, p->pszDescription);
}
else { // Treeview part typ 2 (popup class api)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, p->pupClass.hIcon);
- mir_sntprintf(itemName, _countof(itemName), _T("%s/%s"), LPGENT("CLASS Plugins"), p->pszDescription);
+ mir_sntprintf(itemName, _T("%s/%s"), LPGENT("CLASS Plugins"), p->pszDescription);
}
OptTree_AddItem(hwndTree, itemName, (LPARAM)p, iconIndex);
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 476699e0f0..fe126a1cfc 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -225,7 +225,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM continue;
TCHAR prefix[128];
- mir_sntprintf(prefix, _countof(prefix), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(prefix, LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
}
}
@@ -240,10 +240,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM continue;
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
+ mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, _countof(pszSettingName), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(pszSettingName, LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
}
}
@@ -526,10 +526,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
+ mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, _countof(pszSettingName), _T("Protocol Status/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(pszSettingName, _T("Protocol Status/%s"), protocols[i]->tszAccountName);
db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
}
}
@@ -581,7 +581,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void ErrorMSG(int minValue, int maxValue)
{
TCHAR str[128];
- mir_sntprintf(str, _countof(str), TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
+ mir_sntprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
MSGERROR(str);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 9a0986a33e..1fd334b1e7 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -48,7 +48,7 @@ void RegisterOptPrevBox() err = GetLastError();
if (!g_wndClass.cPopupPreviewBoxWndclass) {
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -62,7 +62,7 @@ void RegisterOptPrevBox() err = GetLastError();
if (!g_wndClass.cPopupPlusDlgBox) {
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
}
@@ -280,7 +280,7 @@ bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwn // check "Skin options" state
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "skin.%S", PopupOptions.SkinPack);
+ mir_snprintf(prefix, "skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 50db5f8580..af86019a3a 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -222,7 +222,7 @@ static unsigned __stdcall PopupThread(void *) err = GetLastError();
if (!g_wndClass.cPopupThreadManagerWnd) {
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index efd5aa0086..2013df3330 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -65,7 +65,7 @@ bool LoadPopupWnd2() if (!g_wndClass.cPopupWnd2) {
res = false;
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MessageBox(NULL, msg, _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
}
@@ -80,7 +80,7 @@ bool LoadPopupWnd2() err = GetLastError();
if (!g_wndClass.cPopupEditBox) {
TCHAR msg[2048];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
+ mir_sntprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
wclw.cbSize, // UINT cbSize;
wclw.style, // UINT style;
wclw.lpfnWndProc, // WNDPROC lpfnWndProc;
@@ -116,7 +116,7 @@ bool LoadPopupWnd2() if (!g_wndClass.cPopupMenuHostWnd) {
res = false;
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -350,7 +350,7 @@ void PopupWnd2::show() if (*PopupOptions.Effect) {
char vfxService[128];
- mir_snprintf(vfxService, _countof(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
+ mir_snprintf(vfxService, "Popup/Vfx/%S", PopupOptions.Effect);
if (ServiceExists(vfxService))
if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0)) {
effect->beginEffect(m_bmp->getWidth(), m_bmp->getHeight(), m_btAlpha0, m_btAlpha1, dwTime1 - dwTime0);
@@ -437,7 +437,7 @@ void PopupWnd2::hide() if (*PopupOptions.Effect) {
char vfxService[128];
- mir_snprintf(vfxService, _countof(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
+ mir_snprintf(vfxService, "Popup/Vfx/%S", PopupOptions.Effect);
if (ServiceExists(vfxService))
if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0)) {
effect->beginEffect(m_bmp->getWidth(), m_bmp->getHeight(), m_btAlpha0, m_btAlpha1, dwTime1 - dwTime0);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 5d994d9311..7741604aaa 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -146,7 +146,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (proto) {
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
+ mir_snprintf(prefix, LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
if (db_get_dw(NULL, MODULNAME, prefix, 0) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
return -1;
if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
@@ -381,7 +381,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_sntprintf(fid.group, _countof(fid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
+ mir_sntprintf(fid.group, _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup) - 1);
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -389,7 +389,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_tstrncpy(fid.deffontsettings.szFace, _T("Verdana"), _countof(fid.deffontsettings.szFace) - 1);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name) - 1);
mir_strncpy(fid.prefix, setting, _countof(fid.prefix));
- mir_snprintf(fid.prefix, _countof(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
+ mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
FontRegisterT(&fid);
@@ -399,10 +399,10 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_sntprintf(cid.group, _countof(cid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
+ mir_sntprintf(cid.group, _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
- mir_snprintf(cid.setting, _countof(cid.setting), "%s/BgCol", ptd->pupClass.pszName);
+ mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
ColourRegisterT(&cid);
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 55a686a5db..14f5ff10fc 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -71,7 +71,7 @@ static INT_PTR CheckDb(WPARAM, LPARAM) STARTUPINFO si = { 0 };
si.cb = sizeof(si);
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId());
+ mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 0f0000857d..635d111cf4 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -248,7 +248,7 @@ TCHAR *GetListName(c_struct *cs) {
if (opts.group_append && cs->szgroup[0] != _T('\0'))
{
- mir_sntprintf(tmp_list_name, _countof(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
+ mir_sntprintf(tmp_list_name, _T("%s (%s)"), cs->szname, cs->szgroup);
return tmp_list_name;
}
else
@@ -715,7 +715,7 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(tmp, _T("%s (%s)"), TranslateTS(name), key);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_TCHAR);
@@ -731,7 +731,7 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key) if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(tmp, _T("%s (%s)"), TranslateTS(name), key);
SetDlgItemText(hwndDlg, dlgItem, full);
}
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 074c7c3f30..7878317d5c 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -21,90 +21,87 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ListData* ButtonsList[100]; -SortedList* QuickList=NULL; +SortedList* QuickList = NULL; -typedef void (*ItemDestuctor)(void*); +typedef void(*ItemDestuctor)(void*); int sstSortButtons(const void * vmtbi1, const void * vmtbi2) { - ButtonData * mtbi1=(ButtonData *)*((ButtonData ** )vmtbi1); - ButtonData * mtbi2=(ButtonData *)*((ButtonData ** )vmtbi2); - if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2); - return mtbi1->dwPos-mtbi2->dwPos; + ButtonData * mtbi1 = (ButtonData *)*((ButtonData **)vmtbi1); + ButtonData * mtbi2 = (ButtonData *)*((ButtonData **)vmtbi2); + if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + return mtbi1->dwPos - mtbi2->dwPos; } int sstQuickSortButtons(const void * vmtbi1, const void * vmtbi2) { - QuickData * mtbi1=(QuickData *)*((QuickData ** )vmtbi1); - QuickData * mtbi2=(QuickData *)*((QuickData ** )vmtbi2); - if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2); - return mtbi1->dwPos-mtbi2->dwPos; + QuickData * mtbi1 = (QuickData *)*((QuickData **)vmtbi1); + QuickData * mtbi2 = (QuickData *)*((QuickData **)vmtbi2); + if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + return mtbi1->dwPos - mtbi2->dwPos; } int sstOpSortButtons(const void * vmtbi1, const void * vmtbi2) { - ButtonData * mtbi1=(ButtonData *)*((ButtonData ** )vmtbi1); - ButtonData * mtbi2=(ButtonData *)*((ButtonData ** )vmtbi2); - if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2); - return mtbi1->dwOPPos-mtbi2->dwOPPos; + ButtonData * mtbi1 = (ButtonData *)*((ButtonData **)vmtbi1); + ButtonData * mtbi2 = (ButtonData *)*((ButtonData **)vmtbi2); + if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + return mtbi1->dwOPPos - mtbi2->dwOPPos; } void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor) -{ - int i=0; +{ + int i = 0; if (!pList) return; - for (i=0; i<pList->realCount; i++) - pItemDestructor(pList->items[i]); - List_Destroy(pList); + for (i = 0; i < pList->realCount; i++) + pItemDestructor(pList->items[i]); + List_Destroy(pList); mir_free(pList); } void li_RemoveDestruct(SortedList *pList, int index, ItemDestuctor pItemDestructor) -{ - if (index>=0 && index<pList->realCount) - { +{ + if (index >= 0 && index < pList->realCount) { pItemDestructor(pList->items[index]); List_Remove(pList, index); } } void li_RemovePtrDestruct(SortedList *pList, void * ptr, ItemDestuctor pItemDestructor) -{ +{ if (List_RemovePtr(pList, ptr)) pItemDestructor(ptr); } void li_SortList(SortedList *pList, FSortFunc pSortFunct) { - FSortFunc pOldSort=pList->sortFunc; + FSortFunc pOldSort = pList->sortFunc; int i; - if (!pSortFunct) pSortFunct=pOldSort; - pList->sortFunc=NULL; - for (i=0; i<pList->realCount-1; i++) - if (pOldSort(pList->items[i],pList->items[i+1])<0) - { - void * temp=pList->items[i]; - pList->items[i]=pList->items[i+1]; - pList->items[i+1]=temp; + if (!pSortFunct) pSortFunct = pOldSort; + pList->sortFunc = NULL; + for (i = 0; i < pList->realCount - 1; i++) + if (pOldSort(pList->items[i], pList->items[i + 1]) < 0) { + void * temp = pList->items[i]; + pList->items[i] = pList->items[i + 1]; + pList->items[i + 1] = temp; i--; - if (i>0) i--; + if (i > 0) i--; } - pList->sortFunc=pOldSort; + pList->sortFunc = pOldSort; } void li_ZeroQuickList(SortedList *pList) { int i; - for (i=0; i<pList->realCount; i++) - { - QuickData * qd=(QuickData *)pList->items[i]; - qd->dwPos=0; - qd->bIsService=0; - qd->ptszValue=NULL; - qd->ptszValueName=NULL; + for (i = 0; i < pList->realCount; i++) { + QuickData * qd = (QuickData *)pList->items[i]; + qd->dwPos = 0; + qd->bIsService = 0; + qd->ptszValue = NULL; + qd->ptszValueName = NULL; List_Remove(pList, i); i--; } @@ -114,11 +111,11 @@ static void listdestructor(void * input) { ButtonData * cbdi = (ButtonData *)input; - if(cbdi->pszName != cbdi->pszOpName) + if (cbdi->pszName != cbdi->pszOpName) mir_free(cbdi->pszOpName); mir_free(cbdi->pszName); - if(cbdi->pszValue != cbdi->pszOpValue) + if (cbdi->pszValue != cbdi->pszOpValue) mir_free(cbdi->pszOpValue); mir_free(cbdi->pszValue); @@ -127,104 +124,102 @@ static void listdestructor(void * input) void RemoveMenuEntryNode(SortedList *pList, int index) { - li_RemoveDestruct(pList,index,listdestructor); + li_RemoveDestruct(pList, index, listdestructor); } void DestroyButton(int listnum) { - int i=listnum; - ListData* ld=ButtonsList[listnum]; + int i = listnum; + ListData* ld = ButtonsList[listnum]; mir_free(ld->ptszButtonName); - if(ld->ptszOPQValue != ld->ptszQValue) + if (ld->ptszOPQValue != ld->ptszQValue) mir_free(ld->ptszOPQValue); mir_free(ld->ptszQValue); - li_ListDestruct((SortedList*)ld->sl,listdestructor); + li_ListDestruct((SortedList*)ld->sl, listdestructor); mir_free(ld); - ButtonsList[i]=NULL; - while(ButtonsList[i+1]) - { - ButtonsList[i]=ButtonsList[i+1]; - ButtonsList[i+1]=NULL; + ButtonsList[i] = NULL; + while (ButtonsList[i + 1]) { + ButtonsList[i] = ButtonsList[i + 1]; + ButtonsList[i + 1] = NULL; i++; } } - -void SaveModuleSettings(int buttonnum,ButtonData* bd) +void SaveModuleSettings(int buttonnum, ButtonData* bd) { - char szMEntry[256]={'\0'}; + char szMEntry[256] = { '\0' }; - mir_snprintf(szMEntry,_countof(szMEntry),"EntryName_%u_%u",buttonnum,bd->dwPos); - db_set_ts(NULL, PLGNAME,szMEntry,bd->pszName ); + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, bd->dwPos); + db_set_ts(NULL, PLGNAME, szMEntry, bd->pszName); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryValue_%u_%u",buttonnum,bd->dwPos); - if(bd->pszValue) - db_set_ts(NULL, PLGNAME,szMEntry,bd->pszValue ); + mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, bd->dwPos); + if (bd->pszValue) + db_set_ts(NULL, PLGNAME, szMEntry, bd->pszValue); else - db_unset(NULL, PLGNAME,szMEntry); + db_unset(NULL, PLGNAME, szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryRel_%u_%u",buttonnum,bd->dwPos); - db_set_b(NULL, PLGNAME,szMEntry,bd->fEntryType ); + mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, bd->dwPos); + db_set_b(NULL, PLGNAME, szMEntry, bd->fEntryType); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryToQMenu_%u_%u",buttonnum,bd->dwPos); - db_set_b(NULL, PLGNAME,szMEntry,bd->bInQMenu); + mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, bd->dwPos); + db_set_b(NULL, PLGNAME, szMEntry, bd->bInQMenu); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,bd->dwPos); - db_set_b(NULL, PLGNAME,szMEntry,bd->bIsServName); + mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, bd->dwPos); + db_set_b(NULL, PLGNAME, szMEntry, bd->bIsServName); } -void CleanSettings(int buttonnum,int from) +void CleanSettings(int buttonnum, int from) { - char szMEntry[256]={'\0'}; - DBVARIANT dbv = {0}; - if(from==-1){ - mir_snprintf(szMEntry,_countof(szMEntry),"ButtonName_%u",buttonnum); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"ButtonValue_%u",buttonnum); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"RCEntryIsServiceName_%u",buttonnum); - db_unset(NULL, PLGNAME,szMEntry); + char szMEntry[256] = { '\0' }; + DBVARIANT dbv = { 0 }; + if (from == -1) { + mir_snprintf(szMEntry, "ButtonName_%u", buttonnum); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "ButtonValue_%u", buttonnum); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", buttonnum); + db_unset(NULL, PLGNAME, szMEntry); } - mir_snprintf(szMEntry,_countof(szMEntry),"EntryName_%u_%u",buttonnum,from); - while(!db_get_ts(NULL, PLGNAME,szMEntry,&dbv)) { - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryValue_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryRel_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryToQMenu_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - - mir_snprintf(szMEntry,_countof(szMEntry),"EntryName_%u_%u",buttonnum,++from); + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, from); + while (!db_get_ts(NULL, PLGNAME, szMEntry, &dbv)) { + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, ++from); } db_free(&dbv); } -BYTE getEntryByte(int buttonnum,int entrynum,BOOL mode) -{ - char szMEntry[256] = {'\0'}; +BYTE getEntryByte(int buttonnum, int entrynum, BOOL mode) +{ + char szMEntry[256] = { '\0' }; switch (mode) { case 0: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryToQMenu_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, entrynum); break; case 1: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryRel_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, entrynum); break; case 2: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryIsServiceName_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, entrynum); break; case 3: - mir_snprintf(szMEntry, _countof(szMEntry), "RCEntryIsServiceName_%u", buttonnum); + mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", buttonnum); break; } - return db_get_b(NULL, PLGNAME, szMEntry, 0); + return db_get_b(NULL, PLGNAME, szMEntry, 0); } static HANDLE AddIcon(char* szIcoName) @@ -244,22 +239,22 @@ static HANDLE AddIcon(char* szIcoName) DWORD BalanceButtons(int buttonsWas, int buttonsNow) { - if ( !ServiceExists(MS_BB_ADDBUTTON)) { + if (!ServiceExists(MS_BB_ADDBUTTON)) { BBButton bb = { sizeof(bb) }; bb.pszModuleName = PLGNAME; while (buttonsWas > buttonsNow) { bb.dwButtonID = --buttonsWas; CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bb); - } - + } + while (buttonsWas < buttonsNow) { - if (ServiceExists(MS_BB_ADDBUTTON)) { + if (ServiceExists(MS_BB_ADDBUTTON)) { char iconname[40]; - mir_snprintf(iconname, _countof(iconname), LPGEN("Quick Messages Button %u"), buttonsWas); + mir_snprintf(iconname, LPGEN("Quick Messages Button %u"), buttonsWas); bb.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON; bb.dwButtonID = buttonsWas++; - bb.dwDefPos = 300+buttonsWas; + bb.dwDefPos = 300 + buttonsWas; bb.hIcon = AddIcon(iconname); CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bb); } @@ -270,93 +265,90 @@ DWORD BalanceButtons(int buttonsWas, int buttonsNow) void InitButtonsList() -{ - int i,j,k=0; - QuickList=List_Create(0,1); - for(i=0;i<g_iButtonsCount;i++) - { - TCHAR* pszBName=NULL; - ListData* ld=NULL; - if (!(pszBName=getMenuEntry(i,0,3))) { - g_iButtonsCount=i; - db_set_b(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount); - break;} +{ + int i, j, k = 0; + QuickList = List_Create(0, 1); + for (i = 0; i < g_iButtonsCount; i++) { + TCHAR* pszBName = NULL; + ListData* ld = NULL; + if (!(pszBName = getMenuEntry(i, 0, 3))) { + g_iButtonsCount = i; + db_set_b(NULL, PLGNAME, "ButtonsCount", (BYTE)g_iButtonsCount); + break; + } ld = (ListData *)mir_alloc(sizeof(ListData)); - ButtonsList[i]=ld; - ld->sl=List_Create(0,1); - ld->ptszQValue=ld->ptszOPQValue=getMenuEntry(i,0,2); - ld->ptszButtonName=pszBName; - ld->dwPos=ld->dwOPPos=i; - ld->dwOPFlags=0; - ld->bIsServName=ld->bIsOpServName=getEntryByte(i,0,3); - for(j=0;;j++) - { - TCHAR* pszEntry=NULL; - ButtonData *bd=NULL; - - if (!(pszEntry=getMenuEntry(i,j,0))) + ButtonsList[i] = ld; + ld->sl = List_Create(0, 1); + ld->ptszQValue = ld->ptszOPQValue = getMenuEntry(i, 0, 2); + ld->ptszButtonName = pszBName; + ld->dwPos = ld->dwOPPos = i; + ld->dwOPFlags = 0; + ld->bIsServName = ld->bIsOpServName = getEntryByte(i, 0, 3); + for (j = 0;; j++) { + TCHAR* pszEntry = NULL; + ButtonData *bd = NULL; + + if (!(pszEntry = getMenuEntry(i, j, 0))) break; bd = (ButtonData *)mir_alloc(sizeof(ButtonData)); - memset(bd,0,sizeof(ButtonData)); - - bd->dwPos=bd->dwOPPos=j; - bd->pszName=bd->pszOpName=pszEntry; - bd->pszValue=bd->pszOpValue=getMenuEntry(i,j,1); - bd->fEntryType=bd->fEntryOpType=getEntryByte(i,j,1); - bd->bInQMenu=bd->bOpInQMenu=getEntryByte(i,j,0); - bd->bIsServName=bd->bIsOpServName=getEntryByte(i,j,2); - if(bd->bInQMenu){ + memset(bd, 0, sizeof(ButtonData)); + + bd->dwPos = bd->dwOPPos = j; + bd->pszName = bd->pszOpName = pszEntry; + bd->pszValue = bd->pszOpValue = getMenuEntry(i, j, 1); + bd->fEntryType = bd->fEntryOpType = getEntryByte(i, j, 1); + bd->bInQMenu = bd->bOpInQMenu = getEntryByte(i, j, 0); + bd->bIsServName = bd->bIsOpServName = getEntryByte(i, j, 2); + if (bd->bInQMenu) { QuickData* qd = (QuickData *)mir_alloc(sizeof(QuickData)); - qd->dwPos=k++; - qd->ptszValue=bd->pszValue; - qd->ptszValueName=bd->pszName; - List_InsertPtr(QuickList,qd); + qd->dwPos = k++; + qd->ptszValue = bd->pszValue; + qd->ptszValueName = bd->pszName; + List_InsertPtr(QuickList, qd); } - List_InsertPtr((SortedList*)ld->sl,bd); + List_InsertPtr((SortedList*)ld->sl, bd); } } } void DestructButtonsList() { - int i=0; + int i = 0; // for ( i=0; i < g_iButtonsCount; i++ ) - while(ButtonsList[i]) - { - li_ListDestruct(ButtonsList[i]->sl,listdestructor); + while (ButtonsList[i]) { + li_ListDestruct(ButtonsList[i]->sl, listdestructor); mir_free(ButtonsList[i]->ptszButtonName); - if(ButtonsList[i]->ptszOPQValue!=ButtonsList[i]->ptszQValue) + if (ButtonsList[i]->ptszOPQValue != ButtonsList[i]->ptszQValue) if (ButtonsList[i]->ptszOPQValue) mir_free(ButtonsList[i]->ptszOPQValue); if (ButtonsList[i]->ptszQValue) mir_free(ButtonsList[i]->ptszQValue); - i++; + i++; } - if(QuickList) - { + if (QuickList) { li_ZeroQuickList(QuickList); List_Destroy(QuickList); } } -TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) -{ +TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) +{ TCHAR* buffer = NULL; char szMEntry[256]; DBVARIANT dbv; switch (mode) { case 0: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryName_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, entrynum); break; case 1: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryValue_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, entrynum); break; case 2: - mir_snprintf(szMEntry, _countof(szMEntry), "ButtonValue_%u", buttonnum); + mir_snprintf(szMEntry, "ButtonValue_%u", buttonnum); break; case 3: - mir_snprintf(szMEntry, _countof(szMEntry), "ButtonName_%u", buttonnum); + mir_snprintf(szMEntry, "ButtonName_%u", buttonnum); break; default: szMEntry[0] = 0; @@ -369,24 +361,24 @@ TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) db_free(&dbv); } - return buffer; + return buffer; } int RegisterCustomButton(WPARAM, LPARAM) { - if ( !ServiceExists(MS_BB_ADDBUTTON)) + if (!ServiceExists(MS_BB_ADDBUTTON)) return 1; - for (int i=0; i < g_iButtonsCount; i++) { + for (int i = 0; i < g_iButtonsCount; i++) { ListData* ld = ButtonsList[i]; char iconname[40]; - mir_snprintf(iconname, _countof(iconname), LPGEN("Quick Messages Button %u"), i); + mir_snprintf(iconname, LPGEN("Quick Messages Button %u"), i); BBButton bbd = { sizeof(bbd) }; bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON; bbd.dwButtonID = i; - bbd.dwDefPos = 320+i; + bbd.dwDefPos = 320 + i; bbd.hIcon = AddIcon(iconname); bbd.pszModuleName = PLGNAME; bbd.ptszTooltip = ld->ptszButtonName; @@ -395,7 +387,7 @@ int RegisterCustomButton(WPARAM, LPARAM) return 0; } -TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize) +TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* ptszClip, int QVSize, int TextSize, int ClipSize) { int i = 0, iOffset = 0; TCHAR* tempPointer = NULL; @@ -407,13 +399,13 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt TCHAR* ptszName = NULL; CONTACTINFO ci; - if (!_tcschr(ptszQValue,varstr)) + if (!_tcschr(ptszQValue, varstr)) return ptszQValue; - if(TextSize && ptszText[TextSize - 1] == '\0') - TextSize --; - if(ClipSize && ptszClip[ClipSize - 1] == '\0') - ClipSize --; + if (TextSize && ptszText[TextSize - 1] == '\0') + TextSize--; + if (ClipSize && ptszClip[ClipSize - 1] == '\0') + ClipSize--; while (ptszQValue[i]) { if (ptszQValue[i] != '%') @@ -563,7 +555,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt mir_free(ptszName); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue,varstr)) + if (!_tcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -572,8 +564,8 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt break; } move_next: - iOffset ++; - i ++; + iOffset++; + i++; } return ptszQValue; } diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index e3d2abfa1e..63570bb4a3 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -247,7 +247,7 @@ void SaveMenuTree() ld->ptszButtonName = mir_tstrdup(tvi.pszText);
if (ld->ptszQValue) {
- mir_snprintf(szMEntry, _countof(szMEntry), "ButtonValue_%u", iBl);
+ mir_snprintf(szMEntry, "ButtonValue_%u", iBl);
db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszQValue);
}
@@ -262,13 +262,13 @@ void SaveMenuTree() }
- mir_snprintf(szMEntry, _countof(szMEntry), "ButtonName_%u", iBl);
+ mir_snprintf(szMEntry, "ButtonName_%u", iBl);
db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszButtonName);
ld->dwOPFlags = 0;
ld->dwPos = iBl;
ld->bIsServName = ld->bIsOpServName;
- mir_snprintf(szMEntry, _countof(szMEntry), "RCEntryIsServiceName_%u", iBl);
+ mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", iBl);
db_set_b(NULL, PLGNAME, szMEntry, ld->bIsServName);
bDeleted = FALSE;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 6cddb3322f..2935b52655 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -52,8 +52,8 @@ int OnModulesLoaded(WPARAM, LPARAM) Icon_Register(hInstance, "TabSRMM/Quick Replies", &icon, 1);
char buttonNameTranslated[32], buttonName[32];
- mir_snprintf(buttonNameTranslated, _countof(buttonNameTranslated), "%s %x", Translate("Button"), iNumber + 1);
- mir_snprintf(buttonName, _countof(buttonName), MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
BBButton bbd = {0};
bbd.cbSize = sizeof(BBButton);
@@ -80,20 +80,20 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) LIST<wchar_t> replyList(1);
CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
- mir_snprintf(buttonName, _countof(buttonName), MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
if (mir_strcmp(cbcd->pszModule, buttonName))
return 0;
if (cbcd->dwButtonId != iNumber)
return 1;
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
count = db_get_w(NULL, MODULE, key, 0);
{
if (count == 0 || cbcd->flags & BBCF_RIGHTBUTTON)
{
- mir_snprintf(buttonName, _countof(buttonName), "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(buttonName, "%s %x", Translate("Button"), iNumber + 1);
OPENOPTIONSDIALOG ood = {0};
ood.cbSize = sizeof(ood);
@@ -108,7 +108,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) for (int i = 0; i < count; i++)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, i);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, i);
wchar_t *value = db_get_wsa(NULL, MODULE, key);
if (!value)
@@ -136,7 +136,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) SendMessage(hEdit, EM_REPLACESEL, TRUE, (LPARAM)replyList[index - 1]);
- mir_snprintf(key, _countof(key), "ImmediatelySend_%x", iNumber);
+ mir_snprintf(key, "ImmediatelySend_%x", iNumber);
if ((BYTE)db_get_b(NULL, MODULE, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED)
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
@@ -155,7 +155,7 @@ int OnPreShutdown(WPARAM, LPARAM) if (ServiceExists(MS_BB_REMOVEBUTTON))
{
char buttonName[32];
- mir_snprintf(buttonName, _countof(buttonName), MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
BBButton bbd = {0};
bbd.cbSize = sizeof(BBButton);
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index 6a6f9d9417..a12a86ea19 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -71,15 +71,15 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR mir_subclassWindow(GetDlgItem(hwndDlg, IDC_REPLIES), MessageEditSubclassProc);
- mir_snprintf(key, _countof(key), "ImmediatelySend_%x", iNumber);
+ mir_snprintf(key, "ImmediatelySend_%x", iNumber);
CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, db_get_w(NULL, MODULE, key, 1) ? BST_CHECKED : BST_UNCHECKED);
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
count = db_get_w(NULL, MODULE, key, 0);
for (int i = 0; i < count; i++)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, i);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, i);
wchar_t *value = db_get_wsa(NULL, MODULE, key);
if (value)
{
@@ -117,12 +117,12 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int count = 0;
wchar_t *tszReplies;
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
count = db_get_b(NULL, MODULE, key, 0);
for (int i = 0; i < count; i++)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, i);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, i);
db_unset(NULL, MODULE, key);
}
@@ -139,17 +139,17 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int pos = -1, prev = 0;
while ((pos = replies.Find(_T("\r\n"), prev)) != -1)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, count++);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, count++);
db_set_ws(NULL, MODULE, key, replies.Mid(prev, pos - prev).GetBuffer());
prev = pos + 2;
}
}
mir_free(tszReplies);
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
db_set_w(NULL, MODULE, key, count);
- mir_snprintf(key, _countof(key), "ImmediatelySend_%x", iNumber);
+ mir_snprintf(key, "ImmediatelySend_%x", iNumber);
db_set_b(NULL, MODULE, key, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY));
return TRUE;
@@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int OnOptInitialized(WPARAM wParam, LPARAM)
{
char tabName[32];
- mir_snprintf(tabName, _countof(tabName), "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(tabName, "%s %x", Translate("Button"), iNumber + 1);
OPTIONSDIALOGPAGE odp = { 0 };
odp.pszGroup = LPGEN("Message sessions");
diff --git a/plugins/Quotes/src/IconLib.cpp b/plugins/Quotes/src/IconLib.cpp index 6976612005..70f88882cb 100644 --- a/plugins/Quotes/src/IconLib.cpp +++ b/plugins/Quotes/src/IconLib.cpp @@ -24,8 +24,6 @@ void Quotes_IconsInit() std::string Quotes_MakeIconName(const char* name)
{
assert(name);
- //char szSettingName[100];
- //mir_snprintf(szSettingName,_countof(szSettingName),"%s_%s",QUOTES_PROTOCOL_NAME,name);
std::string sName(QUOTES_PROTOCOL_NAME);
sName += "_";
sName += name;
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index e4202c77f0..0cdea80df5 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -278,7 +278,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM GetWindowPlacement(hDlg, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", dbLastUC_WindowPosPrefix);
+ mir_snprintf(szSettingName, "%swidth", dbLastUC_WindowPosPrefix);
int width = db_get_dw(NULL, dbLastUC_ModuleName, szSettingName, -1);
int right = rect.left - 6;
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 4a82bef678..b135fe2445 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -272,7 +272,7 @@ void RemoveProtocolSettings(const char * protocolName) // Delete it
if (name[0] != '\0') {
- mir_snprintf(moduleName, _countof(moduleName), "%s%s", protocolName, name);
+ mir_snprintf(moduleName, "%s%s", protocolName, name);
DeleteSettingEx(moduleName, NULL);
}
@@ -410,7 +410,7 @@ void RemoveDirectories() if (accounts[i]->szModuleName == NULL || accounts[i]->szModuleName[0] == '\0')
continue;
- mir_snprintf(dir, _countof(dir), "%s%s", gMirandaDir, accounts[i]->szModuleName);
+ mir_snprintf(dir, "%s%s", gMirandaDir, accounts[i]->szModuleName);
DeleteFileOrFolder(dir);
}
}
@@ -434,7 +434,7 @@ void RemoveDirectories() // Delete it
if (name[0] != '\0') {
- mir_snprintf(dir, _countof(dir), "%s%s", gMirandaDir, name);
+ mir_snprintf(dir, "%s%s", gMirandaDir, name);
DeleteFileOrFolder(dir);
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 474a9194d4..2e19ef232f 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -2,16 +2,15 @@ int LoadServices(void)
{
- char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+ char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
- memcpy(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+ memcpy(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
// Service creation
- for (size_t i=0;i<_countof(siPluginServices);i++)
- {
- memcpy(pszServiceFunctionName,siPluginServices[i].lpszName,(mir_strlen(siPluginServices[i].lpszName)+1));
- CreateServiceFunction(szServiceFunction,(MIRANDASERVICE)siPluginServices[i].lpFunc);
+ for (size_t i = 0; i < _countof(siPluginServices); i++) {
+ memcpy(pszServiceFunctionName, siPluginServices[i].lpszName, (mir_strlen(siPluginServices[i].lpszName) + 1));
+ CreateServiceFunction(szServiceFunction, (MIRANDASERVICE)siPluginServices[i].lpFunc);
}
return 0;
}
@@ -19,14 +18,14 @@ int LoadServices(void) int LoadModules(void)
{
- HookEvent(ME_OPT_INITIALISE,OptInitialise);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
- HookEvent(ME_PROTO_ACK,handleAckSMS);
- HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
- HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
+ HookEvent(ME_OPT_INITIALISE, OptInitialise);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SmsRebuildContactMenu);
+ HookEvent(ME_PROTO_ACK, handleAckSMS);
+ HookEvent(ME_DB_EVENT_ADDED, handleNewMessage);
+ HookEvent(ME_PROTO_ACCLISTCHANGED, RefreshAccountList);
char szServiceFunction[MAX_PATH];
- mir_snprintf(szServiceFunction,_countof(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
+ mir_snprintf(szServiceFunction, "%s%s", PROTOCOL_NAMEA, SMS_SEND);
CMenuItem mi;
mi.position = 300050000;
@@ -40,13 +39,13 @@ int LoadModules(void) mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
mi.name.t = SMS_SEND_CM_STR;
mi.pszService = szServiceFunction;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_TCHAR;
ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
- SkinAddNewSoundEx("RecvSMSMsg",PROTOCOL_NAMEA,LPGEN("Incoming SMS Message"));
- SkinAddNewSoundEx("RecvSMSConfirmation",PROTOCOL_NAMEA,LPGEN("Incoming SMS Confirmation"));
+ SkinAddNewSoundEx("RecvSMSMsg", PROTOCOL_NAMEA, LPGEN("Incoming SMS Message"));
+ SkinAddNewSoundEx("RecvSMSConfirmation", PROTOCOL_NAMEA, LPGEN("Incoming SMS Confirmation"));
- RefreshAccountList(NULL,NULL);
+ RefreshAccountList(NULL, NULL);
RestoreUnreadMessageAlerts();
return 0;
@@ -72,23 +71,22 @@ int SendSMSMenuCommand(WPARAM wParam, LPARAM) hwndSendSms = SendSMSWindowAdd(wParam);
}
// user clicked on the "SMS Send" in the Main Menu
- else{
+ else {
hwndSendSms = SendSMSWindowAdd(NULL);
- EnableWindow(GetDlgItem(hwndSendSms,IDC_NAME),TRUE);
- EnableWindow(GetDlgItem(hwndSendSms,IDC_SAVENUMBER),FALSE);
+ EnableWindow(GetDlgItem(hwndSendSms, IDC_NAME), TRUE);
+ EnableWindow(GetDlgItem(hwndSendSms, IDC_SAVENUMBER), FALSE);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (GetContactPhonesCount(hContact)) {
SendDlgItemMessage(hwndSendSms, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetContactDisplayName(hContact, 0));
- SendSMSWindowSMSContactAdd(hwndSendSms,hContact);
+ SendSMSWindowSMSContactAdd(hwndSendSms, hContact);
}
}
}
return 0;
}
-
-//This function used to popup a read SMS window after the user clicked on the received SMS message.
+// This function used to popup a read SMS window after the user clicked on the received SMS message.
int ReadMsgSMS(WPARAM, LPARAM lParam)
{
CLISTEVENT *cle = (CLISTEVENT*)lParam;
@@ -99,17 +97,17 @@ int ReadMsgSMS(WPARAM, LPARAM lParam) dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
if (db_event_get(cle->hDbEvent, &dbei) == 0)
- if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
- if (RecvSMSWindowAdd(cle->hContact,ICQEVENTTYPE_SMS,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob)) {
- db_event_markRead(cle->hContact, cle->hDbEvent);
- return 0;
- }
- }
+ if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
+ if (RecvSMSWindowAdd(cle->hContact, ICQEVENTTYPE_SMS, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
+ db_event_markRead(cle->hContact, cle->hDbEvent);
+ return 0;
+ }
+ }
return 1;
}
-//This function used to popup a read SMS window after the user clicked on the received SMS confirmation.
+// This function used to popup a read SMS window after the user clicked on the received SMS confirmation.
int ReadAckSMS(WPARAM, LPARAM lParam)
{
CLISTEVENT *cle = (CLISTEVENT*)lParam;
@@ -138,16 +136,16 @@ void RestoreUnreadMessageAlerts(void) for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
- if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
- if (dbei.cbBlob>MIN_SMS_DBEVENT_LEN)
- handleNewMessage(hContact,(LPARAM)hDbEvent);
+ if ((dbei.flags & (DBEF_SENT | DBEF_READ)) == 0 && ((dbei.eventType == ICQEVENTTYPE_SMS) || (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)))
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN)
+ handleNewMessage(hContact, (LPARAM)hDbEvent);
}
for (MEVENT hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
- if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN)
- handleNewMessage(NULL, (LPARAM)hDbEvent);
+ if ((dbei.flags & (DBEF_SENT | DBEF_READ)) == 0 && ((dbei.eventType == ICQEVENTTYPE_SMS) || (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)))
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN)
+ handleNewMessage(NULL, (LPARAM)hDbEvent);
}
}
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index a38af8be70..7c42dc769c 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -1,27 +1,27 @@ #include "stdafx.h"
-BOOL DB_GetStaticStringW(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszRetBuff,size_t dwRetBuffSize,size_t *pdwRetBuffSize)
+BOOL DB_GetStaticStringW(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{// sizes in wchars
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
size_t dwReadedStringLen;
- DBVARIANT dbv={0};
- if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv)==0)
- {
- dwReadedStringLen=mir_wstrlen(dbv.pwszVal);
- if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
- {
- memcpy(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
- (*((WCHAR*)(lpwszRetBuff+dwReadedStringLen)))=0;
- bRet=TRUE;
- }else{
- if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
+ DBVARIANT dbv = { 0 };
+ if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) {
+ dwReadedStringLen = mir_wstrlen(dbv.pwszVal);
+ if (lpwszRetBuff && (dwRetBuffSize > dwReadedStringLen)) {
+ memcpy(lpwszRetBuff, dbv.pszVal, (dwReadedStringLen*sizeof(WCHAR)));//include null terminated
+ (*((WCHAR*)(lpwszRetBuff + dwReadedStringLen))) = 0;
+ bRet = TRUE;
+ }
+ else {
+ if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
}
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwReadedStringLen;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dwReadedStringLen;
db_free(&dbv);
- }else{
- if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
- if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ }
+ else {
+ if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
}
return(bRet);
}
@@ -40,73 +40,71 @@ LPSTR GetModuleName(MCONTACT hContact) return lpszRet;
}
-void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,size_t dwControlsListCount,BOOL bEnabled)
+void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled)
{
- for(size_t i=0;i<dwControlsListCount;i++) EnableWindow(GetDlgItem(hWndDlg,pwControlsList[i]),bEnabled);
+ for (size_t i = 0; i < dwControlsListCount; i++) EnableWindow(GetDlgItem(hWndDlg, pwControlsList[i]), bEnabled);
}
//This function gets a Cellular string szPhone and clean it from symbools.
-size_t CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,size_t dwLen)
+size_t CopyNumberA(LPSTR lpszOutBuff, LPSTR lpszBuff, size_t dwLen)
{
BYTE btChar;
- LPBYTE lpbOutBuff=(LPBYTE)lpszOutBuff,lpbInBuff=(LPBYTE)lpszBuff;
+ LPBYTE lpbOutBuff = (LPBYTE)lpszOutBuff, lpbInBuff = (LPBYTE)lpszBuff;
- for(size_t i=0;i<dwLen;i++)
- {
- btChar=(*lpbInBuff++);
- if (btChar>='0' && btChar<='9') (*lpbOutBuff++)=btChar;
+ for (size_t i = 0; i < dwLen; i++) {
+ btChar = (*lpbInBuff++);
+ if (btChar >= '0' && btChar <= '9') (*lpbOutBuff++) = btChar;
}
- (*lpbOutBuff)=0;
+ (*lpbOutBuff) = 0;
- return((lpbOutBuff-(LPBYTE)lpszOutBuff));
+ return((lpbOutBuff - (LPBYTE)lpszOutBuff));
}
-size_t CopyNumberW(LPWSTR lpcOutBuff,LPWSTR lpcBuff,size_t dwLen)
+size_t CopyNumberW(LPWSTR lpcOutBuff, LPWSTR lpcBuff, size_t dwLen)
{
WCHAR wChar;
- LPWSTR lpwszOutBuff=lpcOutBuff,lpwszInBuff=lpcBuff;
+ LPWSTR lpwszOutBuff = lpcOutBuff, lpwszInBuff = lpcBuff;
- for(size_t i=0;i<dwLen;i++)
- {
- wChar=(*lpwszInBuff++);
- if (wChar>='0' && wChar<='9') (*lpwszOutBuff++)=wChar;
+ for (size_t i = 0; i < dwLen; i++) {
+ wChar = (*lpwszInBuff++);
+ if (wChar >= '0' && wChar <= '9') (*lpwszOutBuff++) = wChar;
}
- (*lpwszOutBuff)=0;
+ (*lpwszOutBuff) = 0;
- return((lpwszOutBuff-lpcOutBuff));
+ return((lpwszOutBuff - lpcOutBuff));
}
-bool IsPhoneW(LPWSTR lpwszString,size_t dwStringLen)
+bool IsPhoneW(LPWSTR lpwszString, size_t dwStringLen)
{
if (dwStringLen <= 1)
return false;
- for(size_t i=0; i < dwStringLen; i++) {
- WCHAR wChar=(*lpwszString++);
+ for (size_t i = 0; i < dwStringLen; i++) {
+ WCHAR wChar = (*lpwszString++);
if (wChar<'0' || wChar>'9')
- if (wChar!='+' && wChar!='S' && wChar!='M' && wChar!=' ' && wChar!='(' && wChar!=')')
+ if (wChar != '+' && wChar != 'S' && wChar != 'M' && wChar != ' ' && wChar != '(' && wChar != ')')
return false;
}
return true;
}
-DWORD GetContactPhonesCountParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName)
+DWORD GetContactPhonesCountParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName)
{
- DWORD dwRet=0;
+ DWORD dwRet = 0;
char szBuff[MAX_PATH];
WCHAR wszPhone[MAX_PHONE_LEN];
- size_t i,dwPhoneSize;
+ size_t i, dwPhoneSize;
- if ( DB_GetStaticStringW(hContact,lpszModule,lpszValueName,wszPhone,_countof(wszPhone),&dwPhoneSize))
- if ( IsPhoneW(wszPhone,dwPhoneSize))
+ if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, wszPhone, _countof(wszPhone), &dwPhoneSize))
+ if (IsPhoneW(wszPhone, dwPhoneSize))
dwRet++;
- for (i=0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff,_countof(szBuff),"%s%ld",lpszValueName,i);
- if ( DB_GetStaticStringW(hContact,lpszModule,szBuff,wszPhone,_countof(wszPhone),&dwPhoneSize))
- if ( IsPhoneW(wszPhone,dwPhoneSize))
+ for (i = 0; i <= PHONES_MIN_COUNT; i++) {
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
+ if (DB_GetStaticStringW(hContact, lpszModule, szBuff, wszPhone, _countof(wszPhone), &dwPhoneSize))
+ if (IsPhoneW(wszPhone, dwPhoneSize))
dwRet++;
}
return dwRet;
@@ -118,61 +116,61 @@ DWORD GetContactPhonesCount(MCONTACT hContact) DWORD dwRet = 0;
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
- dwRet += GetContactPhonesCountParam(hContact,lpszProto,"Phone");
- dwRet += GetContactPhonesCountParam(hContact,lpszProto,"Cellular");
- dwRet += GetContactPhonesCountParam(hContact,lpszProto,"Fax");
+ dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Phone");
+ dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Cellular");
+ dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Fax");
}
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","MyPhone");
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","Phone");
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","Cellular");
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","Fax");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "MyPhone");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Phone");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Cellular");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Fax");
return dwRet;
}
-BOOL IsContactPhoneParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszPhone,size_t dwPhoneSize)
+BOOL IsContactPhoneParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, LPWSTR lpwszPhone, size_t dwPhoneSize)
{
char szBuff[MAX_PATH];
WCHAR wszPhoneLocal[MAX_PHONE_LEN];
- size_t i,dwPhoneSizeLocal;
+ size_t i, dwPhoneSizeLocal;
- if ( DB_GetStaticStringW(hContact,lpszModule,lpszValueName,wszPhoneLocal,_countof(wszPhoneLocal),&dwPhoneSizeLocal))
- if ( IsPhoneW(wszPhoneLocal,dwPhoneSizeLocal)) {
- dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal,wszPhoneLocal,dwPhoneSizeLocal);
- if (MemoryCompare(wszPhoneLocal,dwPhoneSizeLocal,lpwszPhone,dwPhoneSize)==CSTR_EQUAL)
+ if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, wszPhoneLocal, _countof(wszPhoneLocal), &dwPhoneSizeLocal))
+ if (IsPhoneW(wszPhoneLocal, dwPhoneSizeLocal)) {
+ dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, wszPhoneLocal, dwPhoneSizeLocal);
+ if (MemoryCompare(wszPhoneLocal, dwPhoneSizeLocal, lpwszPhone, dwPhoneSize) == CSTR_EQUAL)
return TRUE;
}
- for (i=0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff,_countof(szBuff),"%s%ld",lpszValueName,i);
- if ( DB_GetStaticStringW(hContact,lpszModule,szBuff,wszPhoneLocal,_countof(wszPhoneLocal),&dwPhoneSizeLocal)) {
- if (IsPhoneW(wszPhoneLocal,dwPhoneSizeLocal)) {
- dwPhoneSizeLocal=CopyNumberW(wszPhoneLocal,wszPhoneLocal,dwPhoneSizeLocal);
- if (MemoryCompare(wszPhoneLocal,dwPhoneSizeLocal,lpwszPhone,dwPhoneSize) == CSTR_EQUAL)
- return TRUE;
- }
+ for (i = 0; i <= PHONES_MIN_COUNT; i++) {
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
+ if (DB_GetStaticStringW(hContact, lpszModule, szBuff, wszPhoneLocal, _countof(wszPhoneLocal), &dwPhoneSizeLocal)) {
+ if (IsPhoneW(wszPhoneLocal, dwPhoneSizeLocal)) {
+ dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, wszPhoneLocal, dwPhoneSizeLocal);
+ if (MemoryCompare(wszPhoneLocal, dwPhoneSizeLocal, lpwszPhone, dwPhoneSize) == CSTR_EQUAL)
+ return TRUE;
}
}
- return FALSE;
+ }
+ return FALSE;
}
-BOOL IsContactPhone(MCONTACT hContact,LPWSTR lpwszPhone,size_t dwPhoneSize)
+BOOL IsContactPhone(MCONTACT hContact, LPWSTR lpwszPhone, size_t dwPhoneSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
WCHAR wszPhoneLocal[MAX_PHONE_LEN];
- size_t dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal,lpwszPhone,dwPhoneSize);
+ size_t dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, lpwszPhone, dwPhoneSize);
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Phone",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Cellular",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Fax",wszPhoneLocal,dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Phone", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Fax", wszPhoneLocal, dwPhoneSizeLocal);
}
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","MyPhone",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Phone",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Cellular",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Fax",wszPhoneLocal,dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "MyPhone", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Phone", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Fax", wszPhoneLocal, dwPhoneSizeLocal);
return bRet;
}
@@ -181,12 +179,12 @@ BOOL IsContactPhone(MCONTACT hContact,LPWSTR lpwszPhone,size_t dwPhoneSize) //This function get a string cellular number and return the HANDLE of the contact that has this
//number in the miranda phonebook (and marked as an SMS able) at the User Details.
//If no one has this number function returns NULL.
-MCONTACT HContactFromPhone(LPWSTR lpwszPhone,size_t dwPhoneSize)
+MCONTACT HContactFromPhone(LPWSTR lpwszPhone, size_t dwPhoneSize)
{
if (lpwszPhone && dwPhoneSize) {
//check not already on list
for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- if (IsContactPhone(hContact,lpwszPhone,dwPhoneSize))
+ if (IsContactPhone(hContact, lpwszPhone, dwPhoneSize))
return hContact;
}
@@ -194,20 +192,20 @@ MCONTACT HContactFromPhone(LPWSTR lpwszPhone,size_t dwPhoneSize) }
-BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventType,LPWSTR lpwszPhone,size_t dwPhoneSize,size_t *pdwPhoneSizeRet,UINT *piIcon)
+BOOL GetDataFromMessage(LPSTR lpszMessage, size_t dwMessageSize, DWORD *pdwEventType, LPWSTR lpwszPhone, size_t dwPhoneSize, size_t *pdwPhoneSizeRet, UINT *piIcon)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
- DWORD dwEventTypeRet=0;
- size_t dwPhoneSizeRet=0;
- UINT iIconRet=0;
+ DWORD dwEventTypeRet = 0;
+ size_t dwPhoneSizeRet = 0;
+ UINT iIconRet = 0;
if (lpszMessage && dwMessageSize) {
- if ( MemoryCompare(lpszMessage,10,"SMS From: ",10) == CSTR_EQUAL) {
- LPSTR lpsz = (LPSTR)strstr(lpszMessage+10, "\r\n");
+ if (MemoryCompare(lpszMessage, 10, "SMS From: ", 10) == CSTR_EQUAL) {
+ LPSTR lpsz = (LPSTR)strstr(lpszMessage + 10, "\r\n");
if (lpsz) {
if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+10),(int)min((size_t)(lpsz-(lpszMessage+10)),dwPhoneSize),lpwszPhone,(int)dwPhoneSize);
+ dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8, 0, (lpszMessage + 10), (int)min((size_t)(lpsz - (lpszMessage + 10)), dwPhoneSize), lpwszPhone, (int)dwPhoneSize);
dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
}
}
@@ -215,16 +213,16 @@ BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventTy dwEventTypeRet = ICQEVENTTYPE_SMS;
bRet = TRUE;
}
- else if (MemoryCompare(lpszMessage,23,"SMS Confirmation From: ",23) == CSTR_EQUAL) {
- LPSTR lpsz = (LPSTR)strstr(lpszMessage+23, "\r\n");
+ else if (MemoryCompare(lpszMessage, 23, "SMS Confirmation From: ", 23) == CSTR_EQUAL) {
+ LPSTR lpsz = (LPSTR)strstr(lpszMessage + 23, "\r\n");
if (lpsz) {
if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+23),(int)min((size_t)(lpsz-(lpszMessage+23)),dwPhoneSize),lpwszPhone,(int)dwPhoneSize);
+ dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8, 0, (lpszMessage + 23), (int)min((size_t)(lpsz - (lpszMessage + 23)), dwPhoneSize), lpwszPhone, (int)dwPhoneSize);
dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
}
lpsz += 2;
- if (MemoryCompare(lpsz,24,"SMS was sent succesfully",24)==CSTR_EQUAL)
+ if (MemoryCompare(lpsz, 24, "SMS was sent succesfully", 24) == CSTR_EQUAL)
iIconRet = IDI_SMSSENT;
else
iIconRet = IDI_SMSNOTSENT;
@@ -241,20 +239,20 @@ BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventTy return bRet;
}
-BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDataSize,const char *tag1,...)
+BOOL GetXMLFieldEx(LPSTR lpszXML, size_t dwXMLSize, LPSTR *plpszData, size_t *pdwDataSize, const char *tag1, ...)
{
BOOL bRet = FALSE;
int thisLevel = 0;
LPSTR lpszFindTag = (LPSTR)tag1, lpszTagEnd = lpszXML, lpszDataStart = NULL;
va_list va;
- va_start(va,tag1);
+ va_start(va, tag1);
while (TRUE) {
- LPSTR lpszTagStart = (LPSTR)MemoryFindByte(lpszTagEnd-lpszXML, lpszXML, dwXMLSize, '<');
+ LPSTR lpszTagStart = (LPSTR)MemoryFindByte(lpszTagEnd - lpszXML, lpszXML, dwXMLSize, '<');
if (!lpszTagStart)
break;
- lpszTagEnd = (LPSTR)MemoryFindByte(lpszTagStart-lpszXML, lpszXML, dwXMLSize, '>');
+ lpszTagEnd = (LPSTR)MemoryFindByte(lpszTagStart - lpszXML, lpszXML, dwXMLSize, '>');
if (!lpszTagEnd)
break;
@@ -263,19 +261,19 @@ BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDa if ((*((BYTE*)lpszTagStart)) == '/') {
if (--thisLevel < 0) {
if (lpszDataStart) {
- if (plpszData) (*plpszData)=lpszDataStart;
- if (pdwDataSize) (*pdwDataSize)=((lpszTagStart-1)-lpszDataStart);
- bRet=TRUE;
+ if (plpszData) (*plpszData) = lpszDataStart;
+ if (pdwDataSize) (*pdwDataSize) = ((lpszTagStart - 1) - lpszDataStart);
+ bRet = TRUE;
}
break;
}
}
else {
- if (++thisLevel==1)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszFindTag,-1,lpszTagStart,((lpszTagEnd+1)-lpszTagStart))==CSTR_EQUAL) {
- lpszFindTag=va_arg(va,LPSTR);
- if (lpszFindTag==NULL) lpszDataStart=(lpszTagEnd+2);
- thisLevel=0;
+ if (++thisLevel == 1)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszFindTag, -1, lpszTagStart, ((lpszTagEnd + 1) - lpszTagStart)) == CSTR_EQUAL) {
+ lpszFindTag = va_arg(va, LPSTR);
+ if (lpszFindTag == NULL) lpszDataStart = (lpszTagEnd + 2);
+ thisLevel = 0;
}
}
}
@@ -284,150 +282,145 @@ BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDa }
-BOOL GetXMLFieldExBuff(LPSTR lpszXML,size_t dwXMLSize,LPSTR lpszBuff,size_t dwBuffSize,size_t *pdwBuffSizeRet,const char *tag1,...)
+BOOL GetXMLFieldExBuff(LPSTR lpszXML, size_t dwXMLSize, LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet, const char *tag1, ...)
{
- BOOL bRet=FALSE;
- int thisLevel=0;
- LPSTR lpszFindTag=(LPSTR)tag1,lpszTagStart,lpszTagEnd=lpszXML,lpszDataStart=NULL;
+ BOOL bRet = FALSE;
+ int thisLevel = 0;
+ LPSTR lpszFindTag = (LPSTR)tag1, lpszTagStart, lpszTagEnd = lpszXML, lpszDataStart = NULL;
va_list va;
- va_start(va,tag1);
- while (TRUE)
- {
- lpszTagStart=(LPSTR)MemoryFindByte((lpszTagEnd-lpszXML),lpszXML,dwXMLSize,'<');
- if (lpszTagStart)
- {
- lpszTagEnd=(LPSTR)MemoryFindByte((lpszTagStart-lpszXML),lpszXML,dwXMLSize,'>');
- if (lpszTagEnd)
- {
+ va_start(va, tag1);
+ while (TRUE) {
+ lpszTagStart = (LPSTR)MemoryFindByte((lpszTagEnd - lpszXML), lpszXML, dwXMLSize, '<');
+ if (lpszTagStart) {
+ lpszTagEnd = (LPSTR)MemoryFindByte((lpszTagStart - lpszXML), lpszXML, dwXMLSize, '>');
+ if (lpszTagEnd) {
lpszTagStart++;
lpszTagEnd--;
- if ((*((BYTE*)lpszTagStart))=='/')
- {
- if (--thisLevel<0)
- {
- if (lpszDataStart)
- {
- size_t dwBuffSizeRet=min((dwBuffSize-2),(size_t)((lpszTagStart-1)-lpszDataStart));
- if (lpszBuff && dwBuffSize) memcpy(lpszBuff,lpszDataStart,dwBuffSizeRet);(*((WORD*)(lpszBuff+dwBuffSizeRet)))=0;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet)=dwBuffSizeRet;
- bRet=TRUE;
+ if ((*((BYTE*)lpszTagStart)) == '/') {
+ if (--thisLevel < 0) {
+ if (lpszDataStart) {
+ size_t dwBuffSizeRet = min((dwBuffSize - 2), (size_t)((lpszTagStart - 1) - lpszDataStart));
+ if (lpszBuff && dwBuffSize) memcpy(lpszBuff, lpszDataStart, dwBuffSizeRet); (*((WORD*)(lpszBuff + dwBuffSizeRet))) = 0;
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet) = dwBuffSizeRet;
+ bRet = TRUE;
}
break;
}
- }else{
- if (++thisLevel==1)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszFindTag,-1,lpszTagStart,((lpszTagEnd+1)-lpszTagStart))==CSTR_EQUAL)
- {
- lpszFindTag=va_arg(va,LPSTR);
- if (lpszFindTag==NULL) lpszDataStart=(lpszTagEnd+2);
- thisLevel=0;
+ }
+ else {
+ if (++thisLevel == 1)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszFindTag, -1, lpszTagStart, ((lpszTagEnd + 1) - lpszTagStart)) == CSTR_EQUAL) {
+ lpszFindTag = va_arg(va, LPSTR);
+ if (lpszFindTag == NULL) lpszDataStart = (lpszTagEnd + 2);
+ thisLevel = 0;
}
}
- }else{
+ }
+ else {
break;
}
- }else{
+ }
+ else {
break;
}
}
va_end(va);
- if (bRet==FALSE)
- {
- if (lpszBuff) (*((WORD*)lpszBuff))=0;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet)=0;
+ if (bRet == FALSE) {
+ if (lpszBuff) (*((WORD*)lpszBuff)) = 0;
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet) = 0;
}
return(bRet);
}
-DWORD ReplaceInBuff(LPVOID lpInBuff,size_t dwInBuffSize,size_t dwReplaceItemsCount,LPVOID *plpInReplaceItems,size_t *pdwInReplaceItemsCounts,LPVOID *plpOutReplaceItems,size_t *pdwOutReplaceItemsCounts,LPVOID lpOutBuff,size_t dwOutBuffSize,size_t *pdwOutBuffSize)
+DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplaceItemsCount, LPVOID *plpInReplaceItems, size_t *pdwInReplaceItemsCounts, LPVOID *plpOutReplaceItems, size_t *pdwOutReplaceItemsCounts, LPVOID lpOutBuff, size_t dwOutBuffSize, size_t *pdwOutBuffSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
- LPBYTE *plpszFound,lpszMessageConvertedCur,lpszMessageCur,lpszMessageCurPrev,lpszMessageConvertedMax;
- size_t i,dwFirstFoundedIndex=0,dwFoundedCount=0,dwMemPartToCopy;
+ DWORD dwRetErrorCode = NO_ERROR;
+ LPBYTE *plpszFound, lpszMessageConvertedCur, lpszMessageCur, lpszMessageCurPrev, lpszMessageConvertedMax;
+ size_t i, dwFirstFoundedIndex = 0, dwFoundedCount = 0, dwMemPartToCopy;
- plpszFound=(LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
+ plpszFound = (LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
- lpszMessageCurPrev=(LPBYTE)lpInBuff;
- lpszMessageConvertedCur=(LPBYTE)lpOutBuff;
- lpszMessageConvertedMax=(((LPBYTE)lpOutBuff)+dwOutBuffSize);
+ lpszMessageCurPrev = (LPBYTE)lpInBuff;
+ lpszMessageConvertedCur = (LPBYTE)lpOutBuff;
+ lpszMessageConvertedMax = (((LPBYTE)lpOutBuff) + dwOutBuffSize);
// looking for in first time
- for (i=0; i < dwReplaceItemsCount; i++) {
- plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev-(LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
+ for (i = 0; i < dwReplaceItemsCount; i++) {
+ plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev - (LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
if (plpszFound[i])
dwFoundedCount++;
}
while (dwFoundedCount) {
// looking for first to replace
- for(i=0; i < dwReplaceItemsCount; i++)
+ for (i = 0; i < dwReplaceItemsCount; i++)
if (plpszFound[i] && (plpszFound[i] < plpszFound[dwFirstFoundedIndex] || plpszFound[dwFirstFoundedIndex] == NULL))
dwFirstFoundedIndex = i;
// in founded
if (plpszFound[dwFirstFoundedIndex]) {
- dwMemPartToCopy=(plpszFound[dwFirstFoundedIndex]-lpszMessageCurPrev);
- if (lpszMessageConvertedMax > (lpszMessageConvertedCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundedIndex]))) {
- memcpy(lpszMessageConvertedCur,lpszMessageCurPrev,dwMemPartToCopy);lpszMessageConvertedCur+=dwMemPartToCopy;
- memcpy(lpszMessageConvertedCur,plpOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);lpszMessageConvertedCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
- lpszMessageCurPrev=(plpszFound[dwFirstFoundedIndex]+pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
-
- for(i=0;i<dwReplaceItemsCount;i++)
- {// loking for in next time
- if (plpszFound[i] && plpszFound[i]<lpszMessageCurPrev)
- {
+ dwMemPartToCopy = (plpszFound[dwFirstFoundedIndex] - lpszMessageCurPrev);
+ if (lpszMessageConvertedMax > (lpszMessageConvertedCur + (dwMemPartToCopy + pdwInReplaceItemsCounts[dwFirstFoundedIndex]))) {
+ memcpy(lpszMessageConvertedCur, lpszMessageCurPrev, dwMemPartToCopy); lpszMessageConvertedCur += dwMemPartToCopy;
+ memcpy(lpszMessageConvertedCur, plpOutReplaceItems[dwFirstFoundedIndex], pdwOutReplaceItemsCounts[dwFirstFoundedIndex]); lpszMessageConvertedCur += pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
+ lpszMessageCurPrev = (plpszFound[dwFirstFoundedIndex] + pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
+
+ for (i = 0; i < dwReplaceItemsCount; i++) {// loking for in next time
+ if (plpszFound[i] && plpszFound[i] < lpszMessageCurPrev) {
dwFoundedCount--;
- plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev-(LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
+ plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev - (LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
if (plpszFound[i]) dwFoundedCount++;
}
}
- }else{
- dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ }
+ else {
+ dwRetErrorCode = ERROR_BUFFER_OVERFLOW;
DebugBreak();
break;
}
- }else{// ñþäà ïî èäåå íèêîãäà íå ïîïàä¸ì, íà âñÿêèé ñëó÷àé.
+ }
+ else {// ñþäà ïî èäåå íèêîãäà íå ïîïàä¸ì, íà âñÿêèé ñëó÷àé.
DebugBreak();
break;
}
}
- lpszMessageCur=(((LPBYTE)lpInBuff)+dwInBuffSize);
- memcpy(lpszMessageConvertedCur,lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev));lpszMessageConvertedCur+=(lpszMessageCur-lpszMessageCurPrev);
- (*((WORD*)lpszMessageConvertedCur))=0;
+ lpszMessageCur = (((LPBYTE)lpInBuff) + dwInBuffSize);
+ memcpy(lpszMessageConvertedCur, lpszMessageCurPrev, (lpszMessageCur - lpszMessageCurPrev)); lpszMessageConvertedCur += (lpszMessageCur - lpszMessageCurPrev);
+ (*((WORD*)lpszMessageConvertedCur)) = 0;
MEMFREE(plpszFound);
- if (pdwOutBuffSize) (*pdwOutBuffSize)=(lpszMessageConvertedCur-((LPBYTE)lpOutBuff));
+ if (pdwOutBuffSize) (*pdwOutBuffSize) = (lpszMessageConvertedCur - ((LPBYTE)lpOutBuff));
return(dwRetErrorCode);
}
-static const LPTSTR lpszXMLTags[] ={TEXT("'"), TEXT("""), TEXT("&"), TEXT("<"), TEXT(">")};
-static const size_t dwXMLTagsCount[] ={(6*sizeof(TCHAR)), (6*sizeof(TCHAR)), (5*sizeof(TCHAR)), (4*sizeof(TCHAR)), (4*sizeof(TCHAR))};
-static const LPTSTR lpszXMLSymbols[] ={TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">")};
-static const size_t dwXMLSymbolsCount[] ={sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR)};
+static const LPTSTR lpszXMLTags[] = { TEXT("'"), TEXT("""), TEXT("&"), TEXT("<"), TEXT(">") };
+static const size_t dwXMLTagsCount[] = { (6 * sizeof(TCHAR)), (6 * sizeof(TCHAR)), (5 * sizeof(TCHAR)), (4 * sizeof(TCHAR)), (4 * sizeof(TCHAR)) };
+static const LPTSTR lpszXMLSymbols[] = { TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">") };
+static const size_t dwXMLSymbolsCount[] = { sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR) };
//Decode XML coded string. The function translate special xml code into standard characters.
-DWORD DecodeXML(LPTSTR lptszMessage,size_t dwMessageSize,LPTSTR lptszMessageConverted,size_t dwMessageConvertedBuffSize,size_t *pdwMessageConvertedSize)
+DWORD DecodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),_countof(lpszXMLTags),(LPVOID*)lpszXMLTags,(size_t*)dwXMLTagsCount,(LPVOID*)lpszXMLSymbols,(size_t*)dwXMLSymbolsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
return(dwRet);
}
//Encode XML coded string. The function translate special saved xml characters into special characters.
-DWORD EncodeXML(LPTSTR lptszMessage,size_t dwMessageSize,LPTSTR lptszMessageConverted,size_t dwMessageConvertedBuffSize,size_t *pdwMessageConvertedSize)
+DWORD EncodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),_countof(lpszXMLTags),(LPVOID*)lpszXMLSymbols,(size_t*)dwXMLSymbolsCount,(LPVOID*)lpszXMLTags,(size_t*)dwXMLTagsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
return(dwRet);
}
@@ -439,53 +432,51 @@ BYTE MsgDlgGetFontDefaultCharset(const TCHAR*) }
-void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour)
+void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
{
int style;
char str[MAX_PATH];
DBVARIANT dbv;
- if (colour)
- {
- mir_snprintf(str,_countof(str),"Font%dCol",i);
- (*colour)=db_get_dw(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
+ if (colour) {
+ mir_snprintf(str, "Font%dCol", i);
+ (*colour) = db_get_dw(NULL, SRMMMOD, str, fontOptionsList[0].defColour);
}
- if (lf)
- {
- if (db_get(NULL,SRMMMOD,str,&dbv))
- {
- mir_tstrncpy(lf->lfFaceName,fontOptionsList[0].szDefFace,_countof(lf->lfFaceName));
- }else{
- mir_tstrncpy(lf->lfFaceName,dbv.ptszVal,_countof(lf->lfFaceName));
+ if (lf) {
+ if (db_get(NULL, SRMMMOD, str, &dbv)) {
+ mir_tstrncpy(lf->lfFaceName, fontOptionsList[0].szDefFace, _countof(lf->lfFaceName));
+ }
+ else {
+ mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
db_free(&dbv);
}
- mir_snprintf(str,_countof(str),"Font%dSize",i);
- lf->lfHeight=(char)db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
- lf->lfWidth=0;
- lf->lfEscapement=0;
- lf->lfOrientation=0;
- mir_snprintf(str,_countof(str),"Font%dSty",i);
- style=db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
- lf->lfWeight=style&FONTF_BOLD?FW_BOLD:FW_NORMAL;
- lf->lfItalic=style&FONTF_ITALIC?1:0;
- lf->lfUnderline=0;
- lf->lfStrikeOut=0;
- mir_snprintf(str,_countof(str),"Font%dSet",i);
- lf->lfCharSet=db_get_b(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
- lf->lfOutPrecision=OUT_DEFAULT_PRECIS;
- lf->lfClipPrecision=CLIP_DEFAULT_PRECIS;
- lf->lfQuality=DEFAULT_QUALITY;
- lf->lfPitchAndFamily=DEFAULT_PITCH|FF_DONTCARE;
- mir_snprintf(str,_countof(str),"Font%d",i);
+ mir_snprintf(str, "Font%dSize", i);
+ lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, fontOptionsList[0].defSize);
+ lf->lfWidth = 0;
+ lf->lfEscapement = 0;
+ lf->lfOrientation = 0;
+ mir_snprintf(str, "Font%dSty", i);
+ style = db_get_b(NULL, SRMMMOD, str, fontOptionsList[0].defStyle);
+ lf->lfWeight = style&FONTF_BOLD ? FW_BOLD : FW_NORMAL;
+ lf->lfItalic = style&FONTF_ITALIC ? 1 : 0;
+ lf->lfUnderline = 0;
+ lf->lfStrikeOut = 0;
+ mir_snprintf(str, "Font%dSet", i);
+ lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, MsgDlgGetFontDefaultCharset(lf->lfFaceName));
+ lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
+ lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ lf->lfQuality = DEFAULT_QUALITY;
+ lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+ mir_snprintf(str, "Font%d", i);
}
}
-LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
+LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch(message) {
- case WM_CHAR:
+ switch (message) {
+ case WM_CHAR:
if (wParam == '\n' && GetKeyState(VK_CONTROL) & 0x8000) {
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
@@ -499,17 +490,17 @@ LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM //It called when SMS plugin loaded and upon change in the account list.
int RefreshAccountList(WPARAM, LPARAM)
{
- int dwAccCount=0,dwSMSAccountsCount=0;
+ int dwAccCount = 0, dwSMSAccountsCount = 0;
PROTOACCOUNT **ppaAccounts;
- Proto_EnumAccounts((int*)&dwAccCount,&ppaAccounts);
+ Proto_EnumAccounts((int*)&dwAccCount, &ppaAccounts);
FreeAccountList();
- ssSMSSettings.ppaSMSAccounts=(PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
+ ssSMSSettings.ppaSMSAccounts = (PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
if (ssSMSSettings.ppaSMSAccounts)
- for (int i=0; i < dwAccCount; i++)
- if ( Proto_IsAccountEnabled(ppaAccounts[i]))
- if ( ProtoServiceExists(ppaAccounts[i]->szModuleName,MS_ICQ_SENDSMS))
+ for (int i = 0; i < dwAccCount; i++)
+ if (Proto_IsAccountEnabled(ppaAccounts[i]))
+ if (ProtoServiceExists(ppaAccounts[i]->szModuleName, MS_ICQ_SENDSMS))
ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++] = ppaAccounts[i];
ssSMSSettings.dwSMSAccountsCount = dwSMSAccountsCount;
@@ -523,5 +514,5 @@ int RefreshAccountList(WPARAM, LPARAM) void FreeAccountList()
{
MEMFREE(ssSMSSettings.ppaSMSAccounts);
- ssSMSSettings.dwSMSAccountsCount=0;
+ ssSMSSettings.dwSMSAccountsCount = 0;
}
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index f43a8c9fd9..775ad114a1 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -27,10 +27,10 @@ Enjoy the code and use it smartly! #include "stdafx.h"
-//This function handles the ACK received from that hooked.
+// This function handles the ACK received from that hooked.
int handleAckSMS(WPARAM wParam, LPARAM lParam)
{
- if ( !lParam)
+ if (!lParam)
return 0;
if (((ACKDATA*)lParam)->type != ICQACKTYPE_SMS)
return 0;
@@ -44,39 +44,36 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) if (lpszXML)
dwXMLSize = mir_strlen(lpszXML);
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_message", "text", NULL))
- {
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszPhone,&dwPhoneSize,"sms_message","sender",NULL))
- {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_message", "text", NULL)) {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszPhone, &dwPhoneSize, "sms_message", "sender", NULL)) {
LPSTR lpszMessageUTF;
- size_t dwBuffLen,dwMessageXMLEncodedSize,dwMessageXMLDecodedSize;
+ size_t dwBuffLen, dwMessageXMLEncodedSize, dwMessageXMLDecodedSize;
DBEVENTINFO dbei = { sizeof(dbei) };
- dwBuffLen=(dwDataSize+MAX_PATH);
- dbei.pBlob=(LPBYTE)MEMALLOC((dwBuffLen+dwPhoneSize));
- LPWSTR lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- LPWSTR lpwszMessageXMLDecoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- if (dbei.pBlob && lpwszMessageXMLEncoded && lpwszMessageXMLDecoded)
- {
- dwMessageXMLEncodedSize=MultiByteToWideChar(CP_UTF8,0,lpszData,(int)dwDataSize,lpwszMessageXMLEncoded,(int)dwBuffLen);
- DecodeXML(lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpwszMessageXMLDecoded,dwBuffLen,&dwMessageXMLDecodedSize);
- lpszMessageUTF=(LPSTR)lpwszMessageXMLEncoded;
- WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLDecoded,(int)dwMessageXMLDecodedSize,lpszMessageUTF,(int)dwBuffLen,NULL,NULL);
+ dwBuffLen = (dwDataSize + MAX_PATH);
+ dbei.pBlob = (LPBYTE)MEMALLOC((dwBuffLen + dwPhoneSize));
+ LPWSTR lpwszMessageXMLEncoded = (LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ LPWSTR lpwszMessageXMLDecoded = (LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ if (dbei.pBlob && lpwszMessageXMLEncoded && lpwszMessageXMLDecoded) {
+ dwMessageXMLEncodedSize = MultiByteToWideChar(CP_UTF8, 0, lpszData, (int)dwDataSize, lpwszMessageXMLEncoded, (int)dwBuffLen);
+ DecodeXML(lpwszMessageXMLEncoded, dwMessageXMLEncodedSize, lpwszMessageXMLDecoded, dwBuffLen, &dwMessageXMLDecodedSize);
+ lpszMessageUTF = (LPSTR)lpwszMessageXMLEncoded;
+ WideCharToMultiByte(CP_UTF8, 0, lpwszMessageXMLDecoded, (int)dwMessageXMLDecodedSize, lpszMessageUTF, (int)dwBuffLen, NULL, NULL);
- dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
- dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,(int)dwPhoneSize,tszPhone,MAX_PHONE_LEN);
- MCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
+ dwPhoneSize = CopyNumberA(szPhone, lpszPhone, dwPhoneSize);
+ dwPhoneSize = MultiByteToWideChar(CP_UTF8, 0, szPhone, (int)dwPhoneSize, tszPhone, MAX_PHONE_LEN);
+ MCONTACT hContact = HContactFromPhone(tszPhone, dwPhoneSize);
- dbei.szModule=GetModuleName(hContact);
- dbei.timestamp=time(NULL);
+ dbei.szModule = GetModuleName(hContact);
+ dbei.timestamp = time(NULL);
dbei.flags = DBEF_UTF;
dbei.eventType = ICQEVENTTYPE_SMS;
- dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,((dwBuffLen+dwPhoneSize)),"SMS From: +%s\r\n%s",szPhone,lpszMessageUTF)+sizeof(DWORD));
+ dbei.cbBlob = (mir_snprintf((LPSTR)dbei.pBlob, ((dwBuffLen + dwPhoneSize)), "SMS From: +%s\r\n%s", szPhone, lpszMessageUTF) + sizeof(DWORD));
//dbei.pBlob=(LPBYTE)lpszBuff;
- (*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
+ (*((DWORD*)(dbei.pBlob + (dbei.cbBlob - sizeof(DWORD))))) = 0;
MEVENT hResult = db_event_add(hContact, &dbei);
- if (hContact==NULL) {
- if ( RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMS,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob)) {
+ if (hContact == NULL) {
+ if (RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMS, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
db_event_markRead(hContact, hResult);
SkinPlaySound("RecvSMSMsg");
}
@@ -86,128 +83,125 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) MEMFREE(lpwszMessageXMLEncoded);
MEMFREE(dbei.pBlob);
}
- }else
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_delivery_receipt","delivered",NULL))
- {
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszPhone,&dwPhoneSize,"sms_delivery_receipt","destination",NULL))
- {
- dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
- dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,(int)dwPhoneSize,tszPhone,MAX_PHONE_LEN);
- MCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
+ }
+ else
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_delivery_receipt", "delivered", NULL)) {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszPhone, &dwPhoneSize, "sms_delivery_receipt", "destination", NULL)) {
+ dwPhoneSize = CopyNumberA(szPhone, lpszPhone, dwPhoneSize);
+ dwPhoneSize = MultiByteToWideChar(CP_UTF8, 0, szPhone, (int)dwPhoneSize, tszPhone, MAX_PHONE_LEN);
+ MCONTACT hContact = HContactFromPhone(tszPhone, dwPhoneSize);
- DBEVENTINFO dbei={0};
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=GetModuleName(hContact);
- dbei.timestamp=time(NULL);
- dbei.flags = DBEF_UTF;
- dbei.eventType = ICQEVENTTYPE_SMSCONFIRMATION;
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL)
- {
- dbei.cbBlob=(MAX_PHONE_LEN+MAX_PATH);
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob) dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,dbei.cbBlob,"SMS Confirmation From: +%s\r\nSMS was sent succesfully",szPhone)+4);
- }else{
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_delivery_receipt","error","params","param",NULL)==FALSE)
- {
- lpszData="";
- dwDataSize=0;
+ DBEVENTINFO dbei = { 0 };
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = GetModuleName(hContact);
+ dbei.timestamp = time(NULL);
+ dbei.flags = DBEF_UTF;
+ dbei.eventType = ICQEVENTTYPE_SMSCONFIRMATION;
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL) {
+ dbei.cbBlob = (MAX_PHONE_LEN + MAX_PATH);
+ dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob) dbei.cbBlob = (mir_snprintf((LPSTR)dbei.pBlob, dbei.cbBlob, "SMS Confirmation From: +%s\r\nSMS was sent succesfully", szPhone) + 4);
}
- dbei.cbBlob=(int)(MAX_PHONE_LEN+MAX_PATH+dwDataSize);
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob)
- {
- dbei.cbBlob=mir_snprintf((LPSTR)dbei.pBlob,dbei.cbBlob,"SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ",szPhone);
- memcpy((dbei.pBlob+dbei.cbBlob),lpszData,dwDataSize);
- dbei.cbBlob += (int)(dwDataSize+sizeof(DWORD));
- (*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
+ else {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_delivery_receipt", "error", "params", "param", NULL) == FALSE) {
+ lpszData = "";
+ dwDataSize = 0;
+ }
+ dbei.cbBlob = (int)(MAX_PHONE_LEN + MAX_PATH + dwDataSize);
+ dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob) {
+ dbei.cbBlob = mir_snprintf((LPSTR)dbei.pBlob, dbei.cbBlob, "SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ", szPhone);
+ memcpy((dbei.pBlob + dbei.cbBlob), lpszData, dwDataSize);
+ dbei.cbBlob += (int)(dwDataSize + sizeof(DWORD));
+ (*((DWORD*)(dbei.pBlob + (dbei.cbBlob - sizeof(DWORD))))) = 0;
+ }
}
- }
- if (dbei.pBlob) {
- if (hContact)
- db_event_add(hContact, &dbei);
- else
- RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMSCONFIRMATION,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob);
+ if (dbei.pBlob) {
+ if (hContact)
+ db_event_add(hContact, &dbei);
+ else
+ RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMSCONFIRMATION, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob);
- MEMFREE(dbei.pBlob);
+ MEMFREE(dbei.pBlob);
+ }
}
}
- }else
- if ((ack->result == ACKRESULT_FAILED) || GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_response","deliverable",NULL))
- {
- HWND hWndDlg = SendSMSWindowHwndByHProcessGet(ack->hProcess);
- if (hWndDlg) {
- char szNetwork[MAX_PATH];
+ else
+ if ((ack->result == ACKRESULT_FAILED) || GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_response", "deliverable", NULL)) {
+ HWND hWndDlg = SendSMSWindowHwndByHProcessGet(ack->hProcess);
+ if (hWndDlg) {
+ char szNetwork[MAX_PATH];
- KillTimer(hWndDlg, wParam);
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szNetwork,sizeof(szNetwork),NULL,"sms_response","network",NULL);
+ KillTimer(hWndDlg, wParam);
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szNetwork, sizeof(szNetwork), NULL, "sms_response", "network", NULL);
- if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"no",2)==CSTR_EQUAL) {
- char szBuff[1024];
- TCHAR tszErrorMessage[1028];
- LPSTR lpszErrorDescription;
+ if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "no", 2) == CSTR_EQUAL) {
+ char szBuff[1024];
+ TCHAR tszErrorMessage[1028];
+ LPSTR lpszErrorDescription;
- if (SendSMSWindowMultipleGet(hWndDlg)) {
- TVITEM tvi;
- tvi.mask=TVIF_TEXT;
- tvi.hItem=SendSMSWindowHItemSendGet(hWndDlg);
- tvi.pszText=tszPhone;
- tvi.cchTextMax=_countof(tszPhone);
- TreeView_GetItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),&tvi);
- }
- else GetDlgItemText(hWndDlg,IDC_ADDRESS,tszPhone,_countof(szPhone));
+ if (SendSMSWindowMultipleGet(hWndDlg)) {
+ TVITEM tvi;
+ tvi.mask = TVIF_TEXT;
+ tvi.hItem = SendSMSWindowHItemSendGet(hWndDlg);
+ tvi.pszText = tszPhone;
+ tvi.cchTextMax = _countof(tszPhone);
+ TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
+ }
+ else GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(szPhone));
- if (ack->result == ACKRESULT_FAILED)
- lpszErrorDescription=lpszXML;
- else {
- lpszErrorDescription=szBuff;
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szBuff,sizeof(szBuff),NULL,"sms_response","error","params","param",NULL);
- }
+ if (ack->result == ACKRESULT_FAILED)
+ lpszErrorDescription = lpszXML;
+ else {
+ lpszErrorDescription = szBuff;
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szBuff, sizeof(szBuff), NULL, "sms_response", "error", "params", "param", NULL);
+ }
- mir_sntprintf(tszErrorMessage,_countof(tszErrorMessage),TranslateT("SMS message didn't send by %S to %s because: %S"),szNetwork,tszPhone,lpszErrorDescription);
- ShowWindow(hWndDlg,SW_SHOWNORMAL);
- EnableWindow(hWndDlg,FALSE);
- HWND hwndTimeOut=CreateDialog(ssSMSSettings.hInstance,MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT),hWndDlg,SMSTimedOutDlgProc);
- SetDlgItemText(hwndTimeOut,IDC_STATUS,tszErrorMessage);
- }
- else {
- SendSMSWindowDBAdd(hWndDlg);
- if ( SendSMSWindowMultipleGet(hWndDlg)) {
- if ( SendSMSWindowNextHItemGet(hWndDlg,SendSMSWindowHItemSendGet(hWndDlg))) {
- SendSMSWindowAsSentSet(hWndDlg);
- SendSMSWindowHItemSendSet(hWndDlg,SendSMSWindowNextHItemGet(hWndDlg,SendSMSWindowHItemSendGet(hWndDlg)));
- SendSMSWindowNext(hWndDlg);
+ mir_sntprintf(tszErrorMessage, TranslateT("SMS message didn't send by %S to %s because: %S"), szNetwork, tszPhone, lpszErrorDescription);
+ ShowWindow(hWndDlg, SW_SHOWNORMAL);
+ EnableWindow(hWndDlg, FALSE);
+ HWND hwndTimeOut = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT), hWndDlg, SMSTimedOutDlgProc);
+ SetDlgItemText(hwndTimeOut, IDC_STATUS, tszErrorMessage);
}
- else SendSMSWindowRemove(hWndDlg);
- }
- else {
- if ( CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL ||
- CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"smtp",4)==CSTR_EQUAL) {
- char szSource[MAX_PATH],szMessageID[MAX_PATH];
-
- if (DB_SMS_GetByte(NULL,"ShowACK",SMS_DEFAULT_SHOWACK)) {
- HWND hwndAccepted=CreateDialog(ssSMSSettings.hInstance,MAKEINTRESOURCE(IDD_SENDSMSACCEPT),hWndDlg,SMSAcceptedDlgProc);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL) {
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szSource,sizeof(szSource),NULL,"sms_response","source",NULL);
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szMessageID,sizeof(szMessageID),NULL,"sms_response","message_id",NULL);
+ else {
+ SendSMSWindowDBAdd(hWndDlg);
+ if (SendSMSWindowMultipleGet(hWndDlg)) {
+ if (SendSMSWindowNextHItemGet(hWndDlg, SendSMSWindowHItemSendGet(hWndDlg))) {
+ SendSMSWindowAsSentSet(hWndDlg);
+ SendSMSWindowHItemSendSet(hWndDlg, SendSMSWindowNextHItemGet(hWndDlg, SendSMSWindowHItemSendGet(hWndDlg)));
+ SendSMSWindowNext(hWndDlg);
}
- else {
- SetDlgItemText(hwndAccepted,IDC_ST_SOURCE,TranslateT("From:"));
- SetDlgItemText(hwndAccepted,IDC_ST_MESSAGEID,TranslateT("To:"));
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szSource,sizeof(szSource),NULL,"sms_response","from",NULL);
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szMessageID,sizeof(szMessageID),NULL,"sms_response","to",NULL);
+ else SendSMSWindowRemove(hWndDlg);
+ }
+ else {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL ||
+ CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "smtp", 4) == CSTR_EQUAL) {
+ char szSource[MAX_PATH], szMessageID[MAX_PATH];
+
+ if (DB_SMS_GetByte(NULL, "ShowACK", SMS_DEFAULT_SHOWACK)) {
+ HWND hwndAccepted = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSACCEPT), hWndDlg, SMSAcceptedDlgProc);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL) {
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szSource, sizeof(szSource), NULL, "sms_response", "source", NULL);
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szMessageID, sizeof(szMessageID), NULL, "sms_response", "message_id", NULL);
+ }
+ else {
+ SetDlgItemText(hwndAccepted, IDC_ST_SOURCE, TranslateT("From:"));
+ SetDlgItemText(hwndAccepted, IDC_ST_MESSAGEID, TranslateT("To:"));
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szSource, sizeof(szSource), NULL, "sms_response", "from", NULL);
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szMessageID, sizeof(szMessageID), NULL, "sms_response", "to", NULL);
+ }
+ SetDlgItemTextA(hwndAccepted, IDC_NETWORK, szNetwork);
+ SetDlgItemTextA(hwndAccepted, IDC_SOURCE, szSource);
+ SetDlgItemTextA(hwndAccepted, IDC_MESSAGEID, szMessageID);
+ }
+ else SendSMSWindowRemove(hWndDlg);
}
- SetDlgItemTextA(hwndAccepted,IDC_NETWORK,szNetwork);
- SetDlgItemTextA(hwndAccepted,IDC_SOURCE,szSource);
- SetDlgItemTextA(hwndAccepted,IDC_MESSAGEID,szMessageID);
+ else SendSMSWindowRemove(hWndDlg);
}
- else SendSMSWindowRemove(hWndDlg);
}
- else SendSMSWindowRemove(hWndDlg);
}
}
- }
- }
return 0;
}
@@ -217,28 +211,28 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
TCHAR szToolTip[MAX_PATH];
DBEVENTINFO dbei = { sizeof(dbei) };
-
+
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
return 0;
dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
- if ( !dbei.pBlob)
+ if (!dbei.pBlob)
return 0;
- memcpy(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ memcpy(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
if (db_event_get(hDbEvent, &dbei) == 0)
if ((dbei.flags & DBEF_SENT) == 0)
if (dbei.eventType == ICQEVENTTYPE_SMS) {
- if (dbei.cbBlob>MIN_SMS_DBEVENT_LEN) {
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
SkinPlaySound("RecvSMSMsg");
- if (DB_SMS_GetByte(NULL,"AutoPopup",0)) {
- if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMS,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob))
+ if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
+ if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMS, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
db_event_markRead(hContact, hDbEvent);
}
else {
- memcpy(pszServiceFunctionName,SMS_READ,sizeof(SMS_READ));
- mir_sntprintf(szToolTip,_countof(szToolTip),TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ memcpy(pszServiceFunctionName, SMS_READ, sizeof(SMS_READ));
+ mir_sntprintf(szToolTip, TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
@@ -247,30 +241,30 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
cle.pszService = szServiceFunction;
cle.ptszTooltip = szToolTip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
}
else if (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION) {
SkinPlaySound("RecvSMSConfirmation");
if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
- if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMSCONFIRMATION,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob))
+ if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMSCONFIRMATION, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
db_event_delete(hContact, hDbEvent);
}
else {
UINT iIcon;
if (GetDataFromMessage((LPSTR)dbei.pBlob, dbei.cbBlob, NULL, NULL, 0, NULL, &iIcon)) {
- memcpy(pszServiceFunctionName,SMS_READ_ACK,sizeof(SMS_READ_ACK));
- mir_sntprintf(szToolTip,_countof(szToolTip),TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ memcpy(pszServiceFunctionName, SMS_READ_ACK, sizeof(SMS_READ_ACK));
+ mir_sntprintf(szToolTip, TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
- cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance,MAKEINTRESOURCE(iIcon),IMAGE_ICON,0,0,LR_SHARED);
+ cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(iIcon), IMAGE_ICON, 0, 0, LR_SHARED);
cle.pszService = szServiceFunction;
cle.ptszTooltip = szToolTip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
}
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index 6cec77af40..af6cb3ae07 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -210,7 +210,7 @@ HWND RecvSMSWindowAdd(MCONTACT hContact, DWORD dwEventType, LPWSTR lpwszPhone, s }
lpwszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(wszTitle, _countof(wszTitle), _T("%s - %s"), lpwszContactDisplayName, lpwszTitlepart);
+ mir_sntprintf(wszTitle, _T("%s - %s"), lpwszContactDisplayName, lpwszTitlepart);
MultiByteToWideChar(CP_UTF8, 0, lpszMessage, (int)dwMessageSize, lpwszMessage, (int)dwMessageSize + MAX_PATH);
SetWindowText(prswdWindowData->hWnd, wszTitle);
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 8af23dd8d3..0f9a499655 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -154,7 +154,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hWndDlg, IDOK), dwSignLen != 0);
}
- mir_sntprintf(tszSign, _countof(tszSign), _T("%d/%d"), dwSignLen, GetSMSMessageLenMax(hWndDlg));
+ mir_sntprintf(tszSign, _T("%d/%d"), dwSignLen, GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg, IDC_COUNT, tszSign);
}
@@ -222,7 +222,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA else {
GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
}
- mir_sntprintf(tszMessage, _countof(tszMessage), TranslateT("The SMS message send to %s timed out."), tszPhone);
+ mir_sntprintf(tszMessage, TranslateT("The SMS message send to %s timed out."), tszPhone);
KillTimer(hWndDlg, wParam);
ShowWindow(hWndDlg, SW_SHOWNORMAL);
EnableWindow(hWndDlg, FALSE);
@@ -386,7 +386,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize != 0);
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%d/%d"), dwMessageSize, GetSMSMessageLenMax(hWndDlg));
+ mir_sntprintf(tszBuff, _T("%d/%d"), dwMessageSize, GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg, IDC_COUNT, tszBuff);
}
break;
@@ -402,7 +402,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA if (IsContactPhone(psswdWindowData->hMyContact, tszPhone, dwPhoneSize) == FALSE) {
mir_tstrcat(tszPhone, _T(" SMS"));
for (DWORD i = 0; bCont; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "MyPhone%d", i);
+ mir_snprintf(szBuff, "MyPhone%d", i);
if (db_get(psswdWindowData->hMyContact, "UserInfo", szBuff, &dbv)) bCont = FALSE;
db_free(&dbv);
}
@@ -559,7 +559,7 @@ HWND SendSMSWindowAdd(MCONTACT hContact) LPTSTR lptszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR tszTitle[MAX_PATH];
- mir_sntprintf(tszTitle, _countof(tszTitle), _T("%s - %s"), lptszContactDisplayName, TranslateT("Send SMS"));
+ mir_sntprintf(tszTitle, _T("%s - %s"), lptszContactDisplayName, TranslateT("Send SMS"));
SetWindowText(psswdWindowData->hWnd, tszTitle);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)lptszContactDisplayName);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_SETCURSEL, 0, 0);
@@ -964,7 +964,7 @@ void AddContactPhonesToComboToListParam(MCONTACT hContact, LPSTR lpszModule, LPS }
for (i = 0; TRUE; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "%s%ld", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
if (DB_GetStaticStringW(hContact, lpszModule, szBuff, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
tszPhone[0] = '+';
dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
@@ -1026,7 +1026,7 @@ void AddContactPhonesToTreeViewParam(MCONTACT hContact, LPSTR lpszModule, LPSTR }
for (i = 0; TRUE; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "%s%ld", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
if (DB_GetStaticStringW(hContact, lpszModule, szBuff, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
tszPhone[0] = '+';
dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 254fb28675..f922a731f2 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa TCHAR tszTooltipText[2048];
RECT rect;
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText),
+ mir_sntprintf(tszTooltipText,
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 1eb9907c3a..1fab1ef1f8 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -53,7 +53,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index b8923a07ec..b67205598c 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -799,7 +799,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p }
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -1432,7 +1432,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
static TCHAR ptszBuf[128];
- mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%c%s"), szIndicator, ui->pszNick);
+ mir_sntprintf(ptszBuf, _T("%c%s"), szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick);
@@ -1641,7 +1641,7 @@ LABEL_SHOWWINDOW: USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
static TCHAR ptszBuf[1024];
- mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(ptszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 5801cbbdd5..563c2803da 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -293,8 +293,8 @@ void RegisterKeyBindings() desc.pszName = strName;
desc.pszDescription = strDesc;
for (int i = 0; i < 9; i++) {
- mir_snprintf(strName, _countof(strName), "Scriver/Nav/Tab %d", i + 1);
- mir_snprintf(strDesc, _countof(strDesc), Translate("Navigate: tab %d"), i + 1);
+ mir_snprintf(strName, "Scriver/Nav/Tab %d", i + 1);
+ mir_snprintf(strDesc, Translate("Navigate: tab %d"), i + 1);
desc.lParam = KB_TAB1 + i;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, '1' + i);
Hotkey_Register(&desc);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 0637424ddf..68e31b3ec1 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -302,7 +302,7 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, ptrT pszWord(GetRichTextWord(hwnd, &ptl));
if (pszWord && pszWord[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWord);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
}
@@ -1266,7 +1266,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rcLog);
GetClientRect(hwndDlg, &rc);
- POINT pt = { 0, wParam };
+ POINT pt = { 0, (int)wParam };
ScreenToClient(hwndDlg, &pt);
dat->splitterPos = rc.bottom - pt.y;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 32e98e5996..5915bf2acd 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -379,7 +379,7 @@ static char* SetToStyle(int style) static char szStyle[128];
LOGFONT lf;
LoadMsgDlgFont(style, &lf, NULL);
- mir_snprintf(szStyle, _countof(szStyle), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
+ mir_snprintf(szStyle, "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
return szStyle;
}
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index aefb07949f..701733a6bc 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -129,7 +129,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hDbEvent = hDbEvent;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), contactName);
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
@@ -208,7 +208,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
TCHAR szTip[256];
- mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if ( ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
@@ -282,7 +282,7 @@ static void RestoreUnreadMessageAlerts(void) else {
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -629,7 +629,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), nextStgId++);
+ mir_sntprintf(sztName, _T("s%u"), nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index eb48aeb5e7..37cf89bcee 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -1133,14 +1133,14 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char *szNamePrefix = (!savePerContact && dat->isChat) ? "chat" : "";
if (!dat->windowWasCascaded) {
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.top);
}
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(hContact, SRMMMOD, SRMSGSET_TOPMOST, (BYTE)dat->bTopmost);
if (g_dat.lastParent == dat)
@@ -1510,9 +1510,9 @@ int ScriverRestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szMod GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
int x = db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
int y = db_get_dw(hContact, szModule, szSettingName, -1);
if (x == -1)
return 1;
@@ -1522,9 +1522,9 @@ int ScriverRestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szMod else {
wp.rcNormalPosition.left = x;
wp.rcNormalPosition.top = y;
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
wp.rcNormalPosition.right = wp.rcNormalPosition.left + db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
wp.rcNormalPosition.bottom = wp.rcNormalPosition.top + db_get_dw(hContact, szModule, szSettingName, -1);
}
wp.flags = 0;
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index cea74321c6..f9fac518df 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -375,29 +375,29 @@ void SearchWord(TCHAR * word, int engine) ptrA wordURL(mir_urlEncode(wordUTF));
switch (engine) {
case SEARCHENGINE_WIKIPEDIA:
- mir_snprintf(szURL, _countof(szURL), "http://en.wikipedia.org/wiki/%s", wordURL);
+ mir_snprintf(szURL, "http://en.wikipedia.org/wiki/%s", wordURL);
break;
case SEARCHENGINE_YAHOO:
- mir_snprintf(szURL, _countof(szURL), "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL);
+ mir_snprintf(szURL, "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL);
break;
case SEARCHENGINE_FOODNETWORK:
- mir_snprintf(szURL, _countof(szURL), "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL);
+ mir_snprintf(szURL, "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL);
break;
case SEARCHENGINE_BING:
- mir_snprintf(szURL, _countof(szURL), "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL);
+ mir_snprintf(szURL, "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL);
break;
case SEARCHENGINE_GOOGLE_MAPS:
- mir_snprintf(szURL, _countof(szURL), "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
case SEARCHENGINE_GOOGLE_TRANSLATE:
- mir_snprintf(szURL, _countof(szURL), "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
case SEARCHENGINE_YANDEX:
- mir_snprintf(szURL, _countof(szURL), "http://yandex.ru/yandsearch?text=%s", wordURL);
+ mir_snprintf(szURL, "http://yandex.ru/yandsearch?text=%s", wordURL);
break;
case SEARCHENGINE_GOOGLE:
default:
- mir_snprintf(szURL, _countof(szURL), "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index c1769cbd80..cef386ddbf 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -806,7 +806,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l GetDlgItemText(hDlg, IDC_GPGEXECUTABLE_EDIT, gpgexe, _countof(gpgexe));
// filter zusammensetzen
- mir_snprintf(filter, _countof(filter), _T("%s (*.exe)%c*.exe%c%c"), Translate("Executable Files"), 0, 0, 0);
+ mir_snprintf(filter, _T("%s (*.exe)%c*.exe%c%c"), Translate("Executable Files"), 0, 0, 0);
// OPENFILENAME initialisieren
OPENFILENAME ofn = { sizeof(ofn) };
@@ -1042,7 +1042,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) if (bPGPloaded && ver) {
char pgpVerStr[64];
- mir_snprintf(pgpVerStr, _countof(pgpVerStr), Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
+ mir_snprintf(pgpVerStr, Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
SetDlgItemText(hDlg, IDC_PGP_SDK, pgpVerStr);
}
else SetDlgItemText(hDlg, IDC_PGP_SDK, Translate(sim219));
@@ -1548,14 +1548,14 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort) {
// restore sort column
char t[32];
- mir_snprintf(t, _countof(t), "os%02x", (UINT)lParamSort & 0xF0);
+ mir_snprintf(t, "os%02x", (UINT)lParamSort & 0xF0);
if ((lParamSort & 0x0F) == 0)
lParamSort = (int)db_get_b(0, MODULENAME, t, lParamSort + 1);
db_set_b(0, MODULENAME, t, (BYTE)lParamSort);
// restore sort order
- mir_snprintf(t, _countof(t), "os%02x", (UINT)lParamSort);
+ mir_snprintf(t, "os%02x", (UINT)lParamSort);
int m = db_get_b(0, MODULENAME, t, 0);
if (bChangeSortOrder) { m = !m; db_set_b(0, MODULENAME, t, m); }
@@ -1571,7 +1571,7 @@ BOOL ShowSelectKeyDlg(HWND hParent, LPSTR KeyPath) ofn.lpstrFile = KeyPath;
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrTitle = TranslateT("Open Key File");
if (!GetOpenFileName(&ofn)) return FALSE;
@@ -1628,7 +1628,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) OPENFILENAME ofn = { sizeof(ofn) };
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.hwndOwner = hParent;
ofn.nMaxFile = MAX_PATH;
@@ -1661,7 +1661,7 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) ofn.Flags = OFN_EXPLORER | OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN;
ofn.lpstrFile = szFile;
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrTitle = (priv) ? TranslateT("Load Private Key File") : TranslateT("Load Public Key File");
if (!GetOpenFileName(&ofn))
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 2aaea47284..2f22076d5d 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -174,7 +174,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA TranslateDialogDefault(hwndDlg);
hContact = (MCONTACT)lparam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lparam);
- mir_sntprintf(sztemp, _countof(sztemp), _T("%s: %s"),
+ mir_sntprintf(sztemp, _T("%s: %s"),
pcli->pfnGetContactDisplayName(hContact, 0),
TranslateT("last seen history"));
SetWindowText(hwndDlg, sztemp);
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index d407c5e24d..5b1a2574cd 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -109,7 +109,7 @@ int ShowMissed(void) for (int loop = 0; loop < mcs.count; loop++) {
mir_tstrncat(sztemp, (TCHAR*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
- mir_sntprintf(szcount, _countof(szcount), _T(" [%i]"), mcs.times[loop]);
+ mir_sntprintf(szcount, _T(" [%i]"), mcs.times[loop]);
mir_tstrcat(sztemp, szcount);
}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 89aeb04247..adc23838ba 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -276,7 +276,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM if (LOWORD(wparam) == IDC_VARIABLES) {
char szout[2048];
- mir_snprintf(szout, _countof(szout), VARIABLE_LIST);
+ mir_snprintf(szout, VARIABLE_LIST);
MessageBoxA(hdlg, szout, Translate("Last Seen Variables"), MB_OK | MB_TOPMOST);
}
break; //case WM_COMMAND
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 24a2f3de56..a002707251 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -399,7 +399,7 @@ void CSend::Error(LPCTSTR pszFormat, ...) { TCHAR tszMsg[MAX_SECONDLINE]; - mir_sntprintf(tszMsg, _countof(tszMsg), _T("%s - %s"), _T(SZ_SENDSS), TranslateT("Error")); + mir_sntprintf(tszMsg, _T("%s - %s"), _T(SZ_SENDSS), TranslateT("Error")); mir_free(m_ErrorTitle), m_ErrorTitle = mir_tstrdup(tszMsg); va_list vl; diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index d21b8deaeb..dbf260860e 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -206,7 +206,7 @@ void TfrmAbout::btnPageClick() TCHAR newTitle[128]; TCHAR* pszPlug = mir_a2t(__PLUGIN_NAME); TCHAR* pszVer = mir_a2t(__VERSION_STRING_DOTS); - mir_sntprintf(newTitle, _countof(newTitle), _T("%s - %s\nv%s"), pszPlug, title, pszVer); + mir_sntprintf(newTitle, _T("%s - %s\nv%s"), pszPlug, title, pszVer); mir_free(pszPlug); mir_free(pszVer); SetDlgItemText(m_hWnd, IDC_HEADERBAR, newTitle); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index de58878414..b0dba2015a 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -240,7 +240,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) if (m_MonitorCount > 1) { TCHAR tszTemp[120]; for (size_t mon = 0; mon < m_MonitorCount; ++mon) { /// @todo : fix format for non MSVC compilers - mir_sntprintf(tszTemp, _countof(tszTemp), _T("%Iu. %s%s"), + mir_sntprintf(tszTemp, _T("%Iu. %s%s"), mon + 1, TranslateT("Monitor"), (m_Monitors[mon].dwFlags & MONITORINFOF_PRIMARY) ? TranslateT(" (primary)") : _T("") ); diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 6f1653590c..bd43096a93 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -700,11 +700,11 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) { TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; - mir_sntprintf(tszTitle, _countof(tszMsg), _T("%s - %s"), _T(MODNAME), TranslateT("Error")); + mir_sntprintf(tszTitle, _T("%s - %s"), _T(MODNAME), TranslateT("Error")); va_list vl; va_start(vl, pszFormat); - mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); + mir_vsntprintf(tszMsg, TranslateTS(pszFormat), vl); va_end(vl); MSGBOX mb = { 0 }; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index d0a9924980..9aa921b2de 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -602,17 +602,17 @@ int DelUserDefSession(int ses_count) }
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "UserSessionDsc", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", ses_count);
db_unset(NULL, MODNAME, szSessionName);
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
db_unset(NULL, MODNAME, szSessionName);
for (int i = ses_count + 1;; i++) {
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "UserSessionDsc", i);
+ mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i);
ptrT szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "UserSessionDsc", i - 1);
+ mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i - 1);
if (szSessionNameBuf) {
MarkUserDefSession(i - 1, IsMarkedUserDefSession(i));
db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
@@ -620,7 +620,7 @@ int DelUserDefSession(int ses_count) else {
db_unset(NULL, MODNAME, szSessionName);
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", i - 1);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", i - 1);
db_unset(NULL, MODNAME, szSessionName);
break;
}
@@ -638,14 +638,14 @@ int DeleteAutoSession(int ses_count) }
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "SessionDate", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "SessionDate", ses_count);
db_unset(NULL, MODNAME, szSessionName);
for (int i = ses_count + 1;; i++) {
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "SessionDate", i);
+ mir_snprintf(szSessionName, "%s_%u", "SessionDate", i);
ptrT szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "SessionDate", i - 1);
+ mir_snprintf(szSessionName, "%s_%u", "SessionDate", i - 1);
if (szSessionNameBuf)
db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
else {
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 8bc54180a4..1672a81dda 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -127,7 +127,7 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count) void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode)
{
char szFormNumBuf[100];
- mir_snprintf(szFormNumBuf, _countof(szFormNumBuf), "%02u", ordernum);
+ mir_snprintf(szFormNumBuf, "%02u", ordernum);
if (mode == 0) {
ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsMarks"));
@@ -149,7 +149,7 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) db_set_s(hContact, MODNAME, "LastSessionsOrder", temp);
}
else if (writemode == 1) {
- mir_snprintf(szFormNumBuf, _countof(szFormNumBuf), "%02u%s", ordernum, "000000000000000000");
+ mir_snprintf(szFormNumBuf, "%02u%s", ordernum, "000000000000000000");
db_set_s(hContact, MODNAME, "LastSessionsOrder", szFormNumBuf);
}
}
@@ -229,7 +229,7 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer) break;
char szNameBuf[256];
- mir_snprintf(szNameBuf, _countof(szNameBuf), "%s_%u", szName, i);
+ mir_snprintf(szNameBuf, "%s_%u", szName, i);
TCHAR *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
db_set_ts(NULL, MODNAME, szNameBuf, szBuffer);
@@ -297,7 +297,7 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in }
for (int i = 0; i < iLimit; i++) {
- mir_snprintf(szBuffer, _countof(szBuffer), "%s_%u", pszSetting, i);
+ mir_snprintf(szBuffer, "%s_%u", pszSetting, i);
TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) {
@@ -326,7 +326,7 @@ int FillFavoritesMenu(HMENU hMenu, int iLimit) for (int i = 0; i < iLimit; i++) {
if (IsMarkedUserDefSession(i)) {
char szBuffer[256];
- mir_snprintf(szBuffer, _countof(szBuffer), "%s_%u", "UserSessionDsc", i);
+ mir_snprintf(szBuffer, "%s_%u", "UserSessionDsc", i);
TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
AppendMenu(hMenu, MF_STRING, i + 1, pszBuffer);
@@ -361,14 +361,14 @@ int CheckContactVisibility(MCONTACT hContact) void RenameUserDefSession(int ses_count, TCHAR* ptszNewName)
{
char szSession[256];
- mir_snprintf(szSession, _countof(szSession), "%s_%u", "UserSessionDsc", ses_count);
+ mir_snprintf(szSession, "%s_%u", "UserSessionDsc", ses_count);
db_set_ts(NULL, MODNAME, szSession, ptszNewName);
}
int MarkUserDefSession(int ses_count, BYTE bCheck)
{
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
db_set_b(NULL, MODNAME, szSessionName, bCheck);
return 0;
}
@@ -376,7 +376,7 @@ int MarkUserDefSession(int ses_count, BYTE bCheck) BYTE IsMarkedUserDefSession(int ses_count)
{
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
return db_get_b(NULL, MODNAME, szSessionName, 0);
}
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index e57194bf68..9fdb3d2204 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -30,7 +30,7 @@ static void InitControls(HWND hwndDlg) int comReg = IsCOMRegistered();
TCHAR szBuf[MAX_PATH];
- mir_sntprintf(szBuf, _countof(szBuf), _T("%s (%s)"),
+ mir_sntprintf(szBuf, _T("%s (%s)"),
TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
SetDlgItemText(hwndDlg, IDC_STATUS, szBuf);
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index a1ecc1c505..07b74efd20 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -23,23 +23,23 @@ struct TCMInvokeCommandInfo int IsCOMRegistered()
{
- HKEY hRegKey;
- int res = 0;
-
- // these arent the BEST checks in the world
- if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRegKey)) {
- res += COMREG_OK;
- RegCloseKey(hRegKey);
- }
-
- if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_READ, &hRegKey)) {
- DWORD lpType = REG_SZ;
- if (!RegQueryValueEx(hRegKey, _T("{72013A26-A94C-11d6-8540-A5E62932711D}"), NULL, &lpType, 0, 0))
- res += COMREG_APPROVED;
+ HKEY hRegKey;
+ int res = 0;
+
+ // these arent the BEST checks in the world
+ if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRegKey)) {
+ res += COMREG_OK;
+ RegCloseKey(hRegKey);
+ }
+
+ if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_READ, &hRegKey)) {
+ DWORD lpType = REG_SZ;
+ if (!RegQueryValueEx(hRegKey, _T("{72013A26-A94C-11d6-8540-A5E62932711D}"), NULL, &lpType, 0, 0))
+ res += COMREG_APPROVED;
RegCloseKey(hRegKey);
- }
+ }
- return res;
+ return res;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -90,7 +90,7 @@ BOOL AddToList(TAddArgList& args) HANDLE hFind = FindFirstFileA(szBuf, &fd);
while (true) {
if (fd.cFileName[0] != '.') {
- mir_snprintf(szBuf, _countof(szBuf),"%s\\%s", args.szFile, fd.cFileName);
+ mir_snprintf(szBuf, "%s\\%s", args.szFile, fd.cFileName);
// keep a copy of the current thing being processed
szThis = args.szFile;
args.szFile = szBuf;
@@ -105,7 +105,7 @@ BOOL AddToList(TAddArgList& args) FindClose(hFind);
return true;
}
- }
+ }
if (!FindNextFileA(hFind, &fd))
break;
}
@@ -142,7 +142,7 @@ void __cdecl IssueTransferThread(void *param) TSlotIPC *pct = pipch->DataPtr;
BOOL bQuit = false;
while (pct != NULL) {
- if (pct->cbSize != sizeof(TSlotIPC))
+ if (pct->cbSize != sizeof(TSlotIPC))
break;
args.szFile = LPSTR(UINT_PTR(pct) + sizeof(TSlotIPC));
args.hContact = pct->hContact;
@@ -193,7 +193,7 @@ void ipcGetSkinIcons(THeaderIPC *ipch) int protoCount;
PROTOACCOUNT **pp;
- Proto_EnumAccounts(&protoCount,&pp);
+ Proto_EnumAccounts(&protoCount, &pp);
if (protoCount != 0) {
spi.pid = GetCurrentProcessId();
while (protoCount > 0) {
@@ -274,8 +274,8 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) if (BST_UNCHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseHITContacts, BST_UNCHECKED)) {
// don't show people who are "Hidden" "NotOnList" or Ignored
if (db_get_b(hContact, "CList", "Hidden", 0) == 1 ||
- db_get_b(hContact, "CList", "NotOnList", 0) == 1 ||
- CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_URL | IGNOREEVENT_FILE) != 0)
+ db_get_b(hContact, "CList", "NotOnList", 0) == 1 ||
+ CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_URL | IGNOREEVENT_FILE) != 0)
continue;
}
// is HIT2 off?
@@ -298,9 +298,9 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) dwContacts = i;
qsort(pContacts, dwContacts, sizeof(TSlotInfo), SortContact);
-
+
// create an IPC slot for each contact and store display name, etc
- for (i=0; i < dwContacts; i++) {
+ for (i = 0; i < dwContacts; i++) {
ptrA szContact(mir_t2a(pcli->pfnGetContactDisplayName(pContacts[i].hContact, 0)));
if (szContact != NULL) {
ptrA szGroup;
@@ -343,7 +343,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) void __cdecl ClearMRUThread(void*)
{
for (MCONTACT hContact = db_find_first(); hContact != 0; hContact = db_find_next(hContact))
- if ( db_get_b(hContact, SHLExt_Name, SHLExt_MRU, 0) > 0)
+ if (db_get_b(hContact, SHLExt_Name, SHLExt_MRU, 0) > 0)
db_set_b(hContact, SHLExt_Name, SHLExt_MRU, 0);
}
@@ -414,7 +414,7 @@ void __stdcall ipcService(ULONG_PTR) // if the group mode is on, check if they want the CList setting
bool bGroupMode = (BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseGroups, BST_UNCHECKED));
- if (bGroupMode && BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseCListSetting, BST_UNCHECKED))
+ if (bGroupMode && BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseCListSetting, BST_UNCHECKED))
bGroupMode = db_get_b(0, "CList", "UseGroups", true) != 0;
TSlotIPC *pct = NULL;
@@ -435,7 +435,7 @@ void __stdcall ipcService(ULONG_PTR) // return contact's grouping if it's present
while (bGroupMode) {
_itoa(iSlot, szGroupStr, 10);
- if ( db_get_s(0, "CListGroups", szGroupStr, &dbv) != 0)
+ if (db_get_s(0, "CListGroups", szGroupStr, &dbv) != 0)
break;
pct = ipcAlloc(pMMT, lstrlenA(dbv.pszVal + 1) + 1);
// first byte has flags, need null term
@@ -552,13 +552,13 @@ void CheckUnregisterServer() // launches regsvr to remove the dll under admin.
TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
GetModuleFileName(hInst, szFileName, _countof(szFileName));
- mir_sntprintf(szBuf, _countof(szBuf), _T("/s /u \"%s\""), szFileName);
+ mir_sntprintf(szBuf, _T("/s /u \"%s\""), szFileName);
SHELLEXECUTEINFO sei = { sizeof(sei) };
sei.lpVerb = _T("runas");
sei.lpFile = _T("regsvr32");
sei.lpParameters = szBuf;
- if ( ShellExecuteEx(&sei) == TRUE)
+ if (ShellExecuteEx(&sei) == TRUE)
return;
Sleep(1000);
@@ -581,7 +581,7 @@ void CheckRegisterServer() TranslateT("Miranda NG - Shell context menus (shellext.dll)"), MB_OK | MB_ICONINFORMATION);
// /s = silent
GetModuleFileName(hInst, szFileName, _countof(szFileName));
- mir_sntprintf(szBuf, _countof(szBuf), _T("/s \"%s\""), szFileName);
+ mir_sntprintf(szBuf, _T("/s \"%s\""), szFileName);
SHELLEXECUTEINFO sei = { sizeof(sei) };
sei.lpVerb = _T("runas");
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 6ef08d12dd..c45b123906 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -108,7 +108,7 @@ INT CheckDefaults(WPARAM, LPARAM) db_free(&dbv);
for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- mir_snprintf(szStatus, _countof(szStatus), "%d", c);
+ mir_snprintf(szStatus, "%d", c);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
@@ -178,7 +178,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (isQun)
return FALSE;
- mir_snprintf(szStatus, _countof(szStatus), "%d", status);
+ mir_snprintf(szStatus, "%d", status);
if (!db_get_ts(NULL, protocolname, szStatus, &dbv)) {
if (*dbv.ptszVal) {
DBVARIANT dbvHead = { 0 }, dbvNick = { 0 };
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 75516552a2..038988fe43 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -21,7 +21,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- mir_snprintf(tszStatus, _countof(tszStatus), "%d", c);
+ mir_snprintf(tszStatus, "%d", c);
TCHAR *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
@@ -103,7 +103,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara continue;
else {
char szStatus[6] = { 0 };
- mir_snprintf(szStatus, _countof(szStatus), "%d", c);
+ mir_snprintf(szStatus, "%d", c);
if (c<ID_STATUS_FREECHAT && ptszMessage[c - ID_STATUS_ONLINE - 1])
db_set_ts(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 20c14a01d6..4060d798f9 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -86,14 +86,14 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status, contactName);
+ mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
if (dat->hSeq) {
GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status);
+ mir_sntprintf(str, format, status);
}
else {
- mir_sntprintf(str, _countof(str), TranslateT("Failed to retrieve %s message."), status);
+ mir_sntprintf(str, TranslateT("Failed to retrieve %s message."), status);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
}
SetDlgItemText(hwndDlg, IDC_RETRIEVING, str);
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
contactName = (TCHAR *)pcli->pfnGetContactDisplayName(dat->hContact, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, contactName);
+ mir_sntprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
if (!dat->hSeq)
DestroyWindow(hwndDlg);
@@ -348,7 +348,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
- mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
IcoLib_ReleaseIcon(hIcon);
}
@@ -359,13 +359,13 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
if (!iHidden && szMsg != NULL) {
- mir_sntprintf(str, _countof(str), TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hCopyMsgMenuItem, str);
}
else Menu_ShowItem(hCopyMsgMenuItem, false);
if (!iHidden && szMsg != NULL && StrFindURL(szMsg) != NULL) {
- mir_sntprintf(str, _countof(str), TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hGoToURLMenuItem, str);
}
else Menu_ShowItem(hGoToURLMenuItem, false);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index d164f846bd..3032ecf36c 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -258,7 +258,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (ran_to > ran_from)
{
- mir_sntprintf(substituteStr, _countof(substituteStr), _T("%d"), GetRandom(ran_from, ran_to));
+ mir_sntprintf(substituteStr, _T("%d"), GetRandom(ran_from, ran_to));
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
if (mir_tstrlen(substituteStr) > k - i)
@@ -1360,14 +1360,14 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) if (iCurrentStatus < ID_STATUS_ONLINE)
continue;
- mir_snprintf(szBuffer, _countof(szBuffer), "FCur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
if (db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
continue;
tszMsg = InsertVarsIntoMsg(dbv.ptszVal, accounts->pa[i]->szModuleName, iCurrentStatus, NULL);
db_free(&dbv);
- mir_snprintf(szBuffer, _countof(szBuffer), "Cur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szBuffer, "Cur%sMsg", accounts->pa[i]->szModuleName);
if (!db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
{
if (tszMsg && dbv.ptszVal && !mir_tstrcmp(tszMsg, dbv.ptszVal) || !tszMsg && !dbv.ptszVal)
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index b767cd4a9d..5c448a8195 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -643,7 +643,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) char text[16], buff2[80]; for (i = 1; i <= data->max_hist_msgs; i++) { - mir_snprintf(text, _countof(text), "SMsg%d", i); + mir_snprintf(text, "SMsg%d", i); db_set_ts(NULL, "SimpleStatusMsg", text, _T("")); } db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); @@ -657,7 +657,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[i]->szModuleName); + mir_snprintf(buff2, "Last%sMsg", accounts->pa[i]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", buff2, ""); } db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs); @@ -696,7 +696,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) lines++; } } - mir_sntprintf(status_text, _countof(status_text), TranslateT("OK (%d)"), len - (lines - 1)); + mir_sntprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1)); SetDlgItemText(hwndDlg, IDC_OK, status_text); } @@ -780,7 +780,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) TCHAR szTitle[256], szProtoName[128]; BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND); - mir_sntprintf(szProtoName, _countof(szProtoName), msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); if (iStatus == ID_STATUS_CURRENT) { if (msgbox_data->m_bOnStartup) mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); @@ -905,7 +905,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg); init_data = (struct MsgBoxInitData *)lParam; GetWindowText(hwndDlg, szFormat, _countof(szFormat)); - mir_sntprintf(szProtoName, _countof(szProtoName), init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); if (init_data->m_iStatus == ID_STATUS_CURRENT) { if (init_data->m_bOnStartup) @@ -1099,7 +1099,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } else { TCHAR str[64]; - mir_sntprintf(str, _countof(str), TranslateT("Closing in %d"), msgbox_data->m_iCountdown); + mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown); SetDlgItemText(hwndDlg, IDC_OK, str); } msgbox_data->m_iCountdown--; @@ -1179,10 +1179,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!mir_tstrcmp(dbv.ptszVal, tszMsg)) { found = TRUE; if (msgbox_data->m_szProto) { - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); } else { @@ -1200,10 +1200,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "Last%sMsg", accounts->pa[j]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "%sMsg", accounts->pa[j]->szModuleName); iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg); } @@ -1227,10 +1227,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg); if (msgbox_data->m_szProto) { - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); } else { @@ -1248,10 +1248,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "Last%sMsg", accounts->pa[j]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "%sMsg", accounts->pa[j]->szModuleName); iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg); } diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 5e40cd08c5..de55dcabb2 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -1346,7 +1346,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (i = 1; i <= max_hist_msgs; i++) {
- mir_snprintf(text, _countof(text), "SMsg%d", i);
+ mir_snprintf(text, "SMsg%d", i);
db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index 81770581a9..d27b1ad5ae 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -42,7 +42,7 @@ void IconsInit(void) HICON LoadIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, "SimpleStatusMsg_%s", name);
return IcoLib_GetIcon(szSettingName);
}
@@ -58,14 +58,14 @@ HANDLE GetIconHandle(int iconId) void ReleaseIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, "SimpleStatusMsg_%s", name);
IcoLib_Release(szSettingName);
}
HANDLE HookProtoEvent(const char *szModule, const char *szEvent, MIRANDAHOOKPARAM hookProc)
{
char szProtoEvent[MAXMODULELABELLENGTH];
- mir_snprintf(szProtoEvent, _countof(szProtoEvent), "%s%s", szModule, szEvent);
+ mir_snprintf(szProtoEvent, "%s%s", szModule, szEvent);
HANDLE res = HookEventParam(szProtoEvent, hookProc, (LPARAM)szModule);
arProtoHooks.insert(res);
return res;
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 698e6195a6..740f359df6 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -303,7 +303,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString& filename, const CMString& pa if (!noerr) {
static const TCHAR errmsg[] = LPGENT("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
TCHAR msgtxt[1024];
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), modpath.c_str(), packname);
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
ReportError(msgtxt);
}
@@ -463,7 +463,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & if (!noerr) {
static const TCHAR errmsg[] = LPGENT("Smiley #%u in file %s for smiley pack %s not found.");
TCHAR msgtxt[1024];
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt));
errorFound = true;
}
@@ -838,7 +838,7 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr packnam = "MSN";
char path[MAX_PATH];
- mir_snprintf(path, _countof(path), "Smileys\\nova\\%s.msl", packnam);
+ mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
paths = A2T_SM(path);
CMString patha;
@@ -865,7 +865,7 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString& defau packnam = "MSN";
char path[MAX_PATH];
- mir_snprintf(path, _countof(path), "Smileys\\nova\\%s.msl", packnam);
+ mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
CMString paths = A2T_SM(path), patha;
pathToAbsolute(paths, patha);
@@ -936,7 +936,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co CMString displayName = dbv.ptszVal;
if (packname != NULL) {
char path[MAX_PATH];
- mir_snprintf(path, _countof(path), "Smileys\\nova\\%s.msl", packname);
+ mir_snprintf(path, "Smileys\\nova\\%s.msl", packname);
CMString paths = A2T_SM(path), patha;
pathToAbsolute(paths, patha);
@@ -1014,13 +1014,13 @@ SmileyLookup::SmileyLookup(const CMString& str, const bool regexs, const int ind matcher->getStartingIndex() != matcher->getEndingIndex());
if (!m_valid) {
static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
delete matcher;
}
else {
static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
if (!m_valid)
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index a9587ee991..d6d582a59b 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -17,7 +17,7 @@ int CheckBayes() char* tmp = Utils_ReplaceVars("%miranda_userdata%");
if (tmp[mir_strlen(tmp)-1] == '\\')
tmp[mir_strlen(tmp)-1] = 0;
- mir_snprintf(bayesdb_tmp, _countof(bayesdb_tmp), "%s\\%s", tmp, BAYESDB_PATH);
+ mir_snprintf(bayesdb_tmp, "%s\\%s", tmp, BAYESDB_PATH);
mir_free(tmp);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
@@ -82,7 +82,7 @@ int OpenBayes() tmp = Utils_ReplaceVars("%miranda_userdata%");
if (tmp[mir_strlen(tmp)-1] == '\\')
tmp[mir_strlen(tmp)-1] = 0;
- mir_snprintf(bayesdb_fullpath, _countof(bayesdb_fullpath), "%s\\%s\\%s", tmp, BAYESDB_PATH, BAYESDBG_FILENAME);
+ mir_snprintf(bayesdb_fullpath, "%s\\%s\\%s", tmp, BAYESDB_PATH, BAYESDBG_FILENAME);
mir_free(tmp);
bayesdb_fullpath_utf8 = mir_utf8encode(bayesdb_fullpath);
if (sqlite3_open(bayesdb_fullpath_utf8, &bayesdbg) == SQLITE_OK)
@@ -110,7 +110,7 @@ int get_token_count(int type) if (bayesdb == NULL)
return 0;
- mir_snprintf(q, _countof(q), "SELECT COUNT(1) FROM %s", type == SPAM ? "spam" : "ham");
+ mir_snprintf(q, "SELECT COUNT(1) FROM %s", type == SPAM ? "spam" : "ham");
sqlite3_prepare_v2(bayesdb, q, -1, &stmt, NULL);
if (sqlite3_step(stmt) == SQLITE_ROW) {
count = sqlite3_column_int(stmt, 0);
@@ -165,7 +165,7 @@ int get_token_score(int type, char *token) if (bayesdb == NULL)
return 0;
- mir_snprintf(sql, _countof(sql), "SELECT num FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
+ mir_snprintf(sql, "SELECT num FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
tokenhash(token, digest);
sqlite3_prepare_v2(bayesdb, sql, -1, &stmt, NULL);
sqlite3_bind_blob(stmt, 1, digest, 16, NULL);
@@ -323,10 +323,10 @@ void learn(int type, TCHAR *msg) message = mir_u2a(msg);
tok = strtok(message, DELIMS);
- mir_snprintf(sql_counter, _countof(sql_counter), "UPDATE stats SET value=value+1 WHERE key='%s'", type == SPAM ? "spam_msgcount" : "ham_msgcount");
- mir_snprintf(sql_select, _countof(sql_select), "SELECT 1 FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
- mir_snprintf(sql_update, _countof(sql_update), "UPDATE %s SET num=num+1 WHERE token=?", type ? "spam" : "ham");
- mir_snprintf(sql_insert, _countof(sql_insert), "INSERT INTO %s VALUES(?, 1)", type ? "spam" : "ham");
+ mir_snprintf(sql_counter, "UPDATE stats SET value=value+1 WHERE key='%s'", type == SPAM ? "spam_msgcount" : "ham_msgcount");
+ mir_snprintf(sql_select, "SELECT 1 FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
+ mir_snprintf(sql_update, "UPDATE %s SET num=num+1 WHERE token=?", type ? "spam" : "ham");
+ mir_snprintf(sql_insert, "INSERT INTO %s VALUES(?, 1)", type ? "spam" : "ham");
#ifdef _DEBUG
sqlite3_exec(bayesdbg, "BEGIN", NULL, NULL, NULL);
#endif
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index ff8863bd3b..6c65d556c4 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -519,7 +519,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
- mir_snprintf(cbuf, _countof(cbuf), "%0.04f", get_msg_score(dbuf));
+ mir_snprintf(cbuf, "%0.04f", get_msg_score(dbuf));
SetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, _T(""));
MessageBoxA(NULL, cbuf, Translate("Message score"), MB_OK);
free(dbuf);
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 29d76e78a3..6ce5f16438 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -388,7 +388,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) case SPAMOTRON_MODE_MATH:
a = (rand() % 10) + 1;
b = (rand() % 10) + 1;
- mir_sntprintf(mexpr, _countof(mexpr), _T("%d + %d"), a, b);
+ mir_sntprintf(mexpr, _T("%d + %d"), a, b);
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
_getOptS(challengeW, maxmsglen, "AuthChallengeMath", defaultAuthChallengeMath);
else
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index aa6bb0df29..20d0b0bd2e 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -427,7 +427,7 @@ int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage) { char *tmp, *tmporig; TCHAR msg[MAX_BUFFER_LENGTH]; - mir_sntprintf(msg, _countof(msg), message, pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(msg, message, pcli->pfnGetContactDisplayName(hContact, 0)); if (_getOptB("LogActions", defaultLogActions)) { tmp = mir_u2a(msg); @@ -467,9 +467,9 @@ int LogToSystemHistory(char *message, char *origmessage) dbei.szModule = PLUGIN_NAME; dbei.pBlob = (PBYTE)msg; if (origmessage) - dbei.cbBlob = (1 + mir_snprintf(msg, _countof(msg), "%s: %s%s %s: %s", PLUGIN_NAME, message, DOT(message), Translate("Their message was"), origmessage)); + dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s %s: %s", PLUGIN_NAME, message, DOT(message), Translate("Their message was"), origmessage)); else - dbei.cbBlob = (1 + mir_snprintf(msg, _countof(msg), "%s: %s%s", PLUGIN_NAME, message, DOT(message))); + dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s", PLUGIN_NAME, message, DOT(message))); dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_READ; db_event_add(NULL, &dbei); diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index bbdb192c89..c21507ac6d 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -521,8 +521,8 @@ public: char aff[1024]; - mir_snprintf(dic, _countof(dic), "%S.dic", fileWithoutExtension); - mir_snprintf(aff, _countof(aff), "%S.aff", fileWithoutExtension); + mir_snprintf(dic, "%S.dic", fileWithoutExtension); + mir_snprintf(aff, "%S.aff", fileWithoutExtension); hunspell = new Hunspell(aff, dic); @@ -761,7 +761,7 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) } if (dict->localized_name[0] != 0) { - mir_sntprintf(dict->full_name, _countof(dict->full_name), _T("%s [%s]"), dict->localized_name, dict->language); + mir_sntprintf(dict->full_name, _T("%s [%s]"), dict->localized_name, dict->language); } break; } diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 832379eab5..ace5053d15 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -150,7 +150,7 @@ static int ModulesLoaded(WPARAM, LPARAM) sid.description.t = p->full_name; char lang[32]; - mir_snprintf(lang, _countof(lang), "spell_lang_%d", i); + mir_snprintf(lang, "spell_lang_%d", i); sid.pszName = lang; HICON hFlag = NULL, hFlagIcoLib = NULL; diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h index c9afe39df8..5a475e9286 100644 --- a/plugins/SplashScreen/src/debug.h +++ b/plugins/SplashScreen/src/debug.h @@ -17,7 +17,7 @@ int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...) TCHAR debug[1024];
va_start(va, fmt);
- mir_sntprintf(debug, _countof(debug), fmt, va);
+ mir_sntprintf(debug, fmt, va);
if(CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
POPUPDATAT ppd = { 0 };
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 88dd563466..608416ab05 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -65,11 +65,11 @@ void SplashMain() if (bstartup) {
// Retrive path to exe of current running Miranda is located
szMirDir = Utils_ReplaceVarsT(_T("%miranda_path%"));
- mir_sntprintf(szhAdvaimgPath, _countof(szhAdvaimgPath), _T("%s\\plugins\\advaimg.dll"), szMirDir);
+ mir_sntprintf(szhAdvaimgPath, _T("%s\\plugins\\advaimg.dll"), szMirDir);
CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion);
#ifdef _DEBUG
- mir_sntprintf(szLogFile, _countof(szLogFile), _T("%s\\%s.log"), szMirDir, _T(__PLUGIN_NAME));
+ mir_sntprintf(szLogFile, _T("%s\\%s.log"), szMirDir, _T(__PLUGIN_NAME));
initLog();
TCHAR *mirandaVerString = mir_a2t(szVersion);
logMessage(_T("Miranda version"), mirandaVerString);
@@ -104,7 +104,7 @@ void SplashMain() TCHAR *pos3 = 0;
pos3 = _tcsrchr(inBuf, _T(':'));
if (pos3 == NULL)
- mir_sntprintf(szSplashFile, _countof(szSplashFile), _T("%s\\%s"), szMirDir, inBuf);
+ mir_sntprintf(szSplashFile, _T("%s\\%s"), szMirDir, inBuf);
else
mir_tstrcpy(szSplashFile, inBuf);
@@ -122,7 +122,7 @@ void SplashMain() TCHAR *pos2;
pos2 = _tcschr(inBuf, _T(':'));
if (pos2 == NULL)
- mir_sntprintf(szSoundFile, _countof(szSoundFile), _T("%s\\%s"), szMirDir, inBuf);
+ mir_sntprintf(szSoundFile, _T("%s\\%s"), szMirDir, inBuf);
else
mir_tstrcpy(szSoundFile, inBuf);
@@ -145,7 +145,7 @@ void SplashMain() p = _tcsrchr(szSplashDir, _T('\\'));
if (p) *p = 0;
// create the search filter
- mir_sntprintf(szSearch, _countof(szSearch), _T("%s\\*.*"), szSplashDir);
+ mir_sntprintf(szSearch, _T("%s\\*.*"), szSplashDir);
// FFFN will return filenames
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA ffd;
@@ -179,7 +179,7 @@ void SplashMain() int r = 0;
if (filescount) r = (rand() % filescount) + 1;
- mir_sntprintf(szSplashFile, _countof(szSplashFile), _T("%s\\%s"), szSplashDir, files[r - 1]);
+ mir_sntprintf(szSplashFile, _T("%s\\%s"), szSplashDir, files[r - 1]);
#ifdef _DEBUG
logMessage(_T("final file"), szSplashFile);
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 70f0b2bb3e..536af1505a 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.png, *.bmp)%c*.png;*.bmp%c%c"), TranslateT("Graphic files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.png, *.bmp)%c*.png;*.bmp%c%c"), TranslateT("Graphic files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -239,7 +239,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c"), TranslateT("Sound Files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c"), TranslateT("Sound Files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = szTempPath;
diff --git a/plugins/SplashScreen/src/services.cpp b/plugins/SplashScreen/src/services.cpp index 6e3497cb6d..b89daaa23d 100644 --- a/plugins/SplashScreen/src/services.cpp +++ b/plugins/SplashScreen/src/services.cpp @@ -31,7 +31,7 @@ INT_PTR ShowSplashService(WPARAM wparam, LPARAM lparam) TCHAR *pos = _tcsrchr(filename, _T(':'));
if (pos == NULL)
- mir_sntprintf(szSplashFile, _countof(szSplashFile), _T("%s\\%s"), szMirDir, filename);
+ mir_sntprintf(szSplashFile, _T("%s\\%s"), szMirDir, filename);
else
mir_tstrcpy(szSplashFile, filename);
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp index 6550f5fda0..cab40ef640 100644 --- a/plugins/SplashScreen/src/splash.cpp +++ b/plugins/SplashScreen/src/splash.cpp @@ -42,9 +42,9 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM #ifdef _DEBUG
TCHAR b[40];
- mir_sntprintf(b, _countof(b), _T("%d"), wParam);
+ mir_sntprintf(b, _T("%d"), wParam);
logMessage(_T("Timer ID"), b);
- mir_sntprintf(b, _countof(b), _T("%d"), options.showtime);
+ mir_sntprintf(b, _T("%d"), options.showtime);
logMessage(_T("ShowTime value"), b);
#endif
@@ -229,7 +229,7 @@ void __cdecl SplashThread(void *arg) TCHAR verString[256] = { 0 };
TCHAR *mirandaVerString = mir_a2t(szVersion);
- mir_sntprintf(verString, _countof(verString), _T("%s%s"), szPrefix, mirandaVerString);
+ mir_sntprintf(verString, _T("%s%s"), szPrefix, mirandaVerString);
mir_free(mirandaVerString);
LOGFONT lf = { 0 };
lf.lfHeight = 14;
@@ -327,7 +327,7 @@ BOOL ShowSplash(BOOL bpreview) timeout = options.showtime;
#ifdef _DEBUG
TCHAR b[40];
- mir_sntprintf(b, _countof(b), _T("%d"), options.showtime);
+ mir_sntprintf(b, _T("%d"), options.showtime);
logMessage(_T("Timeout"), b);
#endif
}
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 0cc5698791..767fb8bfc7 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -160,16 +160,16 @@ void EnablePopupModule() void InitSettings()
{
if(gethostname(hostname, _countof(hostname)) == 0){
- mir_snprintf(EnabledComp, _countof(EnabledComp), "%s_Enabled", hostname);
- mir_snprintf(DelayComp, _countof(DelayComp), "%s_Delay", hostname);
- mir_snprintf(PopUpComp, _countof(PopUpComp), "%s_PopUp", hostname);
- mir_snprintf(PopUpTimeComp, _countof(PopUpTimeComp), "%s_PopUpTime", hostname);
- mir_snprintf(MenuitemComp, _countof(MenuitemComp), "%s_MenuItem", hostname);
- mir_snprintf(TTBButtonsComp, _countof(TTBButtonsComp), "%s_TTBButtons", hostname);
- mir_snprintf(DefSoundComp, _countof(DefSoundComp), "%s_DefSound", hostname);
- mir_snprintf(DefPopupComp, _countof(DefPopupComp), "%s_DefPopup", hostname);
- mir_snprintf(DefEnabledComp, _countof(DefEnabledComp), "%s_DefEnabled", hostname);
- mir_snprintf(NonStatusAllowComp, _countof(NonStatusAllowComp), "%s_NonStatusAllow", hostname);
+ mir_snprintf(EnabledComp, "%s_Enabled", hostname);
+ mir_snprintf(DelayComp, "%s_Delay", hostname);
+ mir_snprintf(PopUpComp, "%s_PopUp", hostname);
+ mir_snprintf(PopUpTimeComp, "%s_PopUpTime", hostname);
+ mir_snprintf(MenuitemComp, "%s_MenuItem", hostname);
+ mir_snprintf(TTBButtonsComp, "%s_TTBButtons", hostname);
+ mir_snprintf(DefSoundComp, "%s_DefSound", hostname);
+ mir_snprintf(DefPopupComp, "%s_DefPopup", hostname);
+ mir_snprintf(DefEnabledComp, "%s_DefEnabled", hostname);
+ mir_snprintf(NonStatusAllowComp, "%s_NonStatusAllow", hostname);
}
//first run on the host, initial setting
if (!(delay = db_get_dw(NULL, MODULE_NAME, DelayComp, 0)))
@@ -340,7 +340,7 @@ void RemoveTTButtons() HANDLE GetIconHandle(char *szIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MENU_NAME, szIcon);
+ mir_snprintf(szSettingName, "%s_%s", MENU_NAME, szIcon);
return IcoLib_GetIconHandle(szSettingName);
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 36e379aa59..c72083e891 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -213,7 +213,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH mir_cslock lck(GenStatusCS); char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", cs->szName); + mir_snprintf(dbSetting, "%s_enabled", cs->szName); cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus; if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) cs->status = ID_STATUS_DISABLED; @@ -521,7 +521,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) return 0; char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", ack->szModule); + mir_snprintf(dbSetting, "%s_enabled", ack->szModule); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return 0; @@ -934,7 +934,7 @@ static int ProcessPopup(int reason, LPARAM lParam) for (int i = 0; i < connectionSettings.getCount(); i++) { if (mir_tstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_sntprintf(protoInfoLine, _countof(protoInfoLine), TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); + mir_sntprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); mir_tstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_tstrlen(protoInfo) - 1); } } @@ -1052,7 +1052,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) return -1; char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled return -1; @@ -1078,7 +1078,7 @@ INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) char *szProto = (char *)lParam; char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return FALSE; diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index 5cafcaadbf..effa88cf8a 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -72,7 +72,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam ListView_InsertItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE));
lvItem.iItem++;
}
@@ -153,7 +153,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam ListView_GetItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
+ mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam);
db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index f5920c333b..eb9573b0ac 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -165,7 +165,7 @@ HRESULT CreateLink(TSettingsList& protoSettings) if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
_tcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
else
- mir_sntprintf(savePath, _countof(savePath), _T(".\\%s"), SHORTCUT_FILENAME);
+ mir_sntprintf(savePath, _T(".\\%s"), SHORTCUT_FILENAME);
// Get a pointer to the IShellLink interface.
IShellLink *psl;
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 0742c34198..da6db98855 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -107,7 +107,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM) mi.name.t = profilename; mi.position = 2000100000 + mcount; - mir_snprintf(servicename, _countof(servicename), "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); + mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); switch(mcount) { case 0: hProfileServices[mcount] = CreateServiceFunction(servicename, profileService0); @@ -190,7 +190,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) for ( int i=0; i < pceCount; i++ ) { if ( (pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { - mir_snprintf(dbSetting, _countof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(mir_tstrlen(dbv.ptszVal)+1)); if (pce[i].msg != NULL) { @@ -214,7 +214,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) pce[pceCount].profile = profile; pce[pceCount].szProto = _strdup(szProto); pce[pceCount].msg = NULL; - mir_snprintf(dbSetting, _countof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { pce[pceCount].msg = _tcsdup(dbv.ptszVal); db_free(&dbv); @@ -339,7 +339,7 @@ static int RegisterHotKeys() return -1; char atomname[255]; - mir_snprintf(atomname, _countof(atomname), "StatusProfile_%d", i); + mir_snprintf(atomname, "StatusProfile_%d", i); hkInfo[hkiCount].id = GlobalAddAtomA(atomname); if (hkInfo[hkiCount].id == 0) continue; diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index 7f0afc3e37..9da5d6ccf5 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -168,7 +168,7 @@ static void SetLastStatusMessages(TSettingsList &ps) continue;
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
+ mir_snprintf(dbSetting, "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
@@ -301,9 +301,9 @@ static int OnOkToExit(WPARAM, LPARAM) continue;
char lastName[128], lastMsg[128];
- mir_snprintf(lastName, _countof(lastName), "%s%s", PREFIX_LAST, pa->szModuleName);
+ mir_snprintf(lastName, "%s%s", PREFIX_LAST, pa->szModuleName);
db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
- mir_snprintf(lastMsg, _countof(lastMsg), "%s%s", PREFIX_LASTMSG, pa->szModuleName);
+ mir_snprintf(lastMsg, "%s%s", PREFIX_LASTMSG, pa->szModuleName);
db_unset(NULL, MODULENAME, lastMsg);
if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG))
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 5b5ecca46d..e652dc004e 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -269,7 +269,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // LAST STATUS
if (proto->status == ID_STATUS_LAST) {
TCHAR last[80];
- mir_sntprintf(last, _countof(last), _T("%s (%s)"), TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_sntprintf(last, _T("%s (%s)"), TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last);
actualStatus = proto->lastStatus;
}
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else if (proto->status == ID_STATUS_CURRENT) {
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
TCHAR current[80];
- mir_sntprintf(current, _countof(current), _T("%s (%s)"), TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_sntprintf(current, _T("%s (%s)"), TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current);
actualStatus = currentStatus;
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index f5dba28146..db8b222025 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -72,7 +72,7 @@ static void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd) //modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden - mir_snprintf(SettingName, _countof(SettingName), "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); + mir_snprintf(SettingName, "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) { token = strtok(dbv.pszVal, "_"); @@ -830,8 +830,8 @@ void CB_WriteButtonSettings(MCONTACT hContact, CustomButtonData *cbd) //modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden - mir_snprintf(SettingName, _countof(SettingName), "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); - mir_snprintf(SettingParameter, _countof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->m_dwPosition, cbd->m_bIMButton, cbd->m_bChatButton, cbd->m_bLSided, cbd->m_bRSided, cbd->m_bCanBeHidden); + mir_snprintf(SettingName, "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); + mir_snprintf(SettingParameter, "%d_%u_%u_%u_%u_%u", cbd->m_dwPosition, cbd->m_bIMButton, cbd->m_bChatButton, cbd->m_bLSided, cbd->m_bRSided, cbd->m_bCanBeHidden); if (!(cbd->m_opFlags & BBSF_NTBDESTRUCT)) db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter); else diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 19e37c2676..f44bea11fc 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -537,7 +537,7 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
- mir_sntprintf(szTemp2, _countof(szTemp2), _T("~~++#%s#++~~"), szTemp);
+ mir_sntprintf(szTemp2, _T("~~++#%s#++~~"), szTemp);
else
_tcsncpy_s(szTemp2, szTemp, _TRUNCATE);
@@ -723,7 +723,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) if (streamData->dat->dwFlags & MWF_DIVIDERWANTED || lin->dwFlags & MWF_DIVIDERWANTED) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
lin->dwFlags |= MWF_DIVIDERWANTED;
if (lin->prev || !streamData->bRedraw)
@@ -750,13 +750,13 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) int iii;
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY);
str.Append(szStyle);
}
else {
iii = lin->bIsHighlighted ? 16 : EventToIndex(lin);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY);
str.Append(szStyle);
}
@@ -982,7 +982,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra // this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
TCHAR szPattern[50];
- mir_sntprintf(szPattern, _countof(szPattern), _T("~-+%d+-~"), si->pLogEnd);
+ mir_sntprintf(szPattern, _T("~-+%d+-~"), si->pLogEnd);
FINDTEXTEX fi;
fi.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 9ac88e10b5..3ae21bda9e 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -184,7 +184,7 @@ static void OnLoadSettings() for (int i = 0; i < 5; i++) {
char szBuf[40];
- mir_snprintf(szBuf, _countof(szBuf), "NickColor%d", i);
+ mir_snprintf(szBuf, "NickColor%d", i);
g_Settings.nickColors[i] = M.GetDword(CHAT_MODULE, szBuf, g_Settings.UserListColors[0]);
}
g_Settings.nickColors[5] = M.GetDword(CHAT_MODULE, "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index cba62770ff..8b857c7eb2 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM TCHAR tszTooltipText[2048];
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText),
+ mir_sntprintf(tszTooltipText,
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
@@ -757,12 +757,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM *p1 = 0;
TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
- mir_sntprintf(tszInitialDir, _countof(tszInitialDir), _T("%s%s"), M.getChatLogPath(), p);
+ mir_sntprintf(tszInitialDir, _T("%s%s"), M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
_tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
- mir_sntprintf(tszTemp, _countof(tszTemp), _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0);
+ mir_sntprintf(tszTemp, _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrInitialDir = tszInitialDir;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index d33f093eba..5b82f8b8e4 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -113,10 +113,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_sntprintf(pd.lptzContactName, _countof(pd.lptzContactName), _T("%s - %s"),
- (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
- pcli->pfnGetContactDisplayName(hContact, 0));
-
+ mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
_tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
@@ -536,7 +533,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up"));
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 56cc362ab0..a7490efb38 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1323,7 +1323,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), TranslateT("Nickname"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1671,7 +1671,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s"), + mir_sntprintf(tszBuf, _T("<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s"), TranslateT("Nick"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1976,17 +1976,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar else if (diff > 59) { DWORD hours = diff / 60; DWORD minutes = diff % 60; - mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? + mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? TranslateT("hours") : TranslateT("hour"), minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute")); } - else mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); + else mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); } - mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); + mir_sntprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); } else { if (si->ptszStatusbarText) - mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); + mir_sntprintf(szFinalStatusBarText, _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); else _tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); } @@ -3165,7 +3165,7 @@ LABEL_SHOWWINDOW: DBVARIANT dbv = { 0 }; char szIndex[10]; char *szKey = "TAB_ContainersW"; - mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU); + mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU); if (iSelection - IDM_CONTAINERMENU >= 0) { if (!db_get_ts(NULL, szKey, szIndex, &dbv)) { SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal); diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 0787ab83e0..e6e829119b 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -190,7 +190,7 @@ bool CContactCache::updateUIN() mir_free(ci.pszVal); break; case CNFT_DWORD: - mir_sntprintf(m_szUIN, _countof(m_szUIN), _T("%u"), ci.dVal); + mir_sntprintf(m_szUIN, _T("%u"), ci.dVal); break; } } diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 8eb2bcea84..e8bb310e01 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, }
else {
char szCName[CONTAINER_NAMELEN + 20];
- mir_snprintf(szCName, _countof(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) {
if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName))
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
@@ -1334,14 +1334,14 @@ panel_found: pContainer->settings = &PluginConfig.globalContainerSettings;
pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
- mir_snprintf(szCname, _countof(szCname), "%s_theme", CONTAINER_PREFIX);
+ mir_snprintf(szCname, "%s_theme", CONTAINER_PREFIX);
if (!db_get_ts(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == NULL) {
- mir_snprintf(szCname, _countof(szCname), "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (!db_get_ts(NULL, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
@@ -1713,13 +1713,13 @@ panel_found: }
else {
char szCName[40];
- mir_snprintf(szCName, _countof(szCName), "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
- mir_snprintf(szCName, _countof(szCName), "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
- mir_snprintf(szCName, _countof(szCName), "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szCName, _countof(szCName), "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(0, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
@@ -1737,7 +1737,7 @@ panel_found: SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
char szCName[40];
- mir_snprintf(szCName, _countof(szCName), "%s_theme", CONTAINER_PREFIX);
+ mir_snprintf(szCName, "%s_theme", CONTAINER_PREFIX);
if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
@@ -1900,7 +1900,7 @@ int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size _tcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
TCHAR fmt[30];
- mir_sntprintf(fmt, _countof(fmt), _T("%%%d.%ds..."), cutMax, cutMax);
+ mir_sntprintf(fmt, _T("%%%d.%ds..."), cutMax, cutMax);
mir_sntprintf(newname, size, fmt, oldname);
}
return 0;
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 61d55a1718..efae584b93 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, TranslateDialogDefault(hwndDlg);
SetWindowText(hwndDlg, TranslateT("Container options"));
TCHAR szNewTitle[128];
- mir_sntprintf(szNewTitle, _countof(szNewTitle), _T("%s"), !mir_tstrcmp(pContainer->szName, _T("default")) ?
+ mir_sntprintf(szNewTitle, _T("%s"), !mir_tstrcmp(pContainer->szName, _T("default")) ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
Utils::enableDlgControl(hwndDlg, IDC_O_HIDETITLE, !CSkin::m_frameSkins);
@@ -258,7 +258,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, else {
if (pContainer->settings != &PluginConfig.globalContainerSettings) {
char szCname[40];
- mir_snprintf(szCname, _countof(szCname), "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
pContainer->settings->fPrivate = false;
db_set_blob(0, SRMSGMOD_T, szCname, pContainer->settings, sizeof(TContainerSettings));
mir_free(pContainer->settings);
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index dc6f9fc897..2b756b52f0 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -966,12 +966,12 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (!mir_strcmp(sid->szModule, MSG_ICON_MODULE)) {
if (sid->dwId == MSG_ICON_SOUND)
- mir_sntprintf(wBuf, _countof(wBuf), TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
+ mir_sntprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && dat && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) {
int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
- mir_sntprintf(wBuf, _countof(wBuf), TranslateT("Sending typing notifications is %s."),
+ mir_sntprintf(wBuf, TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
@@ -997,7 +997,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
- mir_sntprintf(wBuf, _countof(wBuf), szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
+ mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 68a3918fbb..83c12082e3 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -500,7 +500,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) TCHAR szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(szHeader, _countof(szHeader), _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1);
+ mir_sntprintf(szHeader, _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1);
else
szHeader[0] = 0;
@@ -513,7 +513,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) TCHAR timestamp[MAX_DATASIZE];
_tcsftime(timestamp, MAX_DATASIZE, _T("%Y.%m.%d %H:%M"), _localtime32((__time32_t *)&dbe.timestamp));
- mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, _countof(pdata->eventData[pdata->nrMerged].tszText), _T("\n\n%s\n"), timestamp);
+ mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, _T("\n\n%s\n"), timestamp);
TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
@@ -672,7 +672,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
TCHAR szMenuEntry[80];
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszProto,
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : _T("(undef)"), mii.dwItemData & 0x0000ffff);
if (!bForced)
@@ -717,7 +717,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (fromEvent == 2) // from chat...
mii.dwItemData |= 0x10000000;
DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND);
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
PluginConfig.m_UnreadInTray++;
if (PluginConfig.m_UnreadInTray)
@@ -727,7 +727,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro else {
szNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (CheckMenuItem(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == -1) {
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
mii.dwItemData = fromEvent ? 1 : 0;
PluginConfig.m_UnreadInTray += (mii.dwItemData & 0x0000ffff);
@@ -745,7 +745,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro mii.fMask |= MIIM_STRING;
if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index adcc0acbe8..8e7ad1bcdd 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -45,12 +45,12 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) else if (dat) { TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH]; mir_sntprintf(szFilter, _T("%s%c*.rtf%c%c"), TranslateT("Rich Edit file"), 0, 0, 0); - mir_sntprintf(szFilename, _countof(szFilename), _T("%s.rtf"), dat->cache->getNick()); + mir_sntprintf(szFilename, _T("%s.rtf"), dat->cache->getNick()); Utils::sanitizeFilename(szFilename); TCHAR szInitialDir[MAX_PATH + 2]; - mir_sntprintf(szInitialDir, _countof(szInitialDir), _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs")); + mir_sntprintf(szInitialDir, _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs")); CreateDirectoryTreeT(szInitialDir); OPENFILENAME ofn = { 0 }; @@ -613,7 +613,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); TCHAR tStr[80]; - mir_sntprintf(tStr, _countof(tStr), _T("%s %d.%d.%d.%d [build %d]"), + mir_sntprintf(tStr, _T("%s %d.%d.%d.%d [build %d]"), TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr); } @@ -1002,7 +1002,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat) if (!PluginConfig.m_bDontUseDefaultKbd) { TCHAR szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); - mir_sntprintf(szKLName, _countof(szKLName), _T("0000%s"), szBuf); + mir_sntprintf(szKLName, _T("0000%s"), szBuf); db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); } else { @@ -1040,7 +1040,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) TCHAR szBuf[100]; if (dat->bShowTyping) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]); - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s is typing a message..."), dat->cache->getNick()); + mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick()); } else if (dat->sbCustom) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)dat->sbCustom->hIcon); @@ -1051,14 +1051,14 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR) - mir_sntprintf(szBuf, _countof(szBuf), _T("UID: %s"), dat->cache->getUIN()); + mir_sntprintf(szBuf, _T("UID: %s"), dat->cache->getUIN()); else if (dat->lastMessage) { TCHAR date[64], time[64]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6) date[mir_tstrlen(date) - 5] = 0; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0); - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Last received: %s at %s"), date, time); + mir_sntprintf(szBuf, TranslateT("Last received: %s at %s"), date, time); } else szBuf[0] = 0; } @@ -1378,7 +1378,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) dat->bShowTyping = 2; dat->nTypeSecs = 86400; - mir_sntprintf(dat->szStatusBar, _countof(dat->szStatusBar), TranslateT("%s has entered text."), dat->cache->getNick()); + mir_sntprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick()); if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)dat->szStatusBar); } @@ -1403,7 +1403,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) UpdateStatusBar(dat); } else if (dat->nTypeSecs > 0) { - mir_sntprintf(dat->szStatusBar, _countof(dat->szStatusBar), TranslateT("%s is typing a message"), dat->cache->getNick()); + mir_sntprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick()); dat->nTypeSecs--; if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) { @@ -1596,7 +1596,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; TCHAR szBuf[100]; - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), + mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), dat->iNextQueuedEvent); SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE); @@ -1748,7 +1748,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) if (mir_tstrlen(newcontactname) != 0) { if (PluginConfig.m_bStatusOnTabs) - mir_sntprintf(newtitle, _countof(newtitle), _T("%s (%s)"), newcontactname, dat->szStatus); + mir_sntprintf(newtitle, _T("%s (%s)"), newcontactname, dat->szStatus); else _tcsncpy_s(newtitle, newcontactname, _TRUNCATE); } @@ -1760,13 +1760,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) TCHAR fulluin[256]; if (dat->bIsMeta) - mir_sntprintf(fulluin, _countof(fulluin), - TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), - bHasName ? dat->cache->getUIN() : TranslateT("No UID")); + mir_sntprintf(fulluin, + TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), + bHasName ? dat->cache->getUIN() : TranslateT("No UID")); else - mir_sntprintf(fulluin, _countof(fulluin), - TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), - bHasName ? dat->cache->getUIN() : TranslateT("No UID")); + mir_sntprintf(fulluin, + TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), + bHasName ? dat->cache->getUIN() : TranslateT("No UID")); SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); } diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 71caabbe25..de11658856 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -545,7 +545,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) cle.hDbEvent = hDbEvent;
TCHAR toolTip[256];
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 2cf7ed0abc..5b2cccb984 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -496,7 +496,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) time_t diff = time(NULL) - m_dat->idle;
int i_hrs = diff / 3600;
int i_mins = (diff - i_hrs * 3600) / 60;
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
+ mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
else _tcscpy_s(szBuf, 256, tszUin);
@@ -613,7 +613,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) if (m_height < DEGRADE_THRESHOLD) {
TCHAR tszText[2048];
- mir_sntprintf(tszText, _countof(tszText), TranslateT("Topic is: %s"),
+ mir_sntprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -670,7 +670,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) SIZE szTitle;
TCHAR szPrefix[100];
- mir_sntprintf(szPrefix, _countof(szPrefix), TranslateT("Topic is: %s"), _T(""));
+ mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), _T(""));
::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
@@ -1061,11 +1061,11 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
{
TCHAR tszTitle[100];
- mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("Set panel visibility for this %s"),
+ mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
- mir_sntprintf(tszTitle, _countof(tszTitle), m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
+ mir_sntprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
TranslateT("Do not synchronize the panel height with group chat windows"));
::SetDlgItemText(hwnd, IDC_NOSYNC, tszTitle);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 9d71be195b..0672bb15f9 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -149,7 +149,7 @@ void CMimAPI::InitPaths() { const TCHAR *szUserdataDir = getUserDir(); - mir_sntprintf(m_szProfilePath, _countof(m_szProfilePath), _T("%stabSRMM"), szUserdataDir); + mir_sntprintf(m_szProfilePath, _T("%stabSRMM"), szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { _tcsncpy_s(m_szChatLogsPath, _T("%miranda_logpath%"), _TRUNCATE); _tcsncpy_s(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); @@ -164,7 +164,7 @@ void CMimAPI::InitPaths() Utils::ensureTralingBackslash(m_szSkinsPath); - mir_sntprintf(m_szSavedAvatarsPath, _countof(m_szSavedAvatarsPath), _T("%s\\Saved Contact Pictures"), m_szProfilePath); + mir_sntprintf(m_szSavedAvatarsPath, _T("%s\\Saved Contact Pictures"), m_szProfilePath); } bool CMimAPI::getAeroState() @@ -299,7 +299,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) if (mode) { TCHAR szTip[256]; - mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) { MIRANDASYSTRAYNOTIFY tn; tn.szProto = NULL; @@ -550,7 +550,7 @@ nowindowcreate: cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; contactName = pcli->pfnGetContactDisplayName(hContact, 0); - mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), contactName); + mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 04b8cea8dd..42c2c16eb1 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -43,7 +43,7 @@ static TCHAR* getMenuEntry(int i)
{
char MEntry[256];
- mir_snprintf(MEntry, _countof(MEntry), "MenuEntry_%u", i);
+ mir_snprintf(MEntry, "MenuEntry_%u", i);
return db_get_tsa(NULL, "tabmodplus", MEntry);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 2684e40073..e5b790f142 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2326,8 +2326,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer
SendJob *job = sendQueue->getJobByIndex(iIndex);
KillTimer(hwndDlg, wParam);
- mir_sntprintf(job->szErrorMsg, _countof(job->szErrorMsg), TranslateT("Delivery failure: %s"),
- TranslateT("The message send timed out"));
+ mir_sntprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
job->iStatus = SendQueue::SQ_ERROR;
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
@@ -2544,7 +2543,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char szIndex[10];
char *szKey = "TAB_ContainersW";
- mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU);
+ mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
ptrT val(db_get_tsa(NULL, szKey, szIndex));
if (val)
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 8bbf9a2ede..2bae8fe5e1 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -135,12 +135,12 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) DWORD setView = 1;
TCHAR szTimestamp[100];
- mir_sntprintf(szTimestamp, _countof(szTimestamp), _T("%04u %02u %02u_%02u%02u"), lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
+ mir_sntprintf(szTimestamp, _T("%04u %02u %02u_%02u%02u"), lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
TCHAR *szProto = mir_a2t(dat->cache->getActiveProto());
TCHAR szFinalPath[MAX_PATH];
- mir_sntprintf(szFinalPath, _countof(szFinalPath), _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
+ mir_sntprintf(szFinalPath, _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
mir_free(szProto);
if (CreateDirectory(szFinalPath, 0) == 0) {
@@ -153,17 +153,17 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) TCHAR szBaseName[MAX_PATH];
if (isOwnPic)
- mir_sntprintf(szBaseName, _countof(szBaseName), _T("My Avatar_%s"), szTimestamp);
+ mir_sntprintf(szBaseName, _T("My Avatar_%s"), szTimestamp);
else
- mir_sntprintf(szBaseName, _countof(szBaseName), _T("%s_%s"), dat->cache->getNick(), szTimestamp);
+ mir_sntprintf(szBaseName, _T("%s_%s"), dat->cache->getNick(), szTimestamp);
- mir_sntprintf(szFinalFilename, _countof(szFinalFilename), _T("%s.png"), szBaseName);
+ mir_sntprintf(szFinalFilename, _T("%s.png"), szBaseName);
// do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.bmp;*.png;*.jpg;*.gif%c%c"), TranslateT("Image files"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.bmp;*.png;*.jpg;*.gif%c%c"), TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrDefExt = _T("png");
@@ -1048,7 +1048,7 @@ void TSAPI GetMYUIN(TWindowData *dat) mir_free((void*)ci.pszVal);
break;
case CNFT_DWORD:
- mir_sntprintf(dat->myUin, _countof(dat->myUin), _T("%u"), ci.dVal);
+ mir_sntprintf(dat->myUin, _T("%u"), ci.dVal);
break;
default:
dat->myUin[0] = 0;
@@ -1285,7 +1285,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) TCHAR szKey[20];
DWORD dwLID = _tcstoul(szKLName, &stopped, 16);
- mir_sntprintf(szKey, _countof(szKey), _T("%04.04x"), LOWORD(dwLID));
+ mir_sntprintf(szKey, _T("%04.04x"), LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("MIME\\Database\\Rfc1766"), 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
@@ -1305,7 +1305,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) _tcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
- mir_sntprintf(dat->lcID, _countof(dat->lcID), szLI);
+ mir_sntprintf(dat->lcID, szLI);
GetStringTypeA(dat->lcid, CT_CTYPE2, (char*)szTest, 3, wCtype2);
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
@@ -1956,7 +1956,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) if (filename[0] == 0) { // prompting to save
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.jpg%c%c"), TranslateT("JPEG-compressed images"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.jpg%c%c"), TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
dlg.lStructSize = sizeof(dlg);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 3bcf1b8a56..a02cbf2f66 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -129,9 +129,9 @@ void TSAPI CacheLogFonts() memset(logfonts, 0, (sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2)));
for (int i = 0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
- mir_snprintf(rtfFontsGlobal[i], _countof(rtfFontsGlobal[i]), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
+ mir_snprintf(rtfFontsGlobal[i], "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
}
- mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], _countof(rtfFontsGlobal[MSGDLGFONTCOUNT]), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
+ mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
_tcsncpy(szToday, TranslateT("Today"), 20);
_tcsncpy(szYesterday, TranslateT("Yesterday"), 20);
@@ -460,7 +460,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (dwEffectiveFlags & MWF_DIVIDERWANTED) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
str.AppendFormat("\\sl-1\\slmult0\\highlight%d\\cf%d\\-\\par\\sl0", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS);
dat->dwFlags &= ~MWF_DIVIDERWANTED;
@@ -1029,7 +1029,7 @@ static void SetupLogFormatting(TWindowData *dat) if (dat->hHistoryEvents)
strncpy_s(dat->szMicroLf, "\\v\\cf%d \\ ~-+%d+-~\\v0 ", _TRUNCATE);
else
- mir_snprintf(dat->szMicroLf, _countof(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
+ mir_snprintf(dat->szMicroLf, "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
}
static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
@@ -1139,7 +1139,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe if (dat->hHistoryEvents && dat->curHistory == dat->maxHistory) {
char szPattern[50];
- mir_snprintf(szPattern, _countof(szPattern), "~-+%d+-~", (INT_PTR)dat->hHistoryEvents[0]);
+ mir_snprintf(szPattern, "~-+%d+-~", (INT_PTR)dat->hHistoryEvents[0]);
FINDTEXTEXA ft;
ft.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index e73b29fc00..d1930bc4da 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -75,7 +75,7 @@ void TSAPI LoadLogfont(int i, LOGFONTA * lf, COLORREF * colour, char *szModule) lf->lfClipPrecision = lfResult.lfClipPrecision;
lf->lfQuality = lfResult.lfQuality;
lf->lfPitchAndFamily = lfResult.lfPitchAndFamily;
- mir_snprintf(lf->lfFaceName, _countof(lf->lfFaceName), "%S", lfResult.lfFaceName);
+ mir_snprintf(lf->lfFaceName, "%S", lfResult.lfFaceName);
}
}
@@ -97,7 +97,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) {
bool fValid = false;
TCHAR tszMask[MAX_PATH];
- mir_sntprintf(tszMask, _countof(tszMask), _T("%s*.*"), tszFolder);
+ mir_sntprintf(tszMask, _T("%s*.*"), tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
@@ -117,7 +117,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) LRESULT lr;
TCHAR szBuf[255];
- mir_sntprintf(tszFinalName, _countof(tszFinalName), _T("%s%s"), tszFolder, fd.cFileName);
+ mir_sntprintf(tszFinalName, _T("%s%s"), tszFolder, fd.cFileName);
GetPrivateProfileString(_T("Global"), _T("Name"), _T("None"), szBuf, _countof(szBuf), tszFinalName);
if (!mir_tstrcmp(szBuf, _T("None"))) {
@@ -153,7 +153,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) _tcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
- mir_sntprintf(tszFindMask, _countof(tszFindMask), _T("%s*.*"), tszSkinRoot);
+ mir_sntprintf(tszFindMask, _T("%s*.*"), tszSkinRoot);
SendMessage(hwndCombobox, CB_RESETCONTENT, 0, 0);
SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)TranslateT("<no skin>"));
@@ -163,7 +163,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
TCHAR tszSubDir[MAX_PATH];
- mir_sntprintf(tszSubDir, _countof(tszSubDir), _T("%s%s\\"), tszSkinRoot, fd.cFileName);
+ mir_sntprintf(tszSubDir, _T("%s%s\\"), tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
if (FindNextFile(h, &fd) == 0)
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 5f7569d711..fc987b266e 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -484,9 +484,9 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
- mir_sntprintf(tabtitle, _countof(tabtitle), _T("%s (%s) "), newcontactname, szStatus);
+ mir_sntprintf(tabtitle, _T("%s (%s) "), newcontactname, szStatus);
else
- mir_sntprintf(tabtitle, _countof(tabtitle), _T("%s "), newcontactname);
+ mir_sntprintf(tabtitle, _T("%s "), newcontactname);
newData.item.pszText = tabtitle;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -1046,7 +1046,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), nextStgId++);
+ mir_sntprintf(sztName, _T("s%u"), nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 37d0646153..c45e048f00 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (lParam) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (dat) {
- mir_sntprintf(szNewTitle, _countof(szNewTitle), TranslateT("Select container for %s"), dat->cache->getNick());
+ mir_sntprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
SetWindowText(hwndDlg, szNewTitle);
}
}
@@ -178,7 +178,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L char szValue[10];
TContainerData *pContainer = 0;
do {
- mir_snprintf(szValue, _countof(szValue), "%d", iCounter);
+ mir_snprintf(szValue, "%d", iCounter);
if (db_get_ts(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 161431984b..508d2b7aa8 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -73,7 +73,7 @@ void CSendLaterJob::cleanDB() db_set_dw(hContact, "SendLater", "count", iCount);
// delete flags
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
db_unset(hContact, "SendLater", szKey);
}
}
@@ -87,7 +87,7 @@ void CSendLaterJob::readFlags() char szKey[100];
DWORD localFlags;
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
localFlags = db_get_dw(hContact, "SendLater", szKey, 0);
if (localFlags & SLF_SUSPEND)
@@ -104,7 +104,7 @@ void CSendLaterJob::writeFlags() DWORD localFlags = (bCode == JOB_HOLD ? SLF_SUSPEND : 0);
char szKey[100];
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
db_set_dw(hContact, "SendLater", szKey, localFlags);
}
}
@@ -130,12 +130,12 @@ CSendLaterJob::~CSendLaterJob() _tcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("A send later job completed successfully.\nThe original message: %s"),
+ mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
else if (fFailed) {
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("A send later job failed to complete.\nThe original message: %s"),
+ mir_sntprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
@@ -538,7 +538,7 @@ void CSendLater::qMgrFillList(bool fClear) lvItem.mask = LVIF_TEXT | LVIF_PARAM;
TCHAR tszBuf[255];
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s [%s]"), tszNick, c->getRealAccount());
+ mir_sntprintf(tszBuf, _T("%s [%s]"), tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
lvItem.iItem = uIndex++;
@@ -590,7 +590,7 @@ void CSendLater::qMgrFillList(bool fClear) bCode = p->bCode;
TCHAR tszStatus[20];
- mir_sntprintf(tszStatus, _countof(tszStatus), _T("X/%s[%c] (%d)"), tszStatusText, bCode, p->iSendCount);
+ mir_sntprintf(tszStatus, _T("X/%s[%c] (%d)"), tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
lvItem.iSubItem = 3;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 9824a8f5a8..dc6407bf1d 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -215,7 +215,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) if (iSendLength >= iMinLength) { TCHAR tszError[256]; - mir_sntprintf(tszError, _countof(tszError), TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); + mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); ::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); sendQueue->clearJob(iEntry); return 0; @@ -270,7 +270,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) size_t iSendLength = getSendLength(iEntry); if (iSendLength >= dat->nMax) { - mir_sntprintf(tszError, _countof(tszError), TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax); + mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax); SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); clearJob(iEntry); return 0; @@ -540,7 +540,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam) SkinPlaySound("SendError"); TCHAR *szAckMsg = mir_a2t((char *)ack->lParam); - mir_sntprintf(job.szErrorMsg, _countof(job.szErrorMsg), TranslateT("Delivery failure: %s"), szAckMsg); + mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg); job.iStatus = SQ_ERROR; mir_free(szAckMsg); KillTimer(dat->hwnd, TIMERID_MSGSEND + iFound); @@ -679,10 +679,10 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b time_t now = time(0); TCHAR tszTimestamp[30]; _tcsftime(tszTimestamp, _countof(tszTimestamp), _T("%Y.%m.%d - %H:%M"), _localtime32((__time32_t *)&now)); - mir_snprintf(szKeyName, _countof(szKeyName), "S%d", now); - mir_sntprintf(tszHeader, _countof(tszHeader), TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); + mir_snprintf(szKeyName, "S%d", now); + mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } - else mir_sntprintf(tszHeader, _countof(tszHeader), _T("M%d|"), time(0)); + else mir_sntprintf(tszHeader, _T("M%d|"), time(0)); T2Utf utf_header(tszHeader); size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10; diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index da2f462594..9f06fa6957 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -108,7 +108,7 @@ int _DebugTraceW(const wchar_t *fmt, ...) GetLocalTime(&st); - mir_snprintf(tszTime, _countof(tszTime), "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); + mir_snprintf(tszTime, "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); mir_vsntprintf(debug, ibsize - 10, fmt, va); @@ -120,7 +120,7 @@ int _DebugTraceW(const wchar_t *fmt, ...) FILE *f; CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szDataPath); - mir_snprintf(szLogFileName, _countof(szLogFileName), "%s\\%s", szDataPath, "tabsrmm_debug.log"); + mir_snprintf(szLogFileName, "%s\\%s", szDataPath, "tabsrmm_debug.log"); f = fopen(szLogFileName, "a+"); if (f) { fputs(tszTime, f); diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 16eb8bcf4f..9021ba569c 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -686,7 +686,7 @@ void CThumbBase::renderBase() wchar_t tszTemp[30];
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(tszTemp, _countof(tszTemp), TranslateT("%d unread"), m_dat->dwUnread);
+ mir_sntprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, tszTemp, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
}
m_rcIcon = m_rcTop;
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 38e246a13c..0177193eb7 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -363,7 +363,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->dwFlags = MWF_LOG_ALL; dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL); dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE; - mir_sntprintf(dat->szMyNickname, _countof(dat->szMyNickname), _T("My Nickname")); + mir_sntprintf(dat->szMyNickname, _T("My Nickname")); StreamInEvents(hwndDlg, 0, 1, 0, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 62c9f2db30..05fb1ee579 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -193,7 +193,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) WritePrivateProfileStringA(fontBlocks[n].szBLockname, "Valid", "1", szIniFilename);
for (i = 0; i < fontBlocks[n].iCount; i++) {
mir_snprintf(szTemp, "Font%d", firstIndex + i);
- mir_snprintf(szAppname, _countof(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
+ mir_snprintf(szAppname, fontBlocks[n].szIniTemp, firstIndex + i);
if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
db_free(&dbv);
@@ -274,7 +274,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in }
for (i = 0; i < fontBlocks[n].iCount; i++) {
mir_snprintf(szTemp, "Font%d", firstIndex + i);
- mir_snprintf(szAppname, _countof(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
+ mir_snprintf(szAppname, fontBlocks[n].szIniTemp, firstIndex + i);
if (GetPrivateProfileStringA(szAppname, "Face", "Verdana", szBuf, sizeof(szBuf), szIniFilename) != 0) {
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
strncpy_s(szBuf, "Arial", _TRUNCATE);
@@ -425,7 +425,7 @@ const TCHAR* TSAPI GetThemeFileName(int iMode) szFilename[0] = 0;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.tabsrmm%c%c"), TranslateT("TabSRMM themes"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.tabsrmm%c%c"), TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 5179006977..a45aaa2923 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1212,7 +1212,7 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon) TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
_tsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
- mir_sntprintf(szImagePath, _countof(szImagePath), _T("%s\\%s\\%s"), szDrive, szDir, buffer);
+ mir_sntprintf(szImagePath, _T("%s\\%s\\%s"), szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
else hIcon = NULL;
@@ -1241,12 +1241,12 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_sntprintf(def_color, _countof(def_color), _T("%6.6x"), clr);
+ mir_sntprintf(def_color, _T("%6.6x"), clr);
GetPrivateProfileString(szItem, _T("Color1"), def_color, buffer, 400, m_tszFileName);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_sntprintf(def_color, _countof(def_color), _T("%6.6x"), clr);
+ mir_sntprintf(def_color, _T("%6.6x"), clr);
GetPrivateProfileString(szItem, _T("Color2"), def_color, buffer, 400, m_tszFileName);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -1316,7 +1316,7 @@ void CSkin::ReadImageItem(const TCHAR *itemname) // handle the assignments of image items to skin items
for (int n = 0;; n++) {
- mir_sntprintf(szItemNr, _countof(szItemNr), _T("Item%d"), n);
+ mir_sntprintf(szItemNr, _T("Item%d"), n);
GetPrivateProfileString(itemname, szItemNr, _T("None"), buffer, 500, m_tszFileName);
if (!mir_tstrcmp(buffer, _T("None")))
break;
@@ -1481,7 +1481,7 @@ void CSkin::Load(void) GetPrivateProfileString(_T("Theme"), _T("File"), _T("None"), buffer, MAX_PATH, m_tszFileName);
_tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, _countof(szFinalName), _T("%s\\%s\\%s"), szDrive, szPath, buffer);
+ mir_sntprintf(szFinalName, _T("%s\\%s\\%s"), szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index be8986039b..8f58735147 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -151,7 +151,7 @@ public: CImageItem(const TCHAR *szName)
{
memset(this, 0, sizeof(CImageItem));
- mir_sntprintf(m_szName, _countof(m_szName), szName);
+ mir_sntprintf(m_szName, szName);
m_szName[39] = 0;
}
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index a0954e031b..9db2c36379 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -90,7 +90,7 @@ static void TrayAnimThread(LPVOID) void TSAPI CreateTrayMenus(int mode)
{
if (mode) {
- mir_sntprintf(g_eventName, _countof(g_eventName), _T("tsr_evt_%d"), GetCurrentThreadId());
+ mir_sntprintf(g_eventName, _T("tsr_evt_%d"), GetCurrentThreadId());
g_hEvent = CreateEvent(NULL, FALSE, FALSE, g_eventName);
isAnimThreadRunning = TRUE;
hTrayAnimThread = mir_forkthread(TrayAnimThread, NULL);
@@ -217,7 +217,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con if (acc && acc->tszAccountName) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
if (hMenu == PluginConfig.g_hMenuRecent) {
if (CheckMenuItem(hMenu, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == 0) {
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 6cbc66c579..083d35f76e 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -530,8 +530,8 @@ int TN_ModuleInit() for (i = 0; i < _countof(colorPicker); i++)
colorPicker[i].color = M.GetDword(Module, colorPicker[i].desc, 0);
- mir_sntprintf(szStart, _countof(szStart), TranslateT("...is typing a message."));
- mir_sntprintf(szStop, _countof(szStop), TranslateT("...has stopped typing."));
+ mir_sntprintf(szStart, TranslateT("...is typing a message."));
+ mir_sntprintf(szStop, TranslateT("...has stopped typing."));
if (PluginConfig.g_bPopupAvail && ShowMenu) {
hTypingNotify = CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 1892993c53..403622be5e 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -152,7 +152,7 @@ search_again: clr_found = true;
if (was_added) {
TCHAR wszTemp[100];
- mir_sntprintf(wszTemp, _countof(wszTemp), _T("##col##%06u:%04u"), endmark - closing, ii);
+ mir_sntprintf(wszTemp, _T("##col##%06u:%04u"), endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
}
@@ -645,7 +645,7 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce char szCname[50];
TContainerSettings csTemp = { 0 };
- mir_snprintf(szCname, _countof(szCname), "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
Utils::ReadContainerSettingsFromDB(0, &csTemp, szCname);
if (csTemp.fPrivate || fForce) {
if (pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
@@ -662,10 +662,10 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
if (pContainer->settings->fPrivate) {
- mir_snprintf(szCName, _countof(szCName), "%s%d_Blob", szSetting, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d_Blob", szSetting, pContainer->iContainerIndex);
WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
- mir_snprintf(szCName, _countof(szCName), "%s%d_theme", szSetting, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d_theme", szSetting, pContainer->iContainerIndex);
if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
@@ -897,7 +897,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
TCHAR szFilename[MAX_PATH];
- mir_sntprintf(szFilename, _countof(szFilename), _T("%s%s"), tszPath, tszFilename);
+ mir_sntprintf(szFilename, _T("%s%s"), tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
return true;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 8907f068b1..55c00e03bc 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -79,7 +79,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN); if (Proto_IsAccountLocked(pa)) - mir_sntprintf(pwd->swzTitle, _countof(pwd->swzTitle), TranslateT("%s (locked)"), pwd->swzTitle); + mir_sntprintf(pwd->swzTitle, TranslateT("%s (locked)"), pwd->swzTitle); // protocol status WORD wStatus = (WORD)CallProtoService(pwd->clcit.szProto, PS_GETSTATUS, 0, 0); @@ -107,7 +107,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa TCHAR swzLogon[64]; if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) { TCHAR ago[96]; - mir_sntprintf(ago, _countof(ago), TranslateT("%s ago"), swzLogon); + mir_sntprintf(ago, TranslateT("%s ago"), swzLogon); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } @@ -1492,7 +1492,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa mir_tstrcpy(swzProto, pa->tszAccountName); if (dwItems & TRAYTIP_LOCKSTATUS) if (Proto_IsAccountLocked(pa)) - mir_sntprintf(swzProto, _countof(swzProto), TranslateT("%s (locked)"), pa->tszAccountName); + mir_sntprintf(swzProto, TranslateT("%s (locked)"), pa->tszAccountName); AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus)); bFirstItem = false; @@ -1500,7 +1500,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_LOGON) { if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) { TCHAR ago[96]; - mir_sntprintf(ago, _countof(ago), TranslateT("%s ago"), buff); + mir_sntprintf(ago, TranslateT("%s ago"), buff); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } } @@ -1621,7 +1621,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa TCHAR *swzNick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO) { TCHAR *swzProto = a2t(proto); - mir_sntprintf(swzName, _countof(swzName), _T("%s (%s)"), swzNick, swzProto); + mir_sntprintf(swzName, _T("%s (%s)"), swzNick, swzProto); mir_free(swzProto); } else mir_tstrcpy(swzName, swzNick); diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 7921a184fd..5b0624a520 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -88,7 +88,7 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName) else if (_tcsstr(buff, _T("preview")))
{
TCHAR szImgPath[1024];
- mir_sntprintf(szImgPath, _countof(szImgPath), _T("%s\\%s\\%s"), SKIN_FOLDER, szSkinName, pch);
+ mir_sntprintf(szImgPath, _T("%s\\%s\\%s"), SKIN_FOLDER, szSkinName, pch);
if (FileExists(szImgPath))
mir_tstrcpy(opt.szPreviewFile, szImgPath);
}
@@ -126,7 +126,7 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart) if (_tcsstr(buff, _T("image")))
{
TCHAR szImgPath[1024];
- mir_sntprintf(szImgPath, _countof(szImgPath), _T("%s\\%s\\%s"), SKIN_FOLDER, opt.szSkinName, pch);
+ mir_sntprintf(szImgPath, _T("%s\\%s\\%s"), SKIN_FOLDER, opt.szSkinName, pch);
opt.szImgFile[iPart] = mir_tstrdup(szImgPath);
}
else if (_tcsstr(buff, _T("tm")))
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 7fe285ac0f..c20915147e 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -233,21 +233,21 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", prefix);
+ mir_snprintf(szSettingName, "%sDay", prefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", prefix);
+ mir_snprintf(szSettingName, "%sMonth", prefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", prefix);
+ mir_snprintf(szSettingName, "%sYear", prefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -281,21 +281,21 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", szPrefix);
+ mir_snprintf(szSettingName, "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -330,21 +330,21 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -374,14 +374,14 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -410,42 +410,42 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", szPrefix);
+ mir_snprintf(szSettingName, "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -512,14 +512,14 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 65eedd0467..80dbb319f8 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -537,7 +537,7 @@ BOOL CTooltipNotify::OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l case WM_VSCROLL:
case WM_HSCROLL:
TCHAR str[10];
- mir_sntprintf(str, _countof(str), _T("%d%%"), 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
+ mir_sntprintf(str, _T("%d%%"), 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
SetDlgItemText(hDlg, IDC_TRANSPERC, str);
if (wParam != 0x12345678)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 788bf0b63e..446358af3a 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -1075,10 +1075,7 @@ void NotifyOnSend(void) ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
_tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
- //
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d kilobytes sent"),
- notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
- //
+ mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes sent"), notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
ppd.PluginWindowProc = NULL;
@@ -1094,10 +1091,7 @@ void NotifyOnRecv(void) ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
_tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
- //
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d kilobytes received"),
- notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
- //
+ mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes received"), notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
ppd.PluginWindowProc = NULL;
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index c4e43379dc..ef54ae6ed1 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -148,7 +148,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size) return 0;
}
- mir_sntprintf(Str1, _countof(Str1), _T("%d.%d"), Value / Divider, Value % Divider);
+ mir_sntprintf(Str1, _T("%d.%d"), Value / Divider, Value % Divider);
size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
l += mir_tstrlen(szUnit) + 1;
@@ -199,37 +199,37 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t S // ×òî ïîëó÷èëè â àêêóìóëÿòîðå?
if (!mir_tstrcmp(Token, _T("d"))) {
q = Duration / (60 * 60 * 24);
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q * 60 * 60 * 24;
}
else if (!mir_tstrcmp(Token, _T("h"))) {
q = Duration / (60 * 60);
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q * 60 * 60;
}
else if (!mir_tstrcmp(Token, _T("hh"))) {
q = Duration / (60 * 60);
- mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _T("%02d"), q);
Duration -= q * 60 * 60;
}
else if (!mir_tstrcmp(Token, _T("m"))) {
q = Duration / 60;
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q * 60;
}
else if (!mir_tstrcmp(Token, _T("mm"))) {
q = Duration / 60;
- mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _T("%02d"), q);
Duration -= q * 60;
}
else if (!mir_tstrcmp(Token, _T("s"))) {
q = Duration;
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q;
}
else if (!mir_tstrcmp(Token, _T("ss"))) {
q = Duration;
- mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _T("%02d"), q);
Duration -= q;
}
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index 4f40588061..6baaf37d9b 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -302,7 +302,7 @@ void Stat_ReadFile(BYTE n) pszPath = Utils_ReplaceVarsT(_T("%miranda_userdata%\\statistics"));
CreateDirectoryTreeT(pszPath);
- mir_sntprintf(FileName, _countof(FileName), _T("%s\\%S.stat"), pszPath, ProtoList[n].name);
+ mir_sntprintf(FileName, _T("%s\\%S.stat"), pszPath, ProtoList[n].name);
mir_free(pszPath);
GetLocalTime(&stNow);
ProtoList[n].hFile = CreateFile(FileName, GENERIC_READ | GENERIC_WRITE,
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index d52a7dd44f..caa4bc5a95 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -219,7 +219,7 @@ void SvcFlagsLoadModule() langid = 1;
char szId[20];
- mir_snprintf(szId, _countof(szId), (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */
+ mir_snprintf(szId, (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */
hExtraIconSvc = ExtraIcon_RegisterIcolib("Flags", LPGEN("Flags (uinfoex)"), szId);
}
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 3468fcb749..63de971663 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -133,7 +133,7 @@ HICON LoadFlag(int countryNumber) szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber=0xFFFF,0);
char szId[20];
- mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", countryNumber); /* buffer safe */
+ mir_snprintf(szId, (countryNumber == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", countryNumber); /* buffer safe */
return IcoLib_GetIcon(szId);
}
@@ -349,7 +349,7 @@ void InitIcons() for (int i=0; i < nCountriesCount; i++) {
sid.description.t = mir_a2t(LPGEN(countries[i].szName));
/* create identifier */
- mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
+ mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
/* create icon */
sid.hDefaultIcon = ImageList_ExtractIcon(NULL, himl, index);
@@ -374,7 +374,7 @@ void UninitIcons() for(int i=0;i<nCountriesCount;++i) {
// create identifier
char szId[20];
- mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
+ mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
IcoLib_RemoveIcon(szId);
}
mir_free(phIconHandles); // does NULL check
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 9aa6ba77f0..9567506ab3 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -271,10 +271,10 @@ int MAnnivDate::DBGetReminderOpts(MCONTACT hContact) char pszSetting[MAXSETTING];
// read reminder option
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dReminder", _wID);
+ mir_snprintf(pszSetting, "Anniv%dReminder", _wID);
_bRemind = db_get_b(hContact, Module(), pszSetting, BST_INDETERMINATE);
// read offset
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dOffset", _wID);
+ mir_snprintf(pszSetting, "Anniv%dOffset", _wID);
_wDaysEarlier = db_get_w(hContact, Module(), pszSetting, (WORD)-1);
}
else {
@@ -310,14 +310,14 @@ int MAnnivDate::DBWriteReminderOpts(MCONTACT hContact) else if (_wID <= ANID_LAST) {
char pszSetting[MAXSETTING];
// read reminder option
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dReminder", _wID);
+ mir_snprintf(pszSetting, "Anniv%dReminder", _wID);
if (_bRemind == BST_INDETERMINATE)
db_unset(hContact, USERINFO, pszSetting);
else
db_set_b(hContact, USERINFO, pszSetting, _bRemind);
// read offset
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dOffset", _wID);
+ mir_snprintf(pszSetting, "Anniv%dOffset", _wID);
if (_wDaysEarlier == (WORD)-1)
db_unset(hContact, USERINFO, pszSetting);
else
@@ -627,7 +627,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) // read date and convert older versions
CHAR szStamp[MAXSETTING];
- mir_snprintf(szStamp, _countof(szStamp), "Anniv%dDate", iIndex);
+ mir_snprintf(szStamp, "Anniv%dDate", iIndex);
int rc = DBGetDateStamp(hContact, USERINFO, szStamp);
if (!rc) {
_strModule = USERINFO;
@@ -635,7 +635,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) _wID = iIndex;
// read description
- mir_snprintf(szStamp, _countof(szStamp), "Anniv%dDesc", iIndex);
+ mir_snprintf(szStamp, "Anniv%dDesc", iIndex);
DBVARIANT dbv;
if (!DB::Setting::GetTString(hContact, USERINFO, szStamp, &dbv)) {
_strDesc = dbv.ptszVal;
@@ -660,10 +660,10 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) _wID = wIndex;
CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dDate", wIndex);
+ mir_snprintf(pszSetting, "Anniv%dDate", wIndex);
if (!DBWriteDateStamp(hContact, USERINFO, pszSetting)) {
// write description
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dDesc", wIndex);
+ mir_snprintf(pszSetting, "Anniv%dDesc", wIndex);
db_set_ts(hContact, USERINFO, pszSetting, (LPTSTR)Description());
return 0;
}
@@ -687,7 +687,7 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p pOldCustomDate->DateFormat(szoldDate, _countof(szoldDate));
pNewProtoDate->DateFormat(szDate, _countof(szDate));
- mir_sntprintf(szMsg, _countof(szMsg),
+ mir_sntprintf(szMsg,
TranslateT("%s provides a new birthday via protocol.\nIt is %s. The old one was %s.\n\nDo you want to use this as the new birthday for this contact?"),
DB::Contact::DisplayName(hContact), szDate, szoldDate);
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 331c672567..57c488a0a1 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -88,7 +88,7 @@ CPsTreeItem::~CPsTreeItem() LPCSTR CPsTreeItem::PropertyKey(LPCSTR pszProperty)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "{%s\\%s}_%s", _pszPrefix, _pszName, pszProperty);
+ mir_snprintf(pszSetting, "{%s\\%s}_%s", _pszPrefix, _pszName, pszProperty);
return pszSetting;
}
@@ -121,7 +121,7 @@ LPCSTR CPsTreeItem::GlobalName() LPCSTR CPsTreeItem::GlobalPropertyKey(LPCSTR pszProperty)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "{Global\\%s}_%s", GlobalName(), pszProperty);
+ mir_snprintf(pszSetting, "{Global\\%s}_%s", GlobalName(), pszProperty);
return pszSetting;
}
@@ -138,7 +138,7 @@ LPCSTR CPsTreeItem::IconKey() if (pszIconName)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), MODNAME"_{%s}", pszIconName);
+ mir_snprintf(pszSetting, MODNAME"_{%s}", pszIconName);
return pszSetting;
}
return NULL;
@@ -283,7 +283,7 @@ HICON CPsTreeItem::ProtoIcon() for (int i = 0; i < ProtoCount; i++) {
if (!mir_tstrncmpi(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
CHAR szIconID[MAX_PATH];
- mir_snprintf(szIconID, _countof(szIconID), "core_status_%s1", pa[i]->szModuleName);
+ mir_snprintf(szIconID, "core_status_%s1", pa[i]->szModuleName);
HICON hIco = IcoLib_GetIcon(szIconID);
if (!hIco)
hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index ec8361576f..18e1bda0e6 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -364,7 +364,7 @@ INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(MCONTACT hContact) }
// delete reluctant items
do {
- ofs = mir_snprintf(szSet0, _countof(szSet0), "Anniv%d", wIndex);
+ ofs = mir_snprintf(szSet0, "Anniv%d", wIndex);
ret = 1;
for (i = 0; i < _countof(szPrefix); i++) {
mir_strncpy(szSet0 + ofs, szPrefix[i], _countof(szSet0) - ofs);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index bbfa76552a..262a180124 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam GetDlgItemText(hDlg, EDIT_AREA, szArea, _countof(szArea));
GetDlgItemText(hDlg, EDIT_NUMBER, szData, _countof(szData));
- mir_sntprintf(szPhone, _countof(szPhone), _T("+%u (%s) %s"), nCountry, szArea, szData);
+ mir_sntprintf(szPhone, _T("+%u (%s) %s"), nCountry, szArea, szData);
noRecursion = 1;
SetDlgItemText(hDlg, EDIT_PHONE, szPhone);
noRecursion = 0;
@@ -780,7 +780,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L !cbex->pItems ||
cbex->iSelectedItem < 0 ||
cbex->iSelectedItem >= cbex->numItems ||
- FAILED(mir_sntprintf(szMsg, _countof(szMsg), TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
+ FAILED(mir_sntprintf(szMsg, TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
cbex->pItems[cbex->iSelectedItem].szCat, cbex->pItems[cbex->iSelectedItem].pszVal))
)
{
@@ -946,7 +946,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L // set category string
if (!pItem->pszCat || !pItem->pszCat[0] || !mir_tstrncpy(cbex->pItems[cbex->numItems].szCat, pItem->pszCat, MAX_CAT)) {
- mir_sntprintf(cbex->pItems[cbex->numItems].szCat, _countof(cbex->pItems[cbex->numItems].szCat), _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
+ mir_sntprintf(cbex->pItems[cbex->numItems].szCat, _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
}
// set value string
@@ -986,7 +986,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (pItem->wMask & CBEXIM_CAT) {
// set category string
if (!pItem->pszCat || !pItem->pszCat[0] || !mir_tstrncpy(cbex->pItems[pItem->iItem].szCat, pItem->pszCat, _countof(cbex->pItems[pItem->iItem].szCat)))
- mir_sntprintf(cbex->pItems[pItem->iItem].szCat, _countof(cbex->pItems[pItem->iItem].szCat), _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
+ mir_sntprintf(cbex->pItems[pItem->iItem].szCat, _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
if (pItem->iItem == cbex->iSelectedItem)
SetWindowText(cbex->hBtnEdit, cbex->pItems[pItem->iItem].szCat);
}
@@ -1349,7 +1349,7 @@ int CtrlContactAddMyItemsFromDB( cbi.pszIcon = szIcon;
for (i = 0;
- SUCCEEDED(mir_snprintf(pszSetting, _countof(pszSetting), szFormatVal, i)) &&
+ SUCCEEDED(mir_snprintf(pszSetting, szFormatVal, i)) &&
(cbi.wFlags = DB::Setting::GetTStringCtrl(hContact, pszModule, pszModule, pszProto, pszSetting, &dbv));
i++)
{
@@ -1360,7 +1360,7 @@ int CtrlContactAddMyItemsFromDB( dbv.ptszVal = NULL;
// read category
- if (SUCCEEDED(mir_snprintf(pszSetting, _countof(pszSetting), szFormatCat, i))) {
+ if (SUCCEEDED(mir_snprintf(pszSetting, szFormatCat, i))) {
if (cbi.wFlags & CTRLF_HASCUSTOM) {
if (DB::Setting::GetTString(hContact, pszModule, pszSetting, &dbv))
dbv.type = DBVT_DELETED;
@@ -1480,13 +1480,13 @@ int CtrlContactWriteMyItemsToDB( if (cbi.wFlags & CBEXIF_SMS) {
mir_tstrncat(szVal, _T(" SMS"), _countof(szVal) - mir_tstrlen(szVal));
}
- mir_snprintf(pszSetting, _countof(pszSetting), szFormatCat, i);
+ mir_snprintf(pszSetting, szFormatCat, i);
if (*szCat && _tcsncmp(szCat, pszOther, ccOther)) {
if (db_set_ts(hContact, pszModule, pszSetting, szCat)) return 1;
}
else
db_unset(hContact, pszModule, pszSetting);
- mir_snprintf(pszSetting, _countof(pszSetting), szFormatVal, i);
+ mir_snprintf(pszSetting, szFormatVal, i);
if (db_set_ts(hContact, pszModule, pszSetting, szVal)) return 1;
cbi.wFlags &= ~CTRLF_CHANGED;
cbi.wMask = CBEXIM_FLAGS;
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index f12f53c485..1e9ad4ca9b 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -597,7 +597,7 @@ class CAnnivList LVCOLUMN lvc;
CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "AnnivDlg_Col%d", iSubItem);
+ mir_snprintf(pszSetting, "AnnivDlg_Col%d", iSubItem);
lvc.cx = db_get_w(NULL, MODNAME, pszSetting, defaultWidth);
lvc.mask = LVCF_WIDTH | LVCF_TEXT;
lvc.iSubItem = iSubItem;
@@ -876,7 +876,7 @@ public: int c, cc = Header_GetItemCount(ListView_GetHeader(_hList));
for (c = 0; c < cc; c++) {
- mir_snprintf(pszSetting, _countof(pszSetting), "AnnivDlg_Col%d", c);
+ mir_snprintf(pszSetting, "AnnivDlg_Col%d", c);
db_set_w(NULL, MODNAME, pszSetting, (WORD)ListView_GetColumnWidth(_hList, c));
}
DeleteAllItems();
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 8022802c2f..4704750254 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -688,11 +688,11 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
- mir_sntprintf(tszTitle, _countof(tszMsg), _T("%s - %s"), _T(MODNAME), TranslateT("Error"));
+ mir_sntprintf(tszTitle, _T("%s - %s"), _T(MODNAME), TranslateT("Error"));
va_list vl;
va_start(vl, pszFormat);
- mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl);
+ mir_vsntprintf(tszMsg, TranslateTS(pszFormat), vl);
va_end(vl);
MSGBOX mb = {0};
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 4cb4dc7abc..ff76ea1994 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -137,7 +137,7 @@ private: EnableWindow(GetDlgItem(_pPs->hDlg, IDOK), FALSE);
EnableWindow(GetDlgItem(_pPs->hDlg, IDAPPLY), FALSE);
- mir_snprintf(_pPs->szUpdating, _countof(_pPs->szUpdating), "%s (%s)", Translate("Uploading"), (*_pPd)->szModuleName);
+ mir_snprintf(_pPs->szUpdating, "%s (%s)", Translate("Uploading"), (*_pPd)->szModuleName);
ShowWindow(GetDlgItem(_pPs->hDlg, TXT_UPDATING), SW_SHOW);
SetTimer(_pPs->hDlg, TIMERID_UPDATING, 100, NULL);
return 0;
@@ -1541,7 +1541,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (pPs->hContact != NULL) {
ResetUpdateInfo(pPs);
- mir_snprintf(pPs->szUpdating, _countof(pPs->szUpdating), "%s (%s)", Translate("updating"), pPs->pszProto);
+ mir_snprintf(pPs->szUpdating, "%s (%s)", Translate("updating"), pPs->pszProto);
// need meta contact's subcontact information
if (DB::Module::IsMetaAndScan(pPs->pszProto)) {
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 2041202d80..ab19dba570 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -221,7 +221,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
TranslateDialogDefault(hDlg); //to translate oldTitle
GetWindowText(hDlg, oldTitle, _countof(oldTitle));
- mir_sntprintf(newTitle, _countof(newTitle), _T("%s - %s"), name, oldTitle);
+ mir_sntprintf(newTitle, _T("%s - %s"), name, oldTitle);
SetWindowText(hDlg, newTitle);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index 36383cf771..67e46fc06d 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -281,7 +281,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM) if (SendMessage(hClist,CLM_GETITEMTYPE, (WPARAM)hItem, 0) == CLCIT_GROUP) {
SendMessage(hClist,CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)ptszItem);
LPTSTR temp = mir_tstrdup(ptszGroup);
- mir_sntprintf(tszGroup, _countof(tszGroup),_T("%s%s%s"), ptszItem, mir_tstrlen(temp)? _T("\\"):_T(""), temp);
+ mir_sntprintf(tszGroup, _T("%s%s%s"), ptszItem, mir_tstrlen(temp)? _T("\\"):_T(""), temp);
mir_free (temp);
}
hParent = SendMessage(hClist,CLM_GETNEXTITEM, (WPARAM)CLGN_PARENT, (LPARAM)hItem);
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 7b5ed883ec..6bf79fc8e7 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -362,7 +362,7 @@ void DeleteArray(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszFormat, int iSta {
char pszSetting[MAXSETTING];
do {
- mir_snprintf(pszSetting, _countof(pszSetting), pszFormat, iStart++);
+ mir_snprintf(pszSetting, pszFormat, iStart++);
}
while (!db_unset(hContact, pszModule, pszSetting));
}
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index d08b8ec07b..da26528cb9 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -46,7 +46,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM PSGetBoldFont(hDlg, hBoldFont);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
- mir_sntprintf(szAddr, _countof(szAddr), _T("%s (%s)"), TranslateT("Address"), TranslateT("home"));
+ mir_sntprintf(szAddr, _T("%s (%s)"), TranslateT("Address"), TranslateT("home"));
SetDlgItemText(hDlg, IDC_PAGETITLE, szAddr);
SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
@@ -192,7 +192,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM PSGetBoldFont(hDlg, hBoldFont);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
- mir_sntprintf(szAddr, _countof(szAddr), _T("%s (%s)"), TranslateT("Address and contact"), TranslateT("company"));
+ mir_sntprintf(szAddr, _T("%s (%s)"), TranslateT("Address and contact"), TranslateT("company"));
SetDlgItemText(hDlg, IDC_PAGETITLE, szAddr);
SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index c81ad03f01..67bbeb3249 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -487,12 +487,12 @@ static int ProfileList_AddItemlistFromDB( for (i = 0, lvi.iItem = iItem; ; i++) {
// read the setting from db
- mir_snprintf(pszSetting, _countof(pszSetting), szValFormat, i);
+ mir_snprintf(pszSetting, szValFormat, i);
if (DB::Setting::GetTString(hContact, pszModule, pszSetting, &dbvVal))
break;
if (dbvVal.type != DBVT_TCHAR)
continue;
- mir_snprintf(pszSetting, _countof(pszSetting), szCatFormat, i);
+ mir_snprintf(pszSetting, szCatFormat, i);
DB::Setting::GetAString(hContact, pszModule, pszSetting, &dbvCat);
// create the itemobject
if (!(pItem = (LPLCITEM)mir_alloc(sizeof(LCITEM)))) {
@@ -1218,10 +1218,10 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR if (!pItem->pszText[1] || !*pItem->pszText[1])
continue;
if (!(pItem->wFlags & (CTRLF_HASPROTO|CTRLF_HASMETA))) {
- mir_snprintf(pszSetting, _countof(pszSetting), pFmt[iFmt].szValFmt, iItem);
+ mir_snprintf(pszSetting, pFmt[iFmt].szValFmt, iItem);
db_set_ts(hContact, pszModule, pszSetting, pItem->pszText[1]);
// save category
- mir_snprintf(pszSetting, _countof(pszSetting), pFmt[iFmt].szCatFmt, iItem);
+ mir_snprintf(pszSetting, pFmt[iFmt].szCatFmt, iItem);
if (pItem->idstrList && pItem->iListItem > 0 && pItem->iListItem < pItem->idstrListCount)
db_set_s(hContact, pszModule, pszSetting, (LPSTR)pItem->idstrList[pItem->iListItem].pszText);
else if (pItem->pszText[0] && *pItem->pszText[0])
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index f30b9ba1a4..44467f2fac 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -148,7 +148,7 @@ static HICON GetAnnivIcon(const CEvent &evt) if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTBX);
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dtb%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
break;
@@ -157,7 +157,7 @@ static HICON GetAnnivIcon(const CEvent &evt) if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dta%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
}
@@ -183,7 +183,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt) if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dtb%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -192,7 +192,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt) if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dta%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -255,8 +255,7 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT if (hContact) {
ppd.lchContact = hContact;
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName),
- _T("%s - %s"), TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
+ mir_sntprintf(ppd.lptzContactName, _T("%s - %s"), TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
}
else mir_tstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName));
@@ -318,12 +317,12 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) switch (evt._eType) {
case CEvent::BIRTHDAY:
- mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
+ mir_sntprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_BIRTHDAY);
break;
case CEvent::ANNIVERSARY:
- mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
+ mir_sntprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
break;
@@ -483,13 +482,13 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti switch (Diff) {
case 0:
- cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
break;
case 1:
- cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
break;
default:
- cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
+ cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
}
int age = mtb.Age(&Now);
if (age > 0)
diff --git a/plugins/Variables/src/dbhelpers.h b/plugins/Variables/src/dbhelpers.h index b6fe9f7c42..4531bf397f 100644 --- a/plugins/Variables/src/dbhelpers.h +++ b/plugins/Variables/src/dbhelpers.h @@ -26,7 +26,7 @@ static int __inline DBWriteIthSettingByte(DWORD i, MCONTACT hContact,const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_b(hContact, szModule, dbSetting, val);
}
@@ -34,7 +34,7 @@ static int __inline DBWriteIthSettingWord(DWORD i, MCONTACT hContact,const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_w(hContact, szModule, dbSetting, val);
}
@@ -42,7 +42,7 @@ static int __inline DBWriteIthSettingDword(DWORD i, MCONTACT hContact,const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_dw(hContact, szModule, dbSetting, val);
}
@@ -50,7 +50,7 @@ static int __inline DBWriteIthSettingString(DWORD i, MCONTACT hContact,const cha char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_s(hContact, szModule, dbSetting, val);
}
@@ -59,7 +59,7 @@ static int __inline DBGetIthSettingByte(DWORD i, MCONTACT hContact, const char * char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_b(hContact, szModule, dbSetting, errorValue);
}
@@ -68,7 +68,7 @@ static WORD __inline DBGetIthSettingWord(DWORD i, MCONTACT hContact, const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_w(hContact, szModule, dbSetting, errorValue);
}
@@ -77,7 +77,7 @@ static DWORD __inline DBGetIthSettingDword(DWORD i, MCONTACT hContact, const cha char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_dw(hContact, szModule, dbSetting, errorValue);
}
@@ -86,7 +86,7 @@ static int __inline DBGetIthSetting(DWORD i, MCONTACT hContact, const char *szMo char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get(hContact, szModule, dbSetting, dbv);
}
@@ -94,7 +94,7 @@ static int __inline DBDeleteIthSetting(DWORD i, MCONTACT hContact,const char *sz char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_unset(hContact, szModule, dbSetting);
}
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index ff3e07c943..59d3cc4ce8 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -40,7 +40,7 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) char hex[8];
memmove(res + cur + 3, res + cur + 1, mir_strlen(res + cur + 1) + 1);
- mir_snprintf(hex, _countof(hex), "%%%x", *(res + cur));
+ mir_snprintf(hex, "%%%x", *(res + cur));
strncpy(res + cur, hex, mir_strlen(hex));
cur += mir_strlen(hex);
}
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index 1308f805e2..d71296a93d 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -54,7 +54,7 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai) int val = ttoi(ai->targv[1]);
int padding = ttoi(ai->targv[2]);
- mir_sntprintf(szVal, _countof(szVal), _T("%x"), val);
+ mir_sntprintf(szVal, _T("%x"), val);
unsigned int zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(TCHAR));
if (res == NULL)
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index f8a965b81c..bbe87a9506 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -51,7 +51,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
TCHAR tszID[40];
- mir_sntprintf(tszID, _countof(tszID), _T("%p"), hContact);
+ mir_sntprintf(tszID, _T("%p"), hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -91,7 +91,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
TCHAR tszID[40];
- mir_sntprintf(tszID, _countof(tszID), _T("%p"), hContact);
+ mir_sntprintf(tszID, _T("%p"), hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -131,7 +131,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
TCHAR tszID[40];
- mir_sntprintf(tszID, _countof(tszID), _T("%p"), hContact);
+ mir_sntprintf(tszID, _T("%p"), hContact);
szUniqueID = mir_tstrdup(tszID);
}
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 1877bfcf3f..598fc4dd6d 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -723,7 +723,7 @@ static TCHAR *parseMirandaCoreVar(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
TCHAR corevar[MAX_PATH];
- mir_sntprintf(corevar, _countof(corevar), _T("%%%s%%"), ai->targv[0]);
+ mir_sntprintf(corevar, _T("%%%s%%"), ai->targv[0]);
return Utils_ReplaceVarsT(corevar);
}
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index df01089e48..9e92647542 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -105,7 +105,7 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai) pdhStatus = PdhCloseQuery(hQuery);
return NULL;
}
- mir_sntprintf(szVal, _countof(szVal), _T("%.0f"), cValue.doubleValue);
+ mir_sntprintf(szVal, _T("%.0f"), cValue.doubleValue);
//PdhRemoveCounter(*hCounter);
PdhCloseQuery(hQuery);
mir_free(szCounter);
@@ -282,7 +282,7 @@ static TCHAR *parseDiffTime(ARGUMENTSINFO *ai) return NULL;
diff = difftime(mktime(&t1), mktime(&t0));
- mir_sntprintf(szTime, _countof(szTime), _T("%.0f"), diff);
+ mir_sntprintf(szTime, _T("%.0f"), diff);
return mir_tstrdup(szTime);
}
@@ -819,7 +819,7 @@ static TCHAR *parseUpTime(ARGUMENTSINFO *ai) }
TCHAR szVal[32];
- mir_sntprintf(szVal, _countof(szVal), _T("%u"), cValue.largeValue);
+ mir_sntprintf(szVal, _T("%u"), cValue.largeValue);
PdhRemoveCounter(hCounter);
PdhCloseQuery(hQuery);
return mir_tstrdup(szVal);
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index fdd4596d19..0e52a477e0 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -231,7 +231,7 @@ extern "C" int __declspec(dllexport) Load(void) // window needed for popup commands
TCHAR SvcFunc[100];
- mir_sntprintf(SvcFunc, _countof(SvcFunc), _T("%s__PopupWindow"), _T(WEATHERPROTONAME));
+ mir_sntprintf(SvcFunc, _T("%s__PopupWindow"), _T(WEATHERPROTONAME));
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index bda1bd95b7..2e2eeca1a7 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -90,7 +90,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) AvatarDownloaded(hContact);
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("Current weather information for %s."), psr->nick.t);
+ mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.t);
db_set_ts(hContact, WEATHERPROTONAME, "About", str);
// make the last update tags to something invalid
@@ -109,7 +109,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) opt.DefStn = hContact;
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
// notification message box
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -234,7 +234,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, TCHAR *szData = NULL;
// load the page
- mir_snprintf(loc, _countof(loc), sData->SearchURL, sID);
+ mir_snprintf(loc, sData->SearchURL, sID);
BOOL bFound = (InternetDownloadFile(loc, NULL, NULL, &szData) == 0);
if (bFound) {
TCHAR* szInfo = szData;
@@ -251,7 +251,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, // give no station name but only ID if the search is unavailable
else _tcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
- mir_sntprintf(newID, _countof(newID), _T("%s/%s"), svc, sID);
+ mir_sntprintf(newID, _T("%s/%s"), svc, sID);
// set the search result and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
@@ -311,7 +311,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // replace spaces with %20
char loc[256];
T2Utf szSearchName(name);
- mir_snprintf(loc, _countof(loc), sData->SearchURL, ptrA(mir_urlEncode(szSearchName)));
+ mir_snprintf(loc, sData->SearchURL, ptrA(mir_urlEncode(szSearchName)));
if (InternetDownloadFile(loc, NULL, NULL, &szData) == 0) {
TCHAR* szInfo = szData;
search = _tcsstr(szInfo, sData->NotFoundStr); // determine if data is available
@@ -324,14 +324,14 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if station ID appears first in the downloaded data
if (!mir_tstrcmpi(sData->Single.First, _T("ID"))) {
GetDataValue(&sData->Single.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
GetDataValue(&sData->Single.Name, Name, &szInfo);
}
// if station name appears first in the downloaded data
else if (!mir_tstrcmpi(sData->Single.First, _T("NAME"))) {
GetDataValue(&sData->Single.Name, Name, &szInfo);
GetDataValue(&sData->Single.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
}
else
str[0] = 0;
@@ -365,14 +365,14 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if station ID appears first in the downloaded data
if (!mir_tstrcmpi(sData->Multiple.First, _T("ID"))) {
GetDataValue(&sData->Multiple.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
GetDataValue(&sData->Multiple.Name, Name, &szInfo);
}
// if station name appears first in the downloaded data
else if (!mir_tstrcmpi(sData->Multiple.First, _T("NAME"))) {
GetDataValue(&sData->Multiple.Name, Name, &szInfo);
GetDataValue(&sData->Multiple.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
}
else
break;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 3ce506d66a..ae74ad7973 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -29,7 +29,7 @@ static void OpenUrl(TCHAR* format, TCHAR* id) {
TCHAR loc[512];
GetID(id);
- mir_sntprintf(loc, _countof(loc), format, id);
+ mir_sntprintf(loc, format, id);
Utils_OpenUrlT(loc);
}
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa // if ID search is available, do it
if (sData->IDSearch.Available) {
// load the page
- mir_snprintf(loc, _countof(loc), sData->IDSearch.SearchURL, str);
+ mir_snprintf(loc, sData->IDSearch.SearchURL, str);
str[0] = 0;
TCHAR *pData = NULL;
if (InternetDownloadFile(loc, NULL, sData->UserAgent, &pData) == 0) {
@@ -371,7 +371,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa }
GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city));
db_set_ts(hContact, WEATHERPROTONAME, "Nick", city);
- mir_sntprintf(str2, _countof(str2), TranslateT("Current weather information for %s."), city);
+ mir_sntprintf(str2, TranslateT("Current weather information for %s."), city);
if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) {
GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str));
db_set_ts(hContact, WEATHERPROTONAME, "Log", str);
@@ -458,7 +458,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) ptrT tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
if (tszNick != NULL) {
TCHAR str[255];
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), (TCHAR*)tszNick);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), (TCHAR*)tszNick);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index b77cb46500..e889d63e2d 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -390,7 +390,7 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data) do {
j++;
// using the format _T("# Weather <condition name> <counter> #"
- mir_sntprintf(LangPackStr, _countof(LangPackStr), _T("# Weather %s %i #"), statusStr[i], j);
+ mir_sntprintf(LangPackStr, _T("# Weather %s %i #"), statusStr[i], j);
_tcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1));
if (_tcsstr(cond, LangPackStr1) != NULL)
@@ -545,7 +545,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) name[0] = 0;
// read the entire variable name
while (dis[i] != ']' && i < mir_tstrlen(dis)) {
- mir_snprintf(temp, _countof(temp), "%c", dis[i++]);
+ mir_snprintf(temp, "%c", dis[i++]);
mir_strcat(name, temp);
}
// access the database to get its value
@@ -559,7 +559,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) }
// if the character is not a variable, write the original character to the new string
else {
- mir_sntprintf(lpzDate, _countof(lpzDate), _T("%c"), dis[i]);
+ mir_sntprintf(lpzDate, _T("%c"), dis[i]);
mir_tstrcat(str, lpzDate);
}
}
@@ -632,7 +632,7 @@ TCHAR *GetError(int code) case 503: str = E503; break;
case 504: str = E504; break;
default:
- mir_sntprintf(str2, _countof(str2), TranslateT("HTTP Error %i"), code);
+ mir_sntprintf(str2, TranslateT("HTTP Error %i"), code);
str = str2;
break;
}
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index c1c5a53168..c9303092ad 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -154,7 +154,7 @@ void EraseAllInfo() opt.DefStn = hContact;
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -181,7 +181,7 @@ void EraseAllInfo() }
opt.DefStn = LastContact;
if (!db_get_ts(LastContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
diff --git a/plugins/Weather/src/weather_icons.cpp b/plugins/Weather/src/weather_icons.cpp index 8b69cffcd0..68d162e8fc 100644 --- a/plugins/Weather/src/weather_icons.cpp +++ b/plugins/Weather/src/weather_icons.cpp @@ -45,7 +45,7 @@ void InitIcons(void) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", WEATHERPROTONAME, name);
+ mir_snprintf(szSettingName, "%s_%s", WEATHERPROTONAME, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index 590150dc36..b1eba54fea 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -147,12 +147,12 @@ void GetINIInfo(TCHAR *pszSvc) WIDATA *sData = GetWIData(pszSvc);
// if the service does not exist among the loaded INI's
if (sData == NULL) {
- mir_sntprintf(str2, _countof(str2), TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc);
+ mir_sntprintf(str2, TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc);
MessageBox(NULL, str2, TranslateT("Weather INI information"), MB_OK | MB_ICONINFORMATION);
}
// if exist, get the information
else {
- mir_sntprintf(str2, _countof(str2), TranslateT("Weather INI information for \"%s\":"), pszSvc);
+ mir_sntprintf(str2, TranslateT("Weather INI information for \"%s\":"), pszSvc);
mir_tstrncat(str2, _T("\n\n"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, TranslateT("Name:"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, _T("\t\t"), _countof(str2) - mir_tstrlen(str2));
@@ -187,9 +187,9 @@ void GetINIInfo(TCHAR *pszSvc) mir_tstrncat(str2, sData->ShortFileName, _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, _T("\n"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, TranslateT("Item Count:"), _countof(str2) - mir_tstrlen(str2));
- mir_sntprintf(str2, _countof(str2), _T("%s\t%i\n"), str2, sData->UpdateDataCount);
+ mir_sntprintf(str2, _T("%s\t%i\n"), str2, sData->UpdateDataCount);
mir_tstrncat(str2, TranslateT("Memory Used:"), _countof(str2) - mir_tstrlen(str2));
- mir_sntprintf(str2, _countof(str2), _T("%s\t%i "), str2, sData->MemUsed);
+ mir_sntprintf(str2, _T("%s\t%i "), str2, sData->MemUsed);
mir_tstrncat(str2, TranslateT("bytes"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, _T("\n\n"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, TranslateT("Description:"), _countof(str2) - mir_tstrlen(str2));
@@ -219,7 +219,7 @@ void MoreVarList(void) // the custom variable is defined as "%[<variable name>]"
// ignore the "hi" item and hidden items
if (mir_tstrcmp(WItem->Item.Name, _T("Ignore")) && WItem->Item.Name[0] != '#') {
- mir_sntprintf(tempstr, _countof(tempstr), _T("%c[%s]"), '%', WItem->Item.Name);
+ mir_sntprintf(tempstr, _T("%c[%s]"), '%', WItem->Item.Name);
TCHAR *find = _tcsstr(str, tempstr);
// if the custom variable does not exist in the list, add it to the list
if (find == NULL) {
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index e69bc56fda..0775fff823 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -268,7 +268,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) Data->InternalVer = 7;
else {
TCHAR str[4096];
- mir_sntprintf(str, _countof(str), TranslateT("Invalid ini format for: %s"), pszFile);
+ mir_sntprintf(str, TranslateT("Invalid ini format for: %s"), pszFile);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONERROR);
fclose(pfile);
return;
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index b92291fa17..2dc78a8975 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -243,7 +243,7 @@ static void addWindow(MCONTACT hContact) db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv);
TCHAR winname[512];
- mir_sntprintf(winname, _countof(winname), _T("Weather: %s"), dbv.ptszVal);
+ mir_sntprintf(winname, _T("Weather: %s"), dbv.ptszVal);
db_free(&dbv);
HWND hWnd = CreateWindow(_T("WeatherFrame"), _T(""), WS_CHILD | WS_VISIBLE,
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index f1a027ae19..d8dd8ccf8e 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -147,12 +147,12 @@ INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam) return GAIR_NOAVATAR;
pai->format = PA_FORMAT_PNG;
- mir_sntprintf(pai->filename, _countof(pai->filename), _T("%s\\Plugins\\Weather\\%s.png"), szSearchPath, statusStr[i]);
+ mir_sntprintf(pai->filename, _T("%s\\Plugins\\Weather\\%s.png"), szSearchPath, statusStr[i]);
if (_taccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_GIF;
- mir_sntprintf(pai->filename, _countof(pai->filename), _T("%s\\Plugins\\Weather\\%s.gif"), szSearchPath, statusStr[i]);
+ mir_sntprintf(pai->filename, _T("%s\\Plugins\\Weather\\%s.gif"), szSearchPath, statusStr[i]);
if (_taccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index a213106160..a01a2d19fe 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -106,7 +106,7 @@ int UpdateWeather(MCONTACT hContact) if (!dbres && dbv.ptszVal[0] != 0) {
if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) {
// display alert popup
- mir_sntprintf(str, _countof(str), _T("Alert for %s%c%s"), winfo.city, 255, dbv.ptszVal);
+ mir_sntprintf(str, _T("Alert for %s%c%s"), winfo.city, 255, dbv.ptszVal);
WPShowMessage(str, SM_WEATHERALERT);
}
// alert issued, set display to italic
@@ -410,19 +410,19 @@ int GetWeatherData(MCONTACT hContact) // generate update URL
switch (i) {
case 0:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL, _T2A(id));
break;
case 1:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL2, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL2, _T2A(id));
break;
case 2:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL3, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL3, _T2A(id));
break;
case 3:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL4, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL4, _T2A(id));
break;
default:
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index e0174d74a7..281b1aa8e9 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -145,7 +145,7 @@ extern "C" int __declspec(dllexport) Load() // register netlib handle
char tempNdesc[50];
- mir_snprintf(tempNdesc, _countof(tempNdesc), "%s connection settings", MODULENAME);
+ mir_snprintf(tempNdesc, "%s connection settings", MODULENAME);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
@@ -216,7 +216,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("Countdown", CountdownMenuCommand);
mi.flags |= CMIF_KEEPUNTRANSLATED;
TCHAR countername[100];
- mir_sntprintf(countername, _countof(countername), TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
mi.position = 600090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
mi.name.t = countername;
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index dc2adfdbf9..361afbba7c 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -64,7 +64,7 @@ void ChangeMenuItemCountdown() HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
TCHAR countername[100];
- mir_sntprintf(countername, _countof(countername), TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED);
}
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index b790468edb..706c6b8627 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -126,9 +126,9 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) TCHAR *displaytext = (TCHAR*)lParam;
if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE))
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), displaytext);
+ mir_sntprintf(ppd.lptzText, displaytext);
else if (mir_tstrlen(displaytext) < MAX_SECONDLINE)
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), displaytext);
+ mir_sntprintf(ppd.lptzText, displaytext);
if ( db_get_b(NULL, MODULENAME, POP_USECUSTCLRS_KEY, 0)) {
ppd.colorBack = db_get_dw(NULL, MODULENAME, POP_BG_CLR_KEY, Def_color_bg);
@@ -169,7 +169,7 @@ int OSDAlert(WPARAM hContact, LPARAM lParam) strncpy_s(contactname, _countof(contactname), MODULENAME, _TRUNCATE);
char *displaytext = (char*)lParam;
- mir_snprintf(newdisplaytext, _countof(newdisplaytext), "%s: %s", contactname, Translate(displaytext));
+ mir_snprintf(newdisplaytext, "%s: %s", contactname, Translate(displaytext));
if (ServiceExists("OSD/Announce"))
CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
@@ -188,11 +188,11 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_sntprintf(newdisplaytext, _countof(newdisplaytext), _T("%s\n%s"), ptszContactName, displaytext);
+ mir_sntprintf(newdisplaytext, _T("%s\n%s"), ptszContactName, displaytext);
PUShowMessageT(newdisplaytext, SM_WARNING);
}
else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_sntprintf(newdisplaytext, _countof(newdisplaytext), _T("%s: %s"), ptszContactName, TranslateTS(displaytext));
+ mir_sntprintf(newdisplaytext, _T("%s: %s"), ptszContactName, TranslateTS(displaytext));
CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
}
else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
@@ -237,10 +237,10 @@ void SaveToFile(MCONTACT hContact, char *truncated) time_t ftime = time(NULL);
struct tm *nTime = localtime(&ftime);
- mir_snprintf(timeprefix, _countof(timeprefix), " %s ", Translate("Last updated on"));
+ mir_snprintf(timeprefix, " %s ", Translate("Last updated on"));
strftime(temptime1, 32, " %a, %b %d, %Y ", nTime);
strftime(temptime2, 32, " %I:%M %p.", nTime);
- mir_snprintf(timestring, _countof(timestring), "(%s)%s\n%s,%s\n", MODULENAME, url, temptime1, temptime2);
+ mir_snprintf(timestring, "(%s)%s\n%s,%s\n", MODULENAME, url, temptime1, temptime2);
fputs(timestring, pfile);
fwrite(truncated, mir_strlen(truncated), 1, pfile);
@@ -357,7 +357,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn //
if ((!notpresent)) {
if (alertIndex == 0) { // popup
- mir_sntprintf(displaystring, _countof(displaystring), _T("%s \"%S\" %s."), Translate("The string"), alertstring, Translate("has been found on the web page"));
+ mir_sntprintf(displaystring, _T("%s \"%S\" %s."), Translate("The string"), alertstring, Translate("has been found on the web page"));
WAlertPopup(hContact, displaystring);
// contactlist name//
@@ -397,7 +397,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
}
else if (alertIndex == 3) {
- mir_sntprintf(displaystring, _countof(displaystring), _T("%s \"%s\" %s."), TranslateT("The string"), alertstring, TranslateT("has been found on the web page"));
+ mir_sntprintf(displaystring, _T("%s \"%s\" %s."), TranslateT("The string"), alertstring, TranslateT("has been found on the web page"));
WAlertOSD(hContact, displaystring);
// contactlist name//
@@ -426,9 +426,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
+ mir_sntprintf(cachedirectorypath, _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
+ mir_sntprintf(newcachepath, _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
if ( _taccess(newcachepath, 0) != -1) {
if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
@@ -638,9 +638,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
+ mir_sntprintf(cachedirectorypath, _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
+ mir_sntprintf(newcachepath, _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
if ( _taccess(newcachepath, 0) != -1) {
if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index ab59060515..a97f3c31e2 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -280,9 +280,9 @@ void GetData(void *param) strftime(temptime, 128, "(%b %d,%H:%M:%S)", nTime);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 1)
- mir_snprintf(tstr, _countof(tstr), "%s %s", temptime, dbv.pszVal);
+ mir_snprintf(tstr, "%s %s", temptime, dbv.pszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 0)
- mir_snprintf(tstr, _countof(tstr), "%s %s", dbv.pszVal, temptime);
+ mir_snprintf(tstr, "%s %s", dbv.pszVal, temptime);
db_free(&dbv);
}
else {
@@ -300,9 +300,9 @@ void GetData(void *param) db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 1)
- mir_snprintf(tstr, _countof(tstr), "%s %s", temptime, dbv.pszVal);
+ mir_snprintf(tstr, "%s %s", temptime, dbv.pszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 0)
- mir_snprintf(tstr, _countof(tstr), "%s %s", dbv.pszVal, temptime);
+ mir_snprintf(tstr, "%s %s", dbv.pszVal, temptime);
db_free(&dbv);
}
@@ -313,7 +313,7 @@ void GetData(void *param) strncpy_s(timeat, _countof(timeat), Translate("at the time"), _TRUNCATE);
strftime(temptime1, 32, " %a, %b %d, %Y ", nTime);
strftime(temptime2, 32, " %I:%M %p.", nTime);
- mir_snprintf(timestring, _countof(timestring), " %s %s%s%s", timeprefix, temptime1, timeat, temptime2);
+ mir_snprintf(timestring, " %s %s%s%s", timeprefix, temptime1, timeat, temptime2);
} // end download success
if (DownloadSuccess) {
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index b4b45bd99e..1adf9ccb7c 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -64,7 +64,7 @@ TCHAR* FixButtonText(TCHAR *url, size_t len) int posafter = (stringafter - buttontext) + 1;
strdel(stringafter, 1);
_tcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
- mir_sntprintf(newbuttontext, _countof(buttontext), _T("%s!!%s"), stringbefore, stringafter);
+ mir_sntprintf(newbuttontext, _T("%s!!%s"), stringbefore, stringafter);
posafter = 0;
posbefore = 0;
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 80472ae058..6fd09544a1 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -85,12 +85,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) TCHAR *cacheend = _tcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); + mir_sntprintf(cachedirectorypath, _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); CreateDirectory(cachedirectorypath, NULL); TCHAR newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; - mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, oldName); - mir_sntprintf(renamedcachepath, _countof(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, nick); + mir_sntprintf(newcachepath, _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, oldName); + mir_sntprintf(renamedcachepath, _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, nick); // file exists? if ( _taccess(newcachepath, 0) != -1) { @@ -124,9 +124,9 @@ int SiteDeleted(WPARAM wParam, LPARAM) cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); + mir_sntprintf(cachedirectorypath, _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, contactName); + mir_sntprintf(newcachepath, _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, contactName); // file exists? if ( _taccess(newcachepath, 0) != -1) { FILE *pcachefile = _tfopen(newcachepath, _T("r")); diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 932ba2a47f..34b2f11524 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
_itot(commonData.checkInterval, buffer, 10);
SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
+ mir_sntprintf(buffer, _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
_itot(commonData.cSoundNearDays, buffer, 10);
SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
@@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l char *szProto = GetContactProto(hContact);
TCHAR buffer[2048];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, buffer);
HWND hDate = GetDlgItem(hWnd, IDC_DATE);
@@ -441,7 +441,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case DOB_PROTOCOL:
DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
- mir_sntprintf(buffer, _countof(buffer), TranslateT("%S protocol"), szProto);
+ mir_sntprintf(buffer, TranslateT("%S protocol"), szProto);
szCurrentModuleTooltip = buffer;
break;
@@ -609,22 +609,22 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, TCHAR buffer[2048];
if ((dtb <= 366) && (dtb >= 0))
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), dtb);
+ mir_sntprintf(buffer, _T("%d"), dtb);
else
- mir_sntprintf(buffer, _countof(buffer), NA);
+ mir_sntprintf(buffer, NA);
ListView_SetItemText(hList, entry, 2, buffer);
if ((month != 0) && (day != 0))
- mir_sntprintf(buffer, _countof(buffer), _T("%04d-%02d-%02d"), year, month, day);
+ mir_sntprintf(buffer, _T("%04d-%02d-%02d"), year, month, day);
else
- mir_sntprintf(buffer, _countof(buffer), NA);
+ mir_sntprintf(buffer, NA);
ListView_SetItemText(hList, entry, 3, buffer);
if (age < 400 && age > 0) //hopefully noone lives longer than this :)
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), age);
+ mir_sntprintf(buffer, _T("%d"), age);
else
- mir_sntprintf(buffer, _countof(buffer), NA);
+ mir_sntprintf(buffer, NA);
ListView_SetItemText(hList, entry, 4, buffer);
ListView_SetItemText(hList, entry, 5, GetBirthdayModule(module, hContact));
@@ -694,7 +694,7 @@ void SetBirthdaysCount(HWND hWnd) {
int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
TCHAR title[512];
- mir_sntprintf(title, _countof(title), TranslateT("Birthday list (%d)"), count);
+ mir_sntprintf(title, TranslateT("Birthday list (%d)"), count);
SetWindowText(hWnd, title);
}
@@ -881,7 +881,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar const int MAX_SIZE = 512;
TCHAR buffer[MAX_SIZE];
timeout--;
- mir_sntprintf(buffer, _countof(buffer), (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
+ mir_sntprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
SetDlgItemText(hWnd, IDC_CLOSE, buffer);
if (timeout <= 0)
@@ -914,9 +914,9 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar ListView_InsertItem(hList, &item);
TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->age);
+ mir_sntprintf(buffer, _T("%d"), data->age);
ListView_SetItemText(hList, index, 1, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->dtb);
+ mir_sntprintf(buffer, _T("%d"), data->dtb);
ListView_SetItemText(hList, index, 2, buffer);
BirthdaysSortParams params = { 0 };
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 13a2e17350..131d97ed06 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -60,10 +60,10 @@ int AddIcons() hDTB[1] = AddIcon("DTB1", LPGEN("1 day to birthday"), tszPath, IDI_DTB1);
for (int i = 2; i < cDTB; i++) {
mir_snprintf(name, "DTB%d", i);
- mir_snprintf(description, _countof(description), Translate("%d days to birthday"), i);
+ mir_snprintf(description, Translate("%d days to birthday"), i);
hDTB[i] = AddIcon(name, description, tszPath, IDI_DTB0 + i);
}
- mir_snprintf(description, _countof(description), Translate("More than %d days to birthday"), cDTB - 1);
+ mir_snprintf(description, Translate("More than %d days to birthday"), cDTB - 1);
hDTBMore = AddIcon("DTBMore", description, tszPath, IDI_DTBMORE);
hWWIExtraIcons = ExtraIcon_RegisterIcolib("WhenWasIt", LPGEN("WhenWasIt birthday reminder"), "MenuCheck");
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 793364088e..e541836bbf 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -215,7 +215,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -224,7 +224,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) if (GetOpenFileName(&of)) {
TCHAR buffer[2048];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Importing birthdays from file: %s"), fileName);
+ mir_sntprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hImportBirthdays);
@@ -240,7 +240,7 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -252,7 +252,7 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) if (!_tcschr(fn, _T('.')))
mir_tstrcat(fileName, _T(BIRTHDAY_EXTENSION));
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Exporting birthdays to file: %s"), fileName);
+ mir_sntprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
DoExport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hExportBirthdays);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 245394f1ef..8018101d68 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -155,17 +155,17 @@ TCHAR* GetContactID(MCONTACT hContact, char *szProto) TCHAR tmp[16];
switch (ctInfo.type) {
case CNFT_BYTE:
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.bVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.bVal);
buffer = _tcsdup(tmp);
break;
case CNFT_WORD:
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.wVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.wVal);
buffer = _tcsdup(tmp);
break;
case CNFT_DWORD:
- mir_sntprintf(tmp, _countof(tmp), _T("%ld"), ctInfo.dVal);
+ mir_sntprintf(tmp, _T("%ld"), ctInfo.dVal);
buffer = _tcsdup(tmp);
break;
diff --git a/plugins/WhoUsesMyFiles/src/list.cpp b/plugins/WhoUsesMyFiles/src/list.cpp index 25f1230b8f..b02d918ef1 100644 --- a/plugins/WhoUsesMyFiles/src/list.cpp +++ b/plugins/WhoUsesMyFiles/src/list.cpp @@ -24,7 +24,7 @@ PWumf new_wumf( DWORD dwID, case PERM_FILE_CREATE: mir_tstrcpy(w->szPerm, _T("Create"));break;
default: mir_tstrcpy(w->szPerm, _T("Execute"));
}
- mir_sntprintf(w->szID, _countof(w->szID), _T("%i"), dwID);
+ mir_sntprintf(w->szID, _T("%i"), dwID);
w->dwID = dwID;
w->dwSess = dwSess;
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp index 5cd34db33e..17e89fbc6b 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.cpp +++ b/plugins/WhoUsesMyFiles/src/wumf.cpp @@ -140,7 +140,7 @@ void LogWumf(PWumf w) hLogger = mir_createLog("wumf", _T("WhoIsUsingMyFiles log file"), WumfOptions.LogFile, 0);
if (hLogger == NULL) {
TCHAR str[256];
- mir_sntprintf(str, _countof(str), _T("Can't open log file %s"), WumfOptions.LogFile);
+ mir_sntprintf(str, _T("Can't open log file %s"), WumfOptions.LogFile);
MessageBox(NULL, str, TranslateT("Error opening file"), MB_OK | MB_ICONSTOP);
WumfOptions.LogToFile = FALSE;
return;
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index f2fb9c2ad7..e86b29d08e 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -119,7 +119,7 @@ void ShowWumfPopup(PWumf w) TCHAR text[512], title[512];
if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
- mir_sntprintf(title, _countof(title), _T("%s (%s)"), w->szComp, w->szUser);
+ mir_sntprintf(title, _T("%s (%s)"), w->szComp, w->szUser);
mir_sntprintf(text, _T("%s (%s)"), w->szPath, w->szPerm);
ShowThePopup(w, title, text);
}
@@ -274,7 +274,7 @@ void ChooseFile(HWND hwndDlg) }
else if (CommDlgExtendedError() != 0) {
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
+ mir_sntprintf(str, TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
MessageBox(hwndDlg, str, TranslateT("Error"), MB_OK | MB_ICONSTOP);
}
}
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 6de7c5a28e..072e063b65 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -45,7 +45,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR value[100];
- mir_sntprintf(value, _countof(value), TranslateT("Custom sound for %s (%s)"), nick, uid);
+ mir_sntprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
SetWindowText(hwndDlg, value);
db_free(&dbvuid);
}
@@ -100,9 +100,9 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 0df84c1e80..45174298eb 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -122,9 +122,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index baea4559fd..c1b6afc31f 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -74,10 +74,10 @@ void InitSelfSounds() for (int i = 0; i < protoCount; i++) {
for (int j = 0; j < _countof(selfSounds); j++) {
char namebuf[128];
- mir_snprintf(namebuf, _countof(namebuf), "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
+ mir_snprintf(namebuf, "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
TCHAR infobuf[256];
- mir_sntprintf(infobuf, _countof(infobuf), _T("%s [%s]"), TranslateT("Self status"), protos[i]->tszAccountName);
+ mir_sntprintf(infobuf, _T("%s [%s]"), TranslateT("Self status"), protos[i]->tszAccountName);
SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
}
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp index 230f9e089b..e9d3f715a4 100644 --- a/plugins/YAMN/src/account.cpp +++ b/plugins/YAMN/src/account.cpp @@ -227,7 +227,7 @@ DWORD ReadStringFromMemory(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugS Finder=*Parser; while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++; - mir_sntprintf(Debug, _countof(Debug), _T("%s: %s,length is %d, remaining %d chars"), DebugString, *Parser, Finder-*Parser, End-Finder); + mir_sntprintf(Debug, _T("%s: %s,length is %d, remaining %d chars"), DebugString, *Parser, Finder-*Parser, End-Finder); MessageBox(NULL,Debug,_T("debug"),MB_OK); if (Finder>=End) return EACC_FILECOMPATIBILITY; @@ -282,7 +282,7 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,TCHAR *End,WCHAR **StoreTo,WCHAR *Deb Finder=*Parser; while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++; - mir_sntprintf(Debug, _countof(Debug), L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); + mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); MessageBoxW(NULL,Debug,L"debug",MB_OK); if (Finder>=(WCHAR *)End) return EACC_FILECOMPATIBILITY; @@ -338,7 +338,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("NFlags: %04x, remaining %d chars"), Which->Flags, End-*Parser); + mir_sntprintf(Debug, _T("NFlags: %04x, remaining %d chars"), Which->Flags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -347,7 +347,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PopupB: %04x, remaining %d chars"), Which->PopupB, End-*Parser); + mir_sntprintf(Debug, _T("PopupB: %04x, remaining %d chars"), Which->PopupB, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->PopupT = *(COLORREF *)(*Parser); @@ -355,7 +355,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PopupT: %04x, remaining %d chars"), Which->PopupT, End-*Parser); + mir_sntprintf(Debug, _T("PopupT: %04x, remaining %d chars"), Which->PopupT, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->PopupTime = *(DWORD *)(*Parser); @@ -363,7 +363,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PopupTime: %04x, remaining %d chars"), Which->PopupTime, End-*Parser); + mir_sntprintf(Debug, _T("PopupTime: %04x, remaining %d chars"), Which->PopupTime, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -513,7 +513,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("Port: %d, remaining %d chars"), Which->Server->Port, End-*Parser); + mir_sntprintf(Debug, _T("Port: %d, remaining %d chars"), Which->Server->Port, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif #ifdef DEBUG_FILEREAD @@ -536,19 +536,19 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("Flags: %04x, remaining %d chars"), Which->Flags, End-*Parser); + mir_sntprintf(Debug, _T("Flags: %04x, remaining %d chars"), Which->Flags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->StatusFlags = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("STFlags: %04x, remaining %d chars"), Which->StatusFlags, End-*Parser); + mir_sntprintf(Debug, _T("STFlags: %04x, remaining %d chars"), Which->StatusFlags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->PluginFlags = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PFlags: %04x, remaining %d chars"), Which->PluginFlags, End-*Parser); + mir_sntprintf(Debug, _T("PFlags: %04x, remaining %d chars"), Which->PluginFlags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -559,7 +559,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("Interval: %d, remaining %d chars"), Which->Interval, End-*Parser); + mir_sntprintf(Debug, _T("Interval: %d, remaining %d chars"), Which->Interval, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -602,7 +602,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastChecked: %04x, remaining %d chars"), Which->LastChecked, End-*Parser); + mir_sntprintf(Debug, _T("LastChecked: %04x, remaining %d chars"), Which->LastChecked, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->LastSChecked = *(SYSTEMTIME *)(*Parser); @@ -610,7 +610,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastSChecked: %04x, remaining %d chars"), Which->LastSChecked, End-*Parser); + mir_sntprintf(Debug, _T("LastSChecked: %04x, remaining %d chars"), Which->LastSChecked, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->LastSynchronised = *(SYSTEMTIME *)(*Parser); @@ -618,7 +618,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastSynchronised: %04x, remaining %d chars"), Which->LastSynchronised, End-*Parser); + mir_sntprintf(Debug, _T("LastSynchronised: %04x, remaining %d chars"), Which->LastSynchronised, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->LastMail = *(SYSTEMTIME *)(*Parser); @@ -626,7 +626,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser > End) //WARNING! There's only > at the end of testing return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastMail: %04x, remaining %d chars"), Which->LastMail, End-*Parser); + mir_sntprintf(Debug, _T("LastMail: %04x, remaining %d chars"), Which->LastMail, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif if (*Parser == End) diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index c32601f70b..1b0d7f5cac 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -569,7 +569,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags) SendMessageW(hListView, LVM_SETITEMTEXTW, (WPARAM)item.iItem, (LPARAM)&item); item.iSubItem = 2; - mir_sntprintf(SizeStr, _countof(SizeStr), L"%d kB", msgq->MailData->Size / 1024); + mir_sntprintf(SizeStr, L"%d kB", msgq->MailData->Size / 1024); item.pszText = SizeStr; SendMessageW(hListView, LVM_SETITEMTEXTW, (WPARAM)item.iItem, (LPARAM)&item); @@ -636,7 +636,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun)) { char sMsg[250]; - mir_snprintf(sMsg, _countof(sMsg), Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_snprintf(sMsg, Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); if (!(nflags & YAMN_ACC_CONTNOEVENT)) { CLISTEVENT cEvent; cEvent.cbSize = sizeof(CLISTEVENT); @@ -671,7 +671,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D NewMailPopup.PluginData = (void *)0; //multiple popups mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName)); - mir_sntprintf(NewMailPopup.lptzText, _countof(NewMailPopup.lptzText), TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_sntprintf(NewMailPopup.lptzText, TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); PUAddPopupT(&NewMailPopup); } @@ -767,7 +767,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D mir_tstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName)); if (MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC) - mir_sntprintf(NoNewMailPopup.lptzText, _countof(NoNewMailPopup.lptzText), TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC); + mir_sntprintf(NoNewMailPopup.lptzText, TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC); else mir_tstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText)); PUAddPopupT(&NoNewMailPopup); @@ -2045,7 +2045,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (Total) { TCHAR DeleteMsg[1024]; - mir_sntprintf(DeleteMsg, _countof(DeleteMsg), TranslateT("Do you really want to delete %d selected mails?"), Total); + mir_sntprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total); if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING)) { struct DeleteParam ParamToDeleteMails = { YAMN_DELETEVERSION, ThreadRunningEV, ActualAccount, NULL }; diff --git a/plugins/YAMN/src/debug.cpp b/plugins/YAMN/src/debug.cpp index 96d61131bc..e074390fac 100644 --- a/plugins/YAMN/src/debug.cpp +++ b/plugins/YAMN/src/debug.cpp @@ -43,21 +43,21 @@ void InitDebug() InitializeCriticalSection(&FileAccessCS);
#ifdef DEBUG_SYNCHRO
- mir_sntprintf(DebugFileName, _countof(DebugFileName), DebugSynchroFileName2, DebugUserDirectory);
+ mir_sntprintf(DebugFileName, DebugSynchroFileName2, DebugUserDirectory);
SynchroFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(SynchroFile,"Synchro debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_COMM
- mir_sntprintf(DebugFileName, _countof(DebugFileName), DebugCommFileName2, DebugUserDirectory);
+ mir_sntprintf(DebugFileName, DebugCommFileName2, DebugUserDirectory);
CommFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(CommFile,"Communication debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_DECODE
- mir_sntprintf(DebugFileName, _countof(DebugFileName), DebugDecodeFileName2, DebugUserDirectory);
+ mir_sntprintf(DebugFileName, DebugDecodeFileName2, DebugUserDirectory);
DecodeFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(DecodeFile,"Decoding kernel debug file created by %s\n",YAMN_VER);
@@ -92,7 +92,7 @@ void DebugLog(HANDLE File,const char *fmt,...) va_start(vararg,fmt);
str=(char *)malloc(strsize=65536);
- mir_snprintf(tids, _countof(tids), "[%x]",GetCurrentThreadId());
+ mir_snprintf(tids, "[%x]",GetCurrentThreadId());
while(mir_vsnprintf(str, strsize, fmt, vararg)==-1)
str=(char *)realloc(str,strsize+=65536);
va_end(vararg);
@@ -113,7 +113,7 @@ void DebugLogW(HANDLE File,const WCHAR *fmt,...) va_start(vararg,fmt);
str=(WCHAR *)malloc((strsize=65536)*sizeof(WCHAR));
- mir_snprintf(tids, _countof(tids), "[%x]",GetCurrentThreadId());
+ mir_snprintf(tids, "[%x]",GetCurrentThreadId());
while(mir_vsnwprintf(str, strsize, fmt, vararg)==-1)
str=(WCHAR *)realloc(str,(strsize+=65536)*sizeof(WCHAR));
va_end(vararg);
diff --git a/plugins/YAMN/src/mails/mime.cpp b/plugins/YAMN/src/mails/mime.cpp index 906d18d776..bb1c420657 100644 --- a/plugins/YAMN/src/mails/mime.cpp +++ b/plugins/YAMN/src/mails/mime.cpp @@ -661,7 +661,7 @@ FailBackRaw: for (i=0;i<numparts;i++) {
if (i) { // part before first boudary should not have headers
char infoline[1024]; size_t linesize = 0;
- mir_snprintf(infoline, _countof(infoline), "%s %d", Translate("Part"), i);
+ mir_snprintf(infoline, "%s %d", Translate("Part"), i);
linesize = mir_strlen(infoline);
if (partData[i].TransEnc) {
mir_snprintf(infoline + linesize, _countof(infoline) - linesize, "; %s", partData[i].TransEnc);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index bfccb134d9..bfca36fa74 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -203,7 +203,7 @@ void WINAPI g_ReleaseIcon( HICON hIcon ) static void LoadPlugins() { TCHAR szSearchPath[MAX_PATH]; - mir_sntprintf(szSearchPath, _countof(szSearchPath), _T("%s\\Plugins\\YAMN\\*.dll"), szMirandaDir); + mir_sntprintf(szSearchPath, _T("%s\\Plugins\\YAMN\\*.dll"), szMirandaDir); hDllPlugins = NULL; @@ -225,7 +225,7 @@ static void LoadPlugins() continue; TCHAR szPluginPath[MAX_PATH]; - mir_sntprintf(szPluginPath, _countof(szPluginPath),_T("%s\\Plugins\\YAMN\\%s"), szMirandaDir, fd.cFileName); + mir_sntprintf(szPluginPath, _T("%s\\Plugins\\YAMN\\%s"), szMirandaDir, fd.cFileName); HINSTANCE hDll = LoadLibrary(szPluginPath); if (hDll == NULL) continue; diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp index 1fe773732d..1bad6db026 100644 --- a/plugins/YAMN/src/proto/netlib.cpp +++ b/plugins/YAMN/src/proto/netlib.cpp @@ -6,72 +6,71 @@ #include "..\stdafx.h"
-//--------------------------------------------------------------------------------------------------
-//--------------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------------------
-BOOL SSLLoaded=FALSE;
-HANDLE hNetlibUser=NULL;
+BOOL SSLLoaded = FALSE;
+HANDLE hNetlibUser = NULL;
void __stdcall SSL_DebugLog(const char *fmt, ...)
{
char str[4096];
va_list vararg;
- va_start( vararg, fmt );
+ va_start(vararg, fmt);
int tBytes = mir_vsnprintf(str, _countof(str), fmt, vararg);
- if ( tBytes == 0 )
+ if (tBytes == 0)
return;
- if ( tBytes > 0 )
- str[ tBytes ] = 0;
+ if (tBytes > 0)
+ str[tBytes] = 0;
else
- str[ sizeof(str)-1 ] = 0;
+ str[sizeof(str) - 1] = 0;
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)str);
- va_end( vararg );
+ va_end(vararg);
}
HANDLE RegisterNLClient(const char *name)
{
- static NETLIBUSER nlu={0};
+ static NETLIBUSER nlu = { 0 };
char desc[128];
mir_snprintf(desc, Translate("%s connection"), name);
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<Register PROXY support>");
-#endif
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<Register PROXY support>");
+ #endif
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
- nlu.szDescriptiveName=desc;
- nlu.szSettingsModule=(char *)name;
- hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
-
-#ifdef DEBUG_COMM
- if (NULL==hNetlibUser)
- DebugLog(CommFile,"<error></Register PROXY support>\n");
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
+ nlu.szDescriptiveName = desc;
+ nlu.szSettingsModule = (char *)name;
+ hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ #ifdef DEBUG_COMM
+ if (NULL == hNetlibUser)
+ DebugLog(CommFile, "<error></Register PROXY support>\n");
else
- DebugLog(CommFile,"</Register PROXY support>\n");
-#endif
+ DebugLog(CommFile, "</Register PROXY support>\n");
+ #endif
return hNetlibUser;
}
//Move connection to SSL
-void CNLClient::SSLify() throw(DWORD) {
-#ifdef DEBUG_COMM
+void CNLClient::SSLify() throw(DWORD)
+{
+ #ifdef DEBUG_COMM
SSL_DebugLog("Staring SSL...");
-#endif
+ #endif
int socket = CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConnection, 0);
- if (socket != INVALID_SOCKET)
- {
-#ifdef DEBUG_COMM
- SSL_DebugLog("Staring netlib core SSL");
-#endif
- if (CallService(MS_NETLIB_STARTSSL, (WPARAM)hConnection, 0))
- {
-#ifdef DEBUG_COMM
+ if (socket != INVALID_SOCKET) {
+ #ifdef DEBUG_COMM
+ SSL_DebugLog("Staring netlib core SSL");
+ #endif
+ if (CallService(MS_NETLIB_STARTSSL, (WPARAM)hConnection, 0)) {
+ #ifdef DEBUG_COMM
SSL_DebugLog("Netlib core SSL started");
-#endif
+ #endif
isTLSed = true;
SSLLoaded = TRUE;
return;
@@ -84,82 +83,76 @@ void CNLClient::SSLify() throw(DWORD) { //Connects to the server through the sock
//if not success, exception is throwed
-void CNLClient::Connect(const char* servername,const int port) throw(DWORD)
+void CNLClient::Connect(const char* servername, const int port) throw(DWORD)
{
NETLIBOPENCONNECTION nloc;
- NetworkError=SystemError=0;
+ NetworkError = SystemError = 0;
isTLSed = false;
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<connect>\n");
-#endif
- try
- {
- nloc.cbSize=sizeof(NETLIBOPENCONNECTION);
- nloc.szHost=servername;
- nloc.wPort=port;
- nloc.flags=0;
- if (NULL==(hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)hNetlibUser,(LPARAM)&nloc)))
- {
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_CONNECT;
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<connect>\n");
+ #endif
+ try {
+ nloc.cbSize = sizeof(NETLIBOPENCONNECTION);
+ nloc.szHost = servername;
+ nloc.wPort = port;
+ nloc.flags = 0;
+ if (NULL == (hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc))) {
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_CONNECT;
}
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"</connect>\n");
-#endif
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "</connect>\n");
+ #endif
return;
}
- catch(...)
- {
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<error></connect>\n");
-#endif
+ catch (...) {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<error></connect>\n");
+ #endif
throw;
}
}
//Performs a simple query
// query- command to send
-int CNLClient::LocalNetlib_Send(HANDLE hConn,const char *buf,int len,int flags) {
- if (isTLSed)
- {
-#ifdef DEBUG_COMM
+int CNLClient::LocalNetlib_Send(HANDLE hConn, const char *buf, int len, int flags)
+{
+ if (isTLSed) {
+ #ifdef DEBUG_COMM
SSL_DebugLog("SSL send: %s", buf);
-#endif
- }
-
- NETLIBBUFFER nlb={(char*)buf,len,flags};
- return CallService(MS_NETLIB_SEND,(WPARAM)hConn,(LPARAM)&nlb);
+ #endif
+ }
+
+ NETLIBBUFFER nlb = { (char*)buf,len,flags };
+ return CallService(MS_NETLIB_SEND, (WPARAM)hConn, (LPARAM)&nlb);
}
void CNLClient::Send(const char *query) throw(DWORD)
{
unsigned int Sent;
- if (NULL==query)
+ if (NULL == query)
return;
- if (hConnection==NULL)
+ if (hConnection == NULL)
return;
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<send>%s",query);
-#endif
- try
- {
- if ((SOCKET_ERROR==(Sent=LocalNetlib_Send(hConnection,query,(int)mir_strlen(query),MSG_DUMPASTEXT))) || Sent != (unsigned int)mir_strlen(query))
- {
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_SEND;
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<send>%s", query);
+ #endif
+ try {
+ if ((SOCKET_ERROR == (Sent = LocalNetlib_Send(hConnection, query, (int)mir_strlen(query), MSG_DUMPASTEXT))) || Sent != (unsigned int)mir_strlen(query)) {
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_SEND;
}
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"</send>\n");
-#endif
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "</send>\n");
+ #endif
}
- catch(...)
- {
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<error></send>\n");
-#endif
+ catch (...) {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<error></send>\n");
+ #endif
throw;
}
}
@@ -171,75 +164,69 @@ void CNLClient::Send(const char *query) throw(DWORD) //You need free() returned buffer, which can be allocated in this function
//if not success, exception is throwed
-int CNLClient::LocalNetlib_Recv(HANDLE hConn,char *buf,int len,int flags) {
- NETLIBBUFFER nlb={buf,len,flags};
- int iReturn = CallService(MS_NETLIB_RECV,(WPARAM)hConn,(LPARAM)&nlb);
- if (isTLSed)
- {
-#ifdef DEBUG_COMM
+int CNLClient::LocalNetlib_Recv(HANDLE hConn, char *buf, int len, int flags)
+{
+ NETLIBBUFFER nlb = { buf,len,flags };
+ int iReturn = CallService(MS_NETLIB_RECV, (WPARAM)hConn, (LPARAM)&nlb);
+ if (isTLSed) {
+ #ifdef DEBUG_COMM
SSL_DebugLog("SSL recv: %s", buf);
-#endif
+ #endif
}
-
+
return iReturn;
}
-char* CNLClient::Recv(char *buf,int buflen) throw(DWORD)
+char* CNLClient::Recv(char *buf, int buflen) throw(DWORD)
{
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<reading>");
-#endif
- try
- {
- if (buf==NULL)
- buf=(char *)malloc(sizeof(char)*(buflen+1));
- if (buf==NULL)
- throw NetworkError=(DWORD)ENL_RECVALLOC;
-
- if (!isTLSed)
- {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<reading>");
+ #endif
+ try {
+ if (buf == NULL)
+ buf = (char *)malloc(sizeof(char)*(buflen + 1));
+ if (buf == NULL)
+ throw NetworkError = (DWORD)ENL_RECVALLOC;
+
+ if (!isTLSed) {
NETLIBSELECT nls;
memset(&nls, 0, sizeof(NETLIBSELECT));
nls.cbSize = sizeof(NETLIBSELECT);
nls.dwTimeout = 60000;
nls.hReadConns[0] = hConnection;
- switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM) &nls))
- {
- case SOCKET_ERROR:
+ switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ case SOCKET_ERROR:
free(buf);
- SystemError=WSAGetLastError();
- throw NetworkError = (DWORD) ENL_RECV;
- case 0: // time out!
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_RECV;
+ case 0: // time out!
free(buf);
- throw NetworkError = (DWORD) ENL_TIMEOUT;
+ throw NetworkError = (DWORD)ENL_TIMEOUT;
}
- }
+ }
memset(buf, 0, buflen);
- if (SOCKET_ERROR==(Rcv=LocalNetlib_Recv(hConnection,buf,buflen,MSG_DUMPASTEXT)))
- {
+ if (SOCKET_ERROR == (Rcv = LocalNetlib_Recv(hConnection, buf, buflen, MSG_DUMPASTEXT))) {
free(buf);
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_RECV;
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_RECV;
}
- if (!Rcv)
- {
+ if (!Rcv) {
free(buf);
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_RECV;
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_RECV;
}
-#ifdef DEBUG_COMM
- *(buf+Rcv)=0; //end the buffer to write it to file
- DebugLog(CommFile,"%s",buf);
- DebugLog(CommFile,"</reading>\n");
-#endif
+ #ifdef DEBUG_COMM
+ *(buf + Rcv) = 0; //end the buffer to write it to file
+ DebugLog(CommFile, "%s", buf);
+ DebugLog(CommFile, "</reading>\n");
+ #endif
return(buf);
}
- catch(...)
- {
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<error></reading>\n");
-#endif
+ catch (...) {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<error></reading>\n");
+ #endif
throw;
}
}
@@ -248,19 +235,19 @@ char* CNLClient::Recv(char *buf,int buflen) throw(DWORD) void CNLClient::Disconnect()
{
Netlib_CloseHandle(hConnection);
- hConnection=(HANDLE)NULL;
+ hConnection = (HANDLE)NULL;
}
//Uninitializes netlib library
void UnregisterNLClient()
{
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<Unregister PROXY support>");
-#endif
-
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<Unregister PROXY support>");
+ #endif
+
Netlib_CloseHandle(hNetlibUser);
- hNetlibUser=(HANDLE)NULL;
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"</Unregister PROXY support>\n");
-#endif
+ hNetlibUser = (HANDLE)NULL;
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "</Unregister PROXY support>\n");
+ #endif
}
diff --git a/plugins/YAMN/src/proto/pop3/pop3.cpp b/plugins/YAMN/src/proto/pop3/pop3.cpp index 1be2d83678..2006535eef 100644 --- a/plugins/YAMN/src/proto/pop3/pop3.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3.cpp @@ -201,7 +201,7 @@ char* CPop3Client::User(char* name) char query[128]; char *Result; - mir_snprintf(query, _countof(query), "USER %s\r\n", name); + mir_snprintf(query, "USER %s\r\n", name); NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); if (AckFlag==POP3_FERR) @@ -220,7 +220,7 @@ char* CPop3Client::Pass(char* pw) char query[128]; char *Result; - mir_snprintf(query, _countof(query), "PASS %s\r\n", pw); + mir_snprintf(query, "PASS %s\r\n", pw); NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); if (AckFlag==POP3_FERR) @@ -248,7 +248,7 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp) mir_md5_finish(&ctx, digest); char hexdigest[40]; - mir_snprintf(query, _countof(query), "APOP %s %s\r\n", name, bin2hex(digest, sizeof(digest), hexdigest)); + mir_snprintf(query, "APOP %s %s\r\n", name, bin2hex(digest, sizeof(digest), hexdigest)); NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); @@ -302,7 +302,7 @@ char* CPop3Client::Top(int nr, int lines) char query[128]; - mir_snprintf(query, _countof(query), "TOP %d %d\r\n", nr, lines); + mir_snprintf(query, "TOP %d %d\r\n", nr, lines); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHDOT); } @@ -318,11 +318,11 @@ char* CPop3Client::Uidl(int nr) if (nr) { - mir_snprintf(query, _countof(query), "UIDL %d\r\n", nr); + mir_snprintf(query, "UIDL %d\r\n", nr); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHACK); } - mir_snprintf(query, _countof(query), "UIDL\r\n"); + mir_snprintf(query, "UIDL\r\n"); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHDOT); } @@ -336,7 +336,7 @@ char* CPop3Client::Dele(int nr) char query[128]; - mir_snprintf(query, _countof(query), "DELE %d\r\n", nr); + mir_snprintf(query, "DELE %d\r\n", nr); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHACK); } @@ -349,7 +349,7 @@ char* CPop3Client::Retr(int nr) char query[128]; - mir_snprintf(query, _countof(query), "RETR %d\r\n", nr); + mir_snprintf(query, "RETR %d\r\n", nr); NetClient->Send(query); RecvRest(NetClient->Recv(),POP3_SEARCHACK); return NetClient->Recv(); diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index febfae336b..b35c183093 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -380,7 +380,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, _countof(Debug), _T("CodePage: %d, remaining %d chars"), ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
+ mir_sntprintf(Debug, _T("CodePage: %d, remaining %d chars"), ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
MessageBox(NULL,Debug,_T("debug"),MB_OK);
#endif
return 0;
@@ -713,7 +713,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
TCHAR accstatus[512];
- mir_sntprintf(accstatus, _countof(accstatus), TranslateT("Reading body %s"), NewMsgsPtr->ID);
+ mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
SetAccountStatus(ActualAccount, accstatus);
DataRX = MyClient->Top(MsgQueuePtr->Number, 100);
#ifdef DEBUG_DECODE
@@ -786,7 +786,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) {
BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY) != 0;
DataRX = MyClient->Top(MsgQueuePtr->Number, autoretr ? 100 : 0);
- mir_sntprintf(accstatus, _countof(accstatus), TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
+ mir_sntprintf(accstatus, TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
SetAccountStatus(ActualAccount, accstatus);
#ifdef DEBUG_DECODE
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 73aa051d53..14c24847ea 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -8,59 +8,59 @@ //--------------------------------------------------------------------------------------------------
-static BOOL Check0,Check1,Check2,Check3,Check4,Check5,Check6,Check7,Check8,Check9;
+static BOOL Check0, Check1, Check2, Check3, Check4, Check5, Check6, Check7, Check8, Check9;
static char DlgInput[MAX_PATH];
void CheckMenuItems();
//--------------------------------------------------------------------------------------------------
-INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hDlg);
- CheckDlgButton(hDlg,IDC_CHECKTTB,db_get_b(NULL,YAMN_DBMODULE,YAMN_TTBFCHECK,1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_LONGDATE,(optDateTime&SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_SMARTDATE,(optDateTime&SHOWDATENOTODAY) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_NOSECONDS,(optDateTime&SHOWDATENOSECONDS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_MAINMENU,db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_YAMNASPROTO,db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CLOSEONDELETE,db_get_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKTTB, db_get_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_LONGDATE, (optDateTime&SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_SMARTDATE, (optDateTime&SHOWDATENOTODAY) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_NOSECONDS, (optDateTime&SHOWDATENOSECONDS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_MAINMENU, db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_YAMNASPROTO, db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CLOSEONDELETE, db_get_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0) ? BST_CHECKED : BST_UNCHECKED);
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDC_YAMNASPROTO:
- case IDC_MAINMENU:
- case IDC_CHECKTTB:
- case IDC_CLOSEONDELETE:
- case IDC_LONGDATE:
- case IDC_SMARTDATE:
- case IDC_NOSECONDS:
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
- break;
+ switch (LOWORD(wParam)) {
+ case IDC_YAMNASPROTO:
+ case IDC_MAINMENU:
+ case IDC_CHECKTTB:
+ case IDC_CLOSEONDELETE:
+ case IDC_LONGDATE:
+ case IDC_SMARTDATE:
+ case IDC_NOSECONDS:
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
}
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
- switch(((LPNMHDR)lParam)->code) {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg,IDC_YAMNASPROTO));
- db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg,IDC_MAINMENU));
- db_set_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg,IDC_CLOSEONDELETE));
- db_set_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg,IDC_CHECKTTB));
-
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg, IDC_YAMNASPROTO));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg, IDC_MAINMENU));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg, IDC_CLOSEONDELETE));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg, IDC_CHECKTTB));
+
AddTopToolbarIcon(0, 0);
CheckMenuItems();
optDateTime = 0;
- if (IsDlgButtonChecked(hDlg,IDC_LONGDATE))optDateTime |= SHOWDATELONG;
- if (IsDlgButtonChecked(hDlg,IDC_SMARTDATE))optDateTime |= SHOWDATENOTODAY;
- if (IsDlgButtonChecked(hDlg,IDC_NOSECONDS))optDateTime |= SHOWDATENOSECONDS;
- db_set_b(NULL,YAMN_DBMODULE,YAMN_DBTIMEOPTIONS,optDateTime);
+ if (IsDlgButtonChecked(hDlg, IDC_LONGDATE))optDateTime |= SHOWDATELONG;
+ if (IsDlgButtonChecked(hDlg, IDC_SMARTDATE))optDateTime |= SHOWDATENOTODAY;
+ if (IsDlgButtonChecked(hDlg, IDC_NOSECONDS))optDateTime |= SHOWDATENOSECONDS;
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);
}
}
break;
@@ -71,87 +71,83 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam) INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
{
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hDlg);
break;
case WM_COMMAND:
- {
- WORD wNotifyCode = HIWORD(wParam);
- switch(LOWORD(wParam))
{
+ WORD wNotifyCode = HIWORD(wParam);
+ switch (LOWORD(wParam)) {
case IDC_COMBOPLUGINS:
- if (wNotifyCode==CBN_SELCHANGE)
- {
- HWND hCombo=GetDlgItem(hDlg,IDC_COMBOPLUGINS);
+ if (wNotifyCode == CBN_SELCHANGE) {
+ HWND hCombo = GetDlgItem(hDlg, IDC_COMBOPLUGINS);
PYAMN_PROTOPLUGINQUEUE PParser;
PYAMN_FILTERPLUGINQUEUE FParser;
- int index,id;
-
- if (CB_ERR==(index=SendMessage(hCombo,CB_GETCURSEL,0,0)))
+ int index, id;
+
+ if (CB_ERR == (index = SendMessage(hCombo, CB_GETCURSEL, 0, 0)))
break;
- id=SendMessage(hCombo,CB_GETITEMDATA,(WPARAM)index,0);
+ id = SendMessage(hCombo, CB_GETITEMDATA, (WPARAM)index, 0);
EnterCriticalSection(&PluginRegCS);
- for (PParser=FirstProtoPlugin;PParser != NULL;PParser=PParser->Next)
- if (id==(INT_PTR)PParser->Plugin)
- {
- SetDlgItemTextA(hDlg,IDC_STVER,PParser->Plugin->PluginInfo->Ver);
- SetDlgItemTextA(hDlg,IDC_STDESC,PParser->Plugin->PluginInfo->Description == NULL ? "" : PParser->Plugin->PluginInfo->Description);
- SetDlgItemTextA(hDlg,IDC_STCOPY,PParser->Plugin->PluginInfo->Copyright == NULL ? "" : PParser->Plugin->PluginInfo->Copyright);
- SetDlgItemTextA(hDlg,IDC_STMAIL,PParser->Plugin->PluginInfo->Email == NULL ? "" : PParser->Plugin->PluginInfo->Email);
- SetDlgItemTextA(hDlg,IDC_STWWW,PParser->Plugin->PluginInfo->WWW == NULL ? "" : PParser->Plugin->PluginInfo->WWW);
+ for (PParser = FirstProtoPlugin; PParser != NULL; PParser = PParser->Next)
+ if (id == (INT_PTR)PParser->Plugin) {
+ SetDlgItemTextA(hDlg, IDC_STVER, PParser->Plugin->PluginInfo->Ver);
+ SetDlgItemTextA(hDlg, IDC_STDESC, PParser->Plugin->PluginInfo->Description == NULL ? "" : PParser->Plugin->PluginInfo->Description);
+ SetDlgItemTextA(hDlg, IDC_STCOPY, PParser->Plugin->PluginInfo->Copyright == NULL ? "" : PParser->Plugin->PluginInfo->Copyright);
+ SetDlgItemTextA(hDlg, IDC_STMAIL, PParser->Plugin->PluginInfo->Email == NULL ? "" : PParser->Plugin->PluginInfo->Email);
+ SetDlgItemTextA(hDlg, IDC_STWWW, PParser->Plugin->PluginInfo->WWW == NULL ? "" : PParser->Plugin->PluginInfo->WWW);
break;
}
- for (FParser=FirstFilterPlugin;FParser != NULL;FParser=FParser->Next)
- if (id==(INT_PTR)FParser->Plugin)
- {
- SetDlgItemTextA(hDlg,IDC_STVER,FParser->Plugin->PluginInfo->Ver);
- SetDlgItemTextA(hDlg,IDC_STDESC,FParser->Plugin->PluginInfo->Description == NULL ? "" : FParser->Plugin->PluginInfo->Description);
- SetDlgItemTextA(hDlg,IDC_STCOPY,FParser->Plugin->PluginInfo->Copyright == NULL ? "" : FParser->Plugin->PluginInfo->Copyright);
- SetDlgItemTextA(hDlg,IDC_STMAIL,FParser->Plugin->PluginInfo->Email == NULL ? "" : FParser->Plugin->PluginInfo->Email);
- SetDlgItemTextA(hDlg,IDC_STWWW,FParser->Plugin->PluginInfo->WWW == NULL ? "" : FParser->Plugin->PluginInfo->WWW);
+ for (FParser = FirstFilterPlugin; FParser != NULL; FParser = FParser->Next)
+ if (id == (INT_PTR)FParser->Plugin) {
+ SetDlgItemTextA(hDlg, IDC_STVER, FParser->Plugin->PluginInfo->Ver);
+ SetDlgItemTextA(hDlg, IDC_STDESC, FParser->Plugin->PluginInfo->Description == NULL ? "" : FParser->Plugin->PluginInfo->Description);
+ SetDlgItemTextA(hDlg, IDC_STCOPY, FParser->Plugin->PluginInfo->Copyright == NULL ? "" : FParser->Plugin->PluginInfo->Copyright);
+ SetDlgItemTextA(hDlg, IDC_STMAIL, FParser->Plugin->PluginInfo->Email == NULL ? "" : FParser->Plugin->PluginInfo->Email);
+ SetDlgItemTextA(hDlg, IDC_STWWW, FParser->Plugin->PluginInfo->WWW == NULL ? "" : FParser->Plugin->PluginInfo->WWW);
break;
}
LeaveCriticalSection(&PluginRegCS);
}
break;
case IDC_STWWW:
- {
- char str[1024];
- GetDlgItemTextA(hDlg,IDC_STWWW,str,_countof(str));
- Utils_OpenUrl(str);
- break;
- }
+ {
+ char str[1024];
+ GetDlgItemTextA(hDlg, IDC_STWWW, str, _countof(str));
+ Utils_OpenUrl(str);
+ break;
+ }
+ }
+ break;
}
- break;
- }
case WM_SHOWWINDOW:
- if (TRUE==(BOOL)wParam) {
+ if (TRUE == (BOOL)wParam) {
PYAMN_PROTOPLUGINQUEUE PParser;
PYAMN_FILTERPLUGINQUEUE FParser;
int index;
-
+
EnterCriticalSection(&PluginRegCS);
for (PParser = FirstProtoPlugin; PParser != NULL; PParser = PParser->Next) {
- index = SendDlgItemMessageA(hDlg,IDC_COMBOPLUGINS,CB_ADDSTRING,0,(LPARAM)PParser->Plugin->PluginInfo->Name);
- index = SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_SETITEMDATA,(WPARAM)index,(LPARAM)PParser->Plugin);
+ index = SendDlgItemMessageA(hDlg, IDC_COMBOPLUGINS, CB_ADDSTRING, 0, (LPARAM)PParser->Plugin->PluginInfo->Name);
+ index = SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)PParser->Plugin);
}
for (FParser = FirstFilterPlugin; FParser != NULL; FParser = FParser->Next) {
- index = SendDlgItemMessageA(hDlg,IDC_COMBOPLUGINS,CB_ADDSTRING,0,(LPARAM)FParser->Plugin->PluginInfo->Name);
- index = SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_SETITEMDATA,(WPARAM)index,(LPARAM)FParser->Plugin);
+ index = SendDlgItemMessageA(hDlg, IDC_COMBOPLUGINS, CB_ADDSTRING, 0, (LPARAM)FParser->Plugin->PluginInfo->Name);
+ index = SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)FParser->Plugin);
}
LeaveCriticalSection(&PluginRegCS);
- SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_SETCURSEL,0,0);
- SendMessage(hDlg,WM_COMMAND,MAKELONG(IDC_COMBOPLUGINS,CBN_SELCHANGE),0);
+ SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETCURSEL, 0, 0);
+ SendMessage(hDlg, WM_COMMAND, MAKELONG(IDC_COMBOPLUGINS, CBN_SELCHANGE), 0);
break;
}
else { //delete all items in combobox
- int cbn=SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_GETCOUNT,0,0);
- for (int i=0;i<cbn;i++)
- SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_DELETESTRING,0,0);
+ int cbn = SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_GETCOUNT, 0, 0);
+ for (int i = 0; i < cbn; i++)
+ SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_DELETESTRING, 0, 0);
break;
}
}
@@ -183,7 +179,7 @@ int YAMNOptInitSvc(WPARAM wParam, LPARAM) odp.pfnDlgProc = DlgProcPluginOpt;
Options_AddPage(wParam, &odp);
- if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszGroup = LPGEN("Popups");
odp.pszTab = LPGEN("YAMN");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POP3ACCOUNTPOPUP);
@@ -197,64 +193,64 @@ int YAMNOptInitSvc(WPARAM wParam, LPARAM) //--------------------------------------------------------------------------------------------------
BOOL DlgEnableAccountStatus(HWND hDlg, WPARAM wParam, LPARAM)
{
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST0),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST1),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST2),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST3),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST4),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST5),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST6),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST7),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST8),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST0), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST1), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST2), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST3), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST4), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST5), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST6), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST7), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST8), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST9), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST9), (BOOL)wParam);
return TRUE;
}
BOOL DlgEnableAccountPopup(HWND hDlg, WPARAM wParam, LPARAM)
{
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKPOP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCOL),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPB),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPT),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOPN),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOP1),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNPOP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITNPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNCOL),(IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNB),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNT),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFPOP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITFPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFCOL),(IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFB),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFT),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKAPOP),(BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKPOP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCOL), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPB), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPT), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOPN), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOP1), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNPOP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITNPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNCOL), (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNB), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNT), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFPOP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITFPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFCOL), (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFB), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFT), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKAPOP), (BOOL)wParam);
return TRUE;
}
BOOL DlgEnableAccount(HWND hDlg, WPARAM wParam, LPARAM)
{
- EnableWindow(GetDlgItem(hDlg,IDC_CHECK),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITSERVER),wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITNAME),wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPORT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITLOGIN),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPASS),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITINTERVAL),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKSND),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKMSG),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKICO),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKAPP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKKBN),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNAPP),(IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPP),(IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPPPARAM),(IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNMSGP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFSND),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFMSG),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFICO),(BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECK), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITSERVER), wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITNAME), wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPORT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITLOGIN), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPASS), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITINTERVAL), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKSND), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKMSG), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKICO), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKAPP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKKBN), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNAPP), (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPP), (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPPPARAM), (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNMSGP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFSND), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFMSG), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFICO), (BOOL)wParam);
/*EnableWindow(GetDlgItem(hDlg,IDC_CHECKST0),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST1),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST2),(BOOL)wParam);
@@ -266,123 +262,119 @@ BOOL DlgEnableAccount(HWND hDlg, WPARAM wParam, LPARAM) EnableWindow(GetDlgItem(hDlg,IDC_CHECKST8),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);*/
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKSTART),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFORCE),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_COMBOCP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_STTIMELEFT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNRESET),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEFAULT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNSTATUS),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKSSL),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNOTLS),(IsDlgButtonChecked(hDlg,IDC_CHECKSSL)==BST_UNCHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_AUTOBODY),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNICK),(IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNOEVENT),(IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKSTART), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFORCE), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_COMBOCP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_STTIMELEFT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNRESET), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEFAULT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNSTATUS), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKSSL), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNOTLS), (IsDlgButtonChecked(hDlg, IDC_CHECKSSL) == BST_UNCHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_AUTOBODY), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNICK), (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNOEVENT), (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED) && wParam);
return TRUE;
}
-BOOL DlgShowAccountStatus(HWND hDlg,WPARAM wParam,LPARAM lParam)
+BOOL DlgShowAccountStatus(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
-
- if ((DWORD)wParam==M_SHOWACTUAL)
- {
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
+
+ if ((DWORD)wParam == M_SHOWACTUAL) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
#endif
- CheckDlgButton(hDlg,IDC_CHECKST0,ActualAccount->StatusFlags & YAMN_ACC_ST0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST1,ActualAccount->StatusFlags & YAMN_ACC_ST1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST2,ActualAccount->StatusFlags & YAMN_ACC_ST2 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST3,ActualAccount->StatusFlags & YAMN_ACC_ST3 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST4,ActualAccount->StatusFlags & YAMN_ACC_ST4 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST5,ActualAccount->StatusFlags & YAMN_ACC_ST5 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST6,ActualAccount->StatusFlags & YAMN_ACC_ST6 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST7,ActualAccount->StatusFlags & YAMN_ACC_ST7 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST8,ActualAccount->StatusFlags & YAMN_ACC_ST8 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST9,ActualAccount->StatusFlags & YAMN_ACC_ST9 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST0, ActualAccount->StatusFlags & YAMN_ACC_ST0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST1, ActualAccount->StatusFlags & YAMN_ACC_ST1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST2, ActualAccount->StatusFlags & YAMN_ACC_ST2 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST3, ActualAccount->StatusFlags & YAMN_ACC_ST3 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST4, ActualAccount->StatusFlags & YAMN_ACC_ST4 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST5, ActualAccount->StatusFlags & YAMN_ACC_ST5 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST6, ActualAccount->StatusFlags & YAMN_ACC_ST6 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST7, ActualAccount->StatusFlags & YAMN_ACC_ST7 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST8, ActualAccount->StatusFlags & YAMN_ACC_ST8 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST9, ActualAccount->StatusFlags & YAMN_ACC_ST9 ? BST_CHECKED : BST_UNCHECKED);
ReadDone(ActualAccount);
}
- else
- {
- CheckDlgButton(hDlg,IDC_CHECKST0,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST1,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST2,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST3,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST4,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST5,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST6,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST7,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST8,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST9,BST_CHECKED);
+ else {
+ CheckDlgButton(hDlg, IDC_CHECKST0, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST1, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST2, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST3, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST4, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST5, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST6, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST7, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST8, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST9, BST_CHECKED);
}
return TRUE;
}
-BOOL DlgShowAccountPopup(HWND hDlg,WPARAM wParam,LPARAM lParam)
+BOOL DlgShowAccountPopup(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
-
- if ((DWORD)wParam==M_SHOWACTUAL)
- {
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
+
+ if ((DWORD)wParam == M_SHOWACTUAL) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
#endif
- SetDlgItemInt(hDlg,IDC_EDITPOPS,ActualAccount->NewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,ActualAccount->NoNewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,ActualAccount->BadConnectN.PopupTime,FALSE);
-
-
- CheckDlgButton(hDlg,IDC_CHECKPOP,ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNPOP,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNCOL,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, ActualAccount->NewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, ActualAccount->NoNewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, ActualAccount->BadConnectN.PopupTime, FALSE);
+
+
+ CheckDlgButton(hDlg, IDC_CHECKPOP, ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNPOP, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNCOL, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read done\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read done\n");
#endif
ReadDone(ActualAccount);
- }
+ }
else //default
{
- SetDlgItemInt(hDlg,IDC_EDITPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,0,FALSE);
- CheckDlgButton(hDlg,IDC_CHECKPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,BST_CHECKED);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, 0, FALSE);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, BST_CHECKED);
}
return TRUE;
}
-BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam)
+BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
int i;
-
- if ((DWORD)wParam==M_SHOWACTUAL)
- {
+
+ if ((DWORD)wParam == M_SHOWACTUAL) {
TCHAR accstatus[256];
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
#endif
DlgSetItemText(hDlg, IDC_EDITSERVER, ActualAccount->Server->Name);
DlgSetItemText(hDlg, IDC_EDITNAME, ActualAccount->Name);
@@ -390,42 +382,41 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) DlgSetItemText(hDlg, IDC_EDITPASS, ActualAccount->Server->Passwd);
DlgSetItemTextW(hDlg, IDC_EDITAPP, ActualAccount->NewMailN.App);
DlgSetItemTextW(hDlg, IDC_EDITAPPPARAM, ActualAccount->NewMailN.AppParam);
- SetDlgItemInt(hDlg,IDC_EDITPORT,ActualAccount->Server->Port,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITINTERVAL,ActualAccount->Interval/60,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITPOPS,ActualAccount->NewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,ActualAccount->NoNewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,ActualAccount->BadConnectN.PopupTime,FALSE);
- for (i=0;i<=CPLENSUPP;i++)
- if ((i<CPLENSUPP) && (CodePageNamesSupp[i].CP==ActualAccount->CP))
- {
+ SetDlgItemInt(hDlg, IDC_EDITPORT, ActualAccount->Server->Port, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITINTERVAL, ActualAccount->Interval / 60, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, ActualAccount->NewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, ActualAccount->NoNewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, ActualAccount->BadConnectN.PopupTime, FALSE);
+ for (i = 0; i <= CPLENSUPP; i++)
+ if ((i < CPLENSUPP) && (CodePageNamesSupp[i].CP == ActualAccount->CP)) {
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)i, 0);
break;
}
- if (i==CPLENSUPP)
+ if (i == CPLENSUPP)
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- CheckDlgButton(hDlg,IDC_CHECK,ActualAccount->Flags & YAMN_ACC_ENA ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSND,ActualAccount->NewMailN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKMSG,ActualAccount->NewMailN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKICO,ActualAccount->NewMailN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKPOP,ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPP,ActualAccount->NewMailN.Flags & YAMN_ACC_APP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKKBN,ActualAccount->NewMailN.Flags & YAMN_ACC_KBN ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNPOP,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNCOL,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNMSGP,ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFSND,ActualAccount->BadConnectN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFMSG,ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFICO,ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSSL,ActualAccount->Flags & YAMN_ACC_SSL23 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNOTLS,ActualAccount->Flags & YAMN_ACC_NOTLS ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPOP,ActualAccount->Flags & YAMN_ACC_APOP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_AUTOBODY,ActualAccount->Flags & YAMN_ACC_BODY ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECK, ActualAccount->Flags & YAMN_ACC_ENA ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSND, ActualAccount->NewMailN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKMSG, ActualAccount->NewMailN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKICO, ActualAccount->NewMailN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPP, ActualAccount->NewMailN.Flags & YAMN_ACC_APP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKKBN, ActualAccount->NewMailN.Flags & YAMN_ACC_KBN ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNPOP, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNCOL, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNMSGP, ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFSND, ActualAccount->BadConnectN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFMSG, ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFICO, ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSSL, ActualAccount->Flags & YAMN_ACC_SSL23 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNOTLS, ActualAccount->Flags & YAMN_ACC_NOTLS ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPOP, ActualAccount->Flags & YAMN_ACC_APOP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_AUTOBODY, ActualAccount->Flags & YAMN_ACC_BODY ? BST_CHECKED : BST_UNCHECKED);
/*CheckDlgButton(hDlg,IDC_CHECKST0,ActualAccount->StatusFlags & YAMN_ACC_ST0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST1,ActualAccount->StatusFlags & YAMN_ACC_ST1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST2,ActualAccount->StatusFlags & YAMN_ACC_ST2 ? BST_CHECKED : BST_UNCHECKED);
@@ -436,57 +427,57 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) CheckDlgButton(hDlg,IDC_CHECKST7,ActualAccount->StatusFlags & YAMN_ACC_ST7 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST8,ActualAccount->StatusFlags & YAMN_ACC_ST8 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST9,ActualAccount->StatusFlags & YAMN_ACC_ST9 ? BST_CHECKED : BST_UNCHECKED);*/
- Check0=ActualAccount->StatusFlags & YAMN_ACC_ST0;
- Check1=ActualAccount->StatusFlags & YAMN_ACC_ST1;
- Check2=ActualAccount->StatusFlags & YAMN_ACC_ST2;
- Check3=ActualAccount->StatusFlags & YAMN_ACC_ST3;
- Check4=ActualAccount->StatusFlags & YAMN_ACC_ST4;
- Check5=ActualAccount->StatusFlags & YAMN_ACC_ST5;
- Check6=ActualAccount->StatusFlags & YAMN_ACC_ST6;
- Check7=ActualAccount->StatusFlags & YAMN_ACC_ST7;
- Check8=ActualAccount->StatusFlags & YAMN_ACC_ST8;
- Check9=ActualAccount->StatusFlags & YAMN_ACC_ST9;
- CheckDlgButton(hDlg,IDC_CHECKSTART,ActualAccount->StatusFlags & YAMN_ACC_STARTS ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFORCE,ActualAccount->StatusFlags & YAMN_ACC_FORCE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACT,ActualAccount->NewMailN.Flags & YAMN_ACC_CONT ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACTNICK,ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACTNOEVENT,ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT ? BST_CHECKED : BST_UNCHECKED);
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read done\n");
-#endif
- GetAccountStatus(ActualAccount,accstatus);
- SetDlgItemText(hDlg,IDC_STSTATUS,accstatus);
+ Check0 = ActualAccount->StatusFlags & YAMN_ACC_ST0;
+ Check1 = ActualAccount->StatusFlags & YAMN_ACC_ST1;
+ Check2 = ActualAccount->StatusFlags & YAMN_ACC_ST2;
+ Check3 = ActualAccount->StatusFlags & YAMN_ACC_ST3;
+ Check4 = ActualAccount->StatusFlags & YAMN_ACC_ST4;
+ Check5 = ActualAccount->StatusFlags & YAMN_ACC_ST5;
+ Check6 = ActualAccount->StatusFlags & YAMN_ACC_ST6;
+ Check7 = ActualAccount->StatusFlags & YAMN_ACC_ST7;
+ Check8 = ActualAccount->StatusFlags & YAMN_ACC_ST8;
+ Check9 = ActualAccount->StatusFlags & YAMN_ACC_ST9;
+ CheckDlgButton(hDlg, IDC_CHECKSTART, ActualAccount->StatusFlags & YAMN_ACC_STARTS ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFORCE, ActualAccount->StatusFlags & YAMN_ACC_FORCE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACT, ActualAccount->NewMailN.Flags & YAMN_ACC_CONT ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACTNICK, ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACTNOEVENT, ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT ? BST_CHECKED : BST_UNCHECKED);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read done\n");
+ #endif
+ GetAccountStatus(ActualAccount, accstatus);
+ SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
ReadDone(ActualAccount);
- }
+ }
else //default
{
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITSERVER,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITNAME,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITLOGIN,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITPASS,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITAPP,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITAPPPARAM,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- SetDlgItemInt(hDlg,IDC_EDITPORT,110,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITINTERVAL,30,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,0,FALSE);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITSERVER, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITNAME, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITLOGIN, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITPASS, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPP, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPPPARAM, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ SetDlgItemInt(hDlg, IDC_EDITPORT, 110, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITINTERVAL, 30, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, 0, FALSE);
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- CheckDlgButton(hDlg,IDC_CHECK,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSND,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKMSG,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKICO,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPP,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFSND,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFMSG,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFICO,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECK, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSND, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKMSG, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKICO, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPP, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFSND, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFMSG, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFICO, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, BST_CHECKED);
/*CheckDlgButton(hDlg,IDC_CHECKST0,BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST1,BST_CHECKED);
CheckDlgButton(hDlg,IDC_CHECKST2,BST_UNCHECKED);
@@ -497,69 +488,63 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) CheckDlgButton(hDlg,IDC_CHECKST7,BST_CHECKED);
CheckDlgButton(hDlg,IDC_CHECKST8,BST_CHECKED);
CheckDlgButton(hDlg,IDC_CHECKST9,BST_CHECKED);*/
- CheckDlgButton(hDlg,IDC_CHECKSTART,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFORCE,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSSL,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNOTLS,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPOP,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_AUTOBODY,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACT,BST_CHECKED);
-
- SetDlgItemText(hDlg,IDC_STSTATUS,TranslateT("No account selected"));
+ CheckDlgButton(hDlg, IDC_CHECKSTART, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFORCE, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSSL, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNOTLS, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPOP, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_AUTOBODY, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACT, BST_CHECKED);
+
+ SetDlgItemText(hDlg, IDC_STSTATUS, TranslateT("No account selected"));
}
return TRUE;
}
BOOL DlgShowAccountColors(HWND hDlg, WPARAM, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNTCOLORS:ActualAccountSO-read wait\n");
-#endif
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNTCOLORS:ActualAccountSO-read wait\n");
+ #endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNTCOLORS:ActualAccountSO-read enter\n");
-#endif
- if (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC)
- {
- SendDlgItemMessage(hDlg,IDC_CPB,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NewMailN.PopupB);
- SendDlgItemMessage(hDlg,IDC_CPT,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NewMailN.PopupT);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNTCOLORS:ActualAccountSO-read enter\n");
+ #endif
+ if (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC) {
+ SendDlgItemMessage(hDlg, IDC_CPB, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NewMailN.PopupB);
+ SendDlgItemMessage(hDlg, IDC_CPT, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NewMailN.PopupT);
}
- else
- {
- SendDlgItemMessage(hDlg,IDC_CPB,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hDlg,IDC_CPT,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_WINDOWTEXT));
+ else {
+ SendDlgItemMessage(hDlg, IDC_CPB, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));
+ SendDlgItemMessage(hDlg, IDC_CPT, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOWTEXT));
}
- if (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC)
- {
- SendDlgItemMessage(hDlg,IDC_CPFB,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->BadConnectN.PopupB);
- SendDlgItemMessage(hDlg,IDC_CPFT,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->BadConnectN.PopupT);
+ if (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC) {
+ SendDlgItemMessage(hDlg, IDC_CPFB, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->BadConnectN.PopupB);
+ SendDlgItemMessage(hDlg, IDC_CPFT, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->BadConnectN.PopupT);
}
- else
- {
- SendDlgItemMessage(hDlg,IDC_CPFB,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hDlg,IDC_CPFT,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_WINDOWTEXT));
+ else {
+ SendDlgItemMessage(hDlg, IDC_CPFB, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));
+ SendDlgItemMessage(hDlg, IDC_CPFT, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOWTEXT));
}
- if (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC)
- {
- SendDlgItemMessage(hDlg,IDC_CPNB,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NoNewMailN.PopupB);
- SendDlgItemMessage(hDlg,IDC_CPNT,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NoNewMailN.PopupT);
+ if (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC) {
+ SendDlgItemMessage(hDlg, IDC_CPNB, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NoNewMailN.PopupB);
+ SendDlgItemMessage(hDlg, IDC_CPNT, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NoNewMailN.PopupT);
}
- else
- {
- SendDlgItemMessage(hDlg,IDC_CPNB,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hDlg,IDC_CPNT,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_WINDOWTEXT));
+ else {
+ SendDlgItemMessage(hDlg, IDC_CPNB, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));
+ SendDlgItemMessage(hDlg, IDC_CPNT, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOWTEXT));
}
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNTCOLORS:ActualAccountSO-read done\n");
-#endif
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNTCOLORS:ActualAccountSO-read done\n");
+ #endif
ReadDone(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
return TRUE;
}
-BOOL DlgSetItemText(HWND hDlg, WPARAM wParam,const char* str)
+BOOL DlgSetItemText(HWND hDlg, WPARAM wParam, const char* str)
{
if (str == NULL)
SetDlgItemTextA(hDlg, wParam, "");
@@ -568,7 +553,7 @@ BOOL DlgSetItemText(HWND hDlg, WPARAM wParam,const char* str) return TRUE;
}
-BOOL DlgSetItemTextW(HWND hDlg,WPARAM wParam,const WCHAR* str)
+BOOL DlgSetItemTextW(HWND hDlg, WPARAM wParam, const WCHAR* str)
{
if (str == NULL)
SetDlgItemTextW(hDlg, wParam, L"");
@@ -580,51 +565,49 @@ BOOL DlgSetItemTextW(HWND hDlg,WPARAM wParam,const WCHAR* str) INT_PTR CALLBACK DlgProcPOP3AccStatusOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
{
static HPOP3ACCOUNT ActualAccount;
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
- ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput);
- if (ActualAccount != NULL)
- {
- DlgShowAccountStatus(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgEnableAccountStatus(hDlg,TRUE,TRUE);
+ ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput);
+ if (ActualAccount != NULL) {
+ DlgShowAccountStatus(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgEnableAccountStatus(hDlg, TRUE, TRUE);
}
- else
- {
- CheckDlgButton(hDlg,IDC_CHECKST0,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST1,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST2,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST3,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST4,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST5,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST6,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST7,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST8,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST9,BST_CHECKED);
+ else {
+ CheckDlgButton(hDlg, IDC_CHECKST0, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST1, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST2, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST3, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST4, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST5, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST6, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST7, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST8, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST9, BST_CHECKED);
}
TranslateDialogDefault(hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDOK:
- Check0 = (IsDlgButtonChecked(hDlg,IDC_CHECKST0)==BST_CHECKED);
- Check1 = (IsDlgButtonChecked(hDlg,IDC_CHECKST1)==BST_CHECKED);
- Check2 = (IsDlgButtonChecked(hDlg,IDC_CHECKST2)==BST_CHECKED);
- Check3 = (IsDlgButtonChecked(hDlg,IDC_CHECKST3)==BST_CHECKED);
- Check4 = (IsDlgButtonChecked(hDlg,IDC_CHECKST4)==BST_CHECKED);
- Check5 = (IsDlgButtonChecked(hDlg,IDC_CHECKST5)==BST_CHECKED);
- Check6 = (IsDlgButtonChecked(hDlg,IDC_CHECKST6)==BST_CHECKED);
- Check7 = (IsDlgButtonChecked(hDlg,IDC_CHECKST7)==BST_CHECKED);
- Check8 = (IsDlgButtonChecked(hDlg,IDC_CHECKST8)==BST_CHECKED);
- Check9 = (IsDlgButtonChecked(hDlg,IDC_CHECKST9)==BST_CHECKED);
- WindowList_BroadcastAsync(YAMNVar.MessageWnds,WM_YAMN_CHANGESTATUSOPTION,0,0);
- EndDialog(hDlg,0);
+ Check0 = (IsDlgButtonChecked(hDlg, IDC_CHECKST0) == BST_CHECKED);
+ Check1 = (IsDlgButtonChecked(hDlg, IDC_CHECKST1) == BST_CHECKED);
+ Check2 = (IsDlgButtonChecked(hDlg, IDC_CHECKST2) == BST_CHECKED);
+ Check3 = (IsDlgButtonChecked(hDlg, IDC_CHECKST3) == BST_CHECKED);
+ Check4 = (IsDlgButtonChecked(hDlg, IDC_CHECKST4) == BST_CHECKED);
+ Check5 = (IsDlgButtonChecked(hDlg, IDC_CHECKST5) == BST_CHECKED);
+ Check6 = (IsDlgButtonChecked(hDlg, IDC_CHECKST6) == BST_CHECKED);
+ Check7 = (IsDlgButtonChecked(hDlg, IDC_CHECKST7) == BST_CHECKED);
+ Check8 = (IsDlgButtonChecked(hDlg, IDC_CHECKST8) == BST_CHECKED);
+ Check9 = (IsDlgButtonChecked(hDlg, IDC_CHECKST9) == BST_CHECKED);
+ WindowList_BroadcastAsync(YAMNVar.MessageWnds, WM_YAMN_CHANGESTATUSOPTION, 0, 0);
+ EndDialog(hDlg, 0);
DestroyWindow(hDlg);
break;
case IDCANCEL:
- EndDialog(hDlg,0);
+ EndDialog(hDlg, 0);
DestroyWindow(hDlg);
break;
}
@@ -632,905 +615,873 @@ INT_PTR CALLBACK DlgProcPOP3AccStatusOpt(HWND hDlg, UINT msg, WPARAM wParam, LPA return FALSE;
}
-INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL Changed=FALSE;
+ BOOL Changed = FALSE;
INT_PTR Result;
- static BOOL InList=FALSE;
+ static BOOL InList = FALSE;
static HPOP3ACCOUNT ActualAccount;
static UCHAR ActualStatus;
-// static struct CPOP3Options POP3Options;
+ // static struct CPOP3Options POP3Options;
- switch(msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
int i;
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
- DlgEnableAccount(hDlg,FALSE,FALSE);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
+ DlgEnableAccount(hDlg, FALSE, FALSE);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read wait\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read wait\n");
#endif
WaitToReadSO(POP3Plugin->AccountBrowserSO);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read enter\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read done\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read done\n");
#endif
ReadDoneSO(POP3Plugin->AccountBrowserSO);
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)TranslateT("Default"));
- for (i=1; i < CPLENSUPP; i++) {
- CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP,0,&info);
- size_t len = mir_tstrlen(info.CodePageName+7);
- info.CodePageName[len+6]=0;
- SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_ADDSTRING,0,(LPARAM)(info.CodePageName+7));
+ for (i = 1; i < CPLENSUPP; i++) {
+ CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP, 0, &info);
+ size_t len = mir_tstrlen(info.CodePageName + 7);
+ info.CodePageName[len + 6] = 0;
+ SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)(info.CodePageName + 7));
}
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- ActualAccount=NULL;
+ ActualAccount = NULL;
TranslateDialogDefault(hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
}
- case WM_SHOWWINDOW:
- if ( wParam == FALSE) {
- WindowList_Remove(pYAMNVar->MessageWnds,hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
- }
- else WindowList_Add(pYAMNVar->MessageWnds,hDlg,NULL);
- return TRUE;
+ case WM_SHOWWINDOW:
+ if (wParam == FALSE) {
+ WindowList_Remove(pYAMNVar->MessageWnds, hDlg);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
+ }
+ else WindowList_Add(pYAMNVar->MessageWnds, hDlg, NULL);
+ return TRUE;
- case WM_YAMN_CHANGESTATUS:
- if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR accstatus[256];
- GetAccountStatus(ActualAccount,accstatus);
- SetDlgItemText(hDlg,IDC_STSTATUS,accstatus);
- return TRUE;
- }
- break;
-
- case WM_YAMN_CHANGESTATUSOPTION:
- Changed=TRUE;
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
- return TRUE;
-
- case WM_YAMN_CHANGETIME:
- if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR Text[256];
- mir_sntprintf(Text,_countof(Text),TranslateT("Time left to next check [s]: %d"),(DWORD)lParam);
- SetDlgItemText(hDlg,IDC_STTIMELEFT,Text);
- }
+ case WM_YAMN_CHANGESTATUS:
+ if ((HPOP3ACCOUNT)wParam == ActualAccount) {
+ TCHAR accstatus[256];
+ GetAccountStatus(ActualAccount, accstatus);
+ SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
return TRUE;
+ }
+ break;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDC_COMBOACCOUNT:
- switch( HIWORD(wParam)) {
- case CBN_EDITCHANGE :
- ActualAccount=NULL;
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
-
- if (GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput)))
- DlgEnableAccount(hDlg,TRUE,FALSE);
- else
- DlgEnableAccount(hDlg,FALSE,FALSE);
- break;
+ case WM_YAMN_CHANGESTATUSOPTION:
+ Changed = TRUE;
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
- case CBN_KILLFOCUS:
- GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput));
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))) {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- if (mir_strlen(DlgInput))
- DlgEnableAccount(hDlg,TRUE,TRUE);
- else
- DlgEnableAccount(hDlg,FALSE,FALSE);
- }
- else {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgEnableAccount(hDlg,TRUE,TRUE);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),TRUE);
- }
- break;
+ case WM_YAMN_CHANGETIME:
+ if ((HPOP3ACCOUNT)wParam == ActualAccount) {
+ TCHAR Text[256];
+ mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
+ SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
+ }
+ return TRUE;
- case CBN_SELCHANGE:
- if (CB_ERR != (Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_GETLBTEXT,(WPARAM)Result,(LPARAM)DlgInput);
-
- if ((Result==CB_ERR) || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput)))) {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- }
- else {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgEnableAccount(hDlg,TRUE,FALSE);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),TRUE);
- }
- break;
- }
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_COMBOACCOUNT:
+ switch (HIWORD(wParam)) {
+ case CBN_EDITCHANGE:
+ ActualAccount = NULL;
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+
+ if (GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput)))
+ DlgEnableAccount(hDlg, TRUE, FALSE);
+ else
+ DlgEnableAccount(hDlg, FALSE, FALSE);
break;
- case IDC_COMBOCP:
- {
- int sel = SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_GETCURSEL,0,0);
- CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP,0,&info);
- DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ case CBN_KILLFOCUS:
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ if (mir_strlen(DlgInput))
+ DlgEnableAccount(hDlg, TRUE, TRUE);
+ else
+ DlgEnableAccount(hDlg, FALSE, FALSE);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgEnableAccount(hDlg, TRUE, TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
}
- case IDC_CHECK:
- case IDC_CHECKSND:
- case IDC_CHECKMSG:
- case IDC_CHECKICO:
- case IDC_CHECKFSND:
- case IDC_CHECKFMSG:
- case IDC_CHECKFICO:
- case IDC_CHECKST0:
- case IDC_CHECKST1:
- case IDC_CHECKST2:
- case IDC_CHECKST3:
- case IDC_CHECKST4:
- case IDC_CHECKST5:
- case IDC_CHECKST6:
- case IDC_CHECKST7:
- case IDC_CHECKST8:
- case IDC_CHECKST9:
- case IDC_CHECKSTART:
- case IDC_CHECKFORCE:
- case IDC_EDITAPPPARAM:
- case IDC_CHECKAPOP:
- case IDC_AUTOBODY:
- case IDC_CHECKCONTACTNICK:
- case IDC_CHECKCONTACTNOEVENT:
- case IDC_CHECKNOTLS:
- Changed=TRUE;
break;
- case IDC_CHECKCONTACT:
- Changed=IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNICK),Changed);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNOEVENT),Changed);
- Changed=TRUE;
- break;
+ case CBN_SELCHANGE:
+ if (CB_ERR != (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_GETLBTEXT, (WPARAM)Result, (LPARAM)DlgInput);
- case IDC_CHECKSSL:
- {
- BOOL SSLC = (IsDlgButtonChecked(hDlg,IDC_CHECKSSL)==BST_CHECKED);
- SetDlgItemInt(hDlg,IDC_EDITPORT,SSLC ? 995 : 110,FALSE);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNOTLS),SSLC?0:1);
+ if ((Result == CB_ERR) || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgEnableAccount(hDlg, TRUE, FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
}
- Changed=TRUE;
break;
+ }
+ break;
- case IDC_CPB:
- case IDC_CPT:
- case IDC_CPFB:
- case IDC_CPFT:
- case IDC_CPNB:
- case IDC_CPNT:
- if (HIWORD(wParam) != CPN_COLOURCHANGED)
- break;
+ case IDC_COMBOCP:
+ {
+ int sel = SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_GETCURSEL, 0, 0);
+ CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP, 0, &info);
+ DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ }
+ case IDC_CHECK:
+ case IDC_CHECKSND:
+ case IDC_CHECKMSG:
+ case IDC_CHECKICO:
+ case IDC_CHECKFSND:
+ case IDC_CHECKFMSG:
+ case IDC_CHECKFICO:
+ case IDC_CHECKST0:
+ case IDC_CHECKST1:
+ case IDC_CHECKST2:
+ case IDC_CHECKST3:
+ case IDC_CHECKST4:
+ case IDC_CHECKST5:
+ case IDC_CHECKST6:
+ case IDC_CHECKST7:
+ case IDC_CHECKST8:
+ case IDC_CHECKST9:
+ case IDC_CHECKSTART:
+ case IDC_CHECKFORCE:
+ case IDC_EDITAPPPARAM:
+ case IDC_CHECKAPOP:
+ case IDC_AUTOBODY:
+ case IDC_CHECKCONTACTNICK:
+ case IDC_CHECKCONTACTNOEVENT:
+ case IDC_CHECKNOTLS:
+ Changed = TRUE;
+ break;
- case IDC_CHECKKBN:
- Changed=TRUE;
- break;
+ case IDC_CHECKCONTACT:
+ Changed = IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNICK), Changed);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNOEVENT), Changed);
+ Changed = TRUE;
+ break;
- case IDC_CHECKAPP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_BTNAPP),IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPP),IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPPPARAM),IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- break;
+ case IDC_CHECKSSL:
+ {
+ BOOL SSLC = (IsDlgButtonChecked(hDlg, IDC_CHECKSSL) == BST_CHECKED);
+ SetDlgItemInt(hDlg, IDC_EDITPORT, SSLC ? 995 : 110, FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNOTLS), SSLC ? 0 : 1);
+ }
+ Changed = TRUE;
+ break;
- case IDC_BTNSTATUS:
- DialogBoxParamW(pYAMNVar->hInst,MAKEINTRESOURCEW(IDD_CHOOSESTATUSMODES),hDlg,DlgProcPOP3AccStatusOpt,NULL);
+ case IDC_CPB:
+ case IDC_CPT:
+ case IDC_CPFB:
+ case IDC_CPFT:
+ case IDC_CPNB:
+ case IDC_CPNT:
+ if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
- case IDC_BTNADD:
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- DlgEnableAccount(hDlg,TRUE,TRUE);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- DlgSetItemTextT(hDlg, IDC_EDITNAME, TranslateT("New Account"));
- {
- int index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)TranslateT("New Account"));
- if ( index != CB_ERR && index != CB_ERRSPACE )
- SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, index, (LPARAM)TranslateT("New Account"));
- }
- break;
-
- case IDC_BTNAPP:
- {
- TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c"),
- TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
-
- OPENFILENAME OFNStruct = { 0 };
- OFNStruct.lStructSize = sizeof(OPENFILENAME);
- OFNStruct.hwndOwner = hDlg;
- OFNStruct.lpstrFilter= filter;
- OFNStruct.nFilterIndex=1;
- OFNStruct.nMaxFile=MAX_PATH;
- OFNStruct.lpstrFile=new TCHAR[MAX_PATH];
- OFNStruct.lpstrFile[0]=(TCHAR)0;
- OFNStruct.lpstrTitle=TranslateT("Select executable used for notification");
- OFNStruct.Flags=OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
- if (!GetOpenFileName(&OFNStruct))
- {
- if (CommDlgExtendedError())
- MessageBox(hDlg, TranslateT("Dialog box error"), TranslateT("Failed"), MB_OK);
- }
- else DlgSetItemTextT(hDlg, IDC_EDITAPP, OFNStruct.lpstrFile);
- delete[] OFNStruct.lpstrFile;
- }
- break;
+ case IDC_CHECKKBN:
+ Changed = TRUE;
+ break;
- case IDC_BTNDEFAULT:
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- break;
+ case IDC_CHECKAPP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNAPP), IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPP), IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPPPARAM), IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ break;
- case IDC_BTNDEL:
- GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput));
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- if ((CB_ERR==(Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
- || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))))
- return TRUE;
+ case IDC_BTNSTATUS:
+ DialogBoxParamW(pYAMNVar->hInst, MAKEINTRESOURCEW(IDD_CHOOSESTATUSMODES), hDlg, DlgProcPOP3AccStatusOpt, NULL);
+ break;
- if (IDOK != MessageBox(hDlg,TranslateT("Do you really want to delete this account?"),TranslateT("Delete account confirmation"),MB_OKCANCEL | MB_ICONWARNING))
- return TRUE;
+ case IDC_BTNADD:
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
+ DlgEnableAccount(hDlg, TRUE, TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ DlgSetItemTextT(hDlg, IDC_EDITNAME, TranslateT("New Account"));
+ {
+ int index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)TranslateT("New Account"));
+ if (index != CB_ERR && index != CB_ERRSPACE)
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, index, (LPARAM)TranslateT("New Account"));
+ }
+ break;
- DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+ case IDC_BTNAPP:
+ {
+ TCHAR filter[MAX_PATH];
+ mir_sntprintf(filter, _T("%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c"),
+ TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
+
+ OPENFILENAME OFNStruct = { 0 };
+ OFNStruct.lStructSize = sizeof(OPENFILENAME);
+ OFNStruct.hwndOwner = hDlg;
+ OFNStruct.lpstrFilter = filter;
+ OFNStruct.nFilterIndex = 1;
+ OFNStruct.nMaxFile = MAX_PATH;
+ OFNStruct.lpstrFile = new TCHAR[MAX_PATH];
+ OFNStruct.lpstrFile[0] = (TCHAR)0;
+ OFNStruct.lpstrTitle = TranslateT("Select executable used for notification");
+ OFNStruct.Flags = OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
+ if (!GetOpenFileName(&OFNStruct)) {
+ if (CommDlgExtendedError())
+ MessageBox(hDlg, TranslateT("Dialog box error"), TranslateT("Failed"), MB_OK);
+ }
+ else DlgSetItemTextT(hDlg, IDC_EDITAPP, OFNStruct.lpstrFile);
+ delete[] OFNStruct.lpstrFile;
+ }
+ break;
- if (ActualAccount->hContact != NULL)
- CallService(MS_DB_CONTACT_DELETE, ActualAccount->hContact, 0);
+ case IDC_BTNDEFAULT:
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
+ break;
- CallService(MS_YAMN_DELETEACCOUNT,(WPARAM)POP3Plugin,(LPARAM)ActualAccount);
-
- //We can consider our account as deleted.
+ case IDC_BTNDEL:
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ if ((CB_ERR == (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
+ || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))))
+ return TRUE;
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_DELETESTRING,(WPARAM)Result,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_COMBOACCOUNT,0);
- DlgEnableAccount(hDlg,FALSE,0);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- break;
+ if (IDOK != MessageBox(hDlg, TranslateT("Do you really want to delete this account?"), TranslateT("Delete account confirmation"), MB_OKCANCEL | MB_ICONWARNING))
+ return TRUE;
- case IDC_BTNRESET:
- if (ActualAccount != NULL)
- ActualAccount->TimeLeft=ActualAccount->Interval;
- return 1;
- }
+ DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
- if (HIWORD(wParam) == EN_CHANGE)
- Changed = TRUE;
+ if (ActualAccount->hContact != NULL)
+ CallService(MS_DB_CONTACT_DELETE, ActualAccount->hContact, 0);
+
+ CallService(MS_YAMN_DELETEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)ActualAccount);
+
+ //We can consider our account as deleted.
+
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_DELETESTRING, (WPARAM)Result, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_COMBOACCOUNT, 0);
+ DlgEnableAccount(hDlg, FALSE, 0);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
break;
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY ) {
- char Text[MAX_PATH];
- WCHAR TextW[MAX_PATH];
- BOOL Translated,NewAcc=FALSE,Check,CheckMsg,CheckSnd,CheckIco,CheckApp, CheckAPOP;
- BOOL CheckNMsgP,CheckFMsg,CheckFSnd,CheckFIco;
- BOOL CheckKBN, CheckContact,CheckContactNick,CheckContactNoEvent;
- BOOL CheckSSL, CheckABody, CheckNoTLS;
- //BOOL Check0,Check1,Check2,Check3,Check4,Check5,Check6,Check7,Check8,Check9,
- BOOL CheckStart,CheckForce;
- size_t Length,index;
- UINT Port,Interval;
-
- if ( GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT, Text, _countof(Text))) {
- Check = (IsDlgButtonChecked(hDlg,IDC_CHECK)==BST_CHECKED);
- CheckSSL = (IsDlgButtonChecked(hDlg,IDC_CHECKSSL)==BST_CHECKED);
- CheckNoTLS = (IsDlgButtonChecked(hDlg,IDC_CHECKNOTLS)==BST_CHECKED);
- CheckAPOP = (IsDlgButtonChecked(hDlg,IDC_CHECKAPOP)==BST_CHECKED);
-
- CheckABody = (IsDlgButtonChecked(hDlg,IDC_AUTOBODY)==BST_CHECKED);
- CheckMsg = (IsDlgButtonChecked(hDlg,IDC_CHECKMSG)==BST_CHECKED);
- CheckSnd = (IsDlgButtonChecked(hDlg,IDC_CHECKSND)==BST_CHECKED);
- CheckIco = (IsDlgButtonChecked(hDlg,IDC_CHECKICO)==BST_CHECKED);
-
- CheckApp = (IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- CheckKBN = (IsDlgButtonChecked(hDlg,IDC_CHECKKBN)==BST_CHECKED);
- CheckContact = (IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED);
- CheckContactNick = (IsDlgButtonChecked(hDlg,IDC_CHECKCONTACTNICK)==BST_CHECKED);
- CheckContactNoEvent = (IsDlgButtonChecked(hDlg,IDC_CHECKCONTACTNOEVENT)==BST_CHECKED);
-
- CheckFSnd = (IsDlgButtonChecked(hDlg,IDC_CHECKFSND)==BST_CHECKED);
- CheckFMsg = (IsDlgButtonChecked(hDlg,IDC_CHECKFMSG)==BST_CHECKED);
- CheckFIco = (IsDlgButtonChecked(hDlg,IDC_CHECKFICO)==BST_CHECKED);
-
- CheckNMsgP = (IsDlgButtonChecked(hDlg,IDC_CHECKNMSGP)==BST_CHECKED);
-
- Port = GetDlgItemInt(hDlg, IDC_EDITPORT, &Translated, FALSE);
- if ( !Translated ) {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITPORT));
- break;
- }
- Interval = GetDlgItemInt(hDlg,IDC_EDITINTERVAL,&Translated,FALSE);
- if ( !Translated ) {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITINTERVAL));
- break;
- }
+ case IDC_BTNRESET:
+ if (ActualAccount != NULL)
+ ActualAccount->TimeLeft = ActualAccount->Interval;
+ return 1;
+ }
- GetDlgItemTextA(hDlg, IDC_EDITAPP, Text, _countof(Text));
- if (CheckApp && !(Length = mir_strlen(Text))) {
- MessageBox(hDlg,TranslateT("Please select application to run"),TranslateT("Input error"),MB_OK);
- break;
- }
+ if (HIWORD(wParam) == EN_CHANGE)
+ Changed = TRUE;
+ break;
- GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text));
- if ( !( Length = mir_strlen(Text))) {
- GetDlgItemTextA(hDlg,IDC_EDITNAME, Text, _countof(Text));
- if ( !(Length = mir_strlen( Text )))
- break;
- }
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
+ char Text[MAX_PATH];
+ WCHAR TextW[MAX_PATH];
+ BOOL Translated, NewAcc = FALSE, Check, CheckMsg, CheckSnd, CheckIco, CheckApp, CheckAPOP;
+ BOOL CheckNMsgP, CheckFMsg, CheckFSnd, CheckFIco;
+ BOOL CheckKBN, CheckContact, CheckContactNick, CheckContactNoEvent;
+ BOOL CheckSSL, CheckABody, CheckNoTLS;
+ //BOOL Check0,Check1,Check2,Check3,Check4,Check5,Check6,Check7,Check8,Check9,
+ BOOL CheckStart, CheckForce;
+ size_t Length, index;
+ UINT Port, Interval;
+
+ if (GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text))) {
+ Check = (IsDlgButtonChecked(hDlg, IDC_CHECK) == BST_CHECKED);
+ CheckSSL = (IsDlgButtonChecked(hDlg, IDC_CHECKSSL) == BST_CHECKED);
+ CheckNoTLS = (IsDlgButtonChecked(hDlg, IDC_CHECKNOTLS) == BST_CHECKED);
+ CheckAPOP = (IsDlgButtonChecked(hDlg, IDC_CHECKAPOP) == BST_CHECKED);
+
+ CheckABody = (IsDlgButtonChecked(hDlg, IDC_AUTOBODY) == BST_CHECKED);
+ CheckMsg = (IsDlgButtonChecked(hDlg, IDC_CHECKMSG) == BST_CHECKED);
+ CheckSnd = (IsDlgButtonChecked(hDlg, IDC_CHECKSND) == BST_CHECKED);
+ CheckIco = (IsDlgButtonChecked(hDlg, IDC_CHECKICO) == BST_CHECKED);
+
+ CheckApp = (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ CheckKBN = (IsDlgButtonChecked(hDlg, IDC_CHECKKBN) == BST_CHECKED);
+ CheckContact = (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED);
+ CheckContactNick = (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACTNICK) == BST_CHECKED);
+ CheckContactNoEvent = (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACTNOEVENT) == BST_CHECKED);
+
+ CheckFSnd = (IsDlgButtonChecked(hDlg, IDC_CHECKFSND) == BST_CHECKED);
+ CheckFMsg = (IsDlgButtonChecked(hDlg, IDC_CHECKFMSG) == BST_CHECKED);
+ CheckFIco = (IsDlgButtonChecked(hDlg, IDC_CHECKFICO) == BST_CHECKED);
+
+ CheckNMsgP = (IsDlgButtonChecked(hDlg, IDC_CHECKNMSGP) == BST_CHECKED);
+
+ Port = GetDlgItemInt(hDlg, IDC_EDITPORT, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITPORT));
+ break;
+ }
+ Interval = GetDlgItemInt(hDlg, IDC_EDITINTERVAL, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITINTERVAL));
+ break;
+ }
- DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+ GetDlgItemTextA(hDlg, IDC_EDITAPP, Text, _countof(Text));
+ if (CheckApp && !(Length = mir_strlen(Text))) {
+ MessageBox(hDlg, TranslateT("Please select application to run"), TranslateT("Input error"), MB_OK);
+ break;
+ }
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)Text))) {
- NewAcc=TRUE;
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write wait\n");
- #endif
- WaitToWriteSO(POP3Plugin->AccountBrowserSO);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write enter\n");
- #endif
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT,(WPARAM)POP3Plugin,(LPARAM)YAMN_ACCOUNTVERSION))) {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write done\n");
- #endif
- WriteDoneSO(POP3Plugin->AccountBrowserSO);
- MessageBox(hDlg,TranslateT("Cannot allocate memory space for new account"),TranslateT("Memory error"),MB_OK);
- break;
- }
- }
- else {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write wait\n");
- #endif
- //We have to get full access to AccountBrowser, so other iterating thrads cannot get new account until new account is right set
- WaitToWriteSO(POP3Plugin->AccountBrowserSO);
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text));
+ if (!(Length = mir_strlen(Text))) {
+ GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
+ if (!(Length = mir_strlen(Text)))
+ break;
+ }
+
+ DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)Text))) {
+ NewAcc = TRUE;
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write wait\n");
+ #endif
+ WaitToWriteSO(POP3Plugin->AccountBrowserSO);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write enter\n");
+ #endif
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)YAMN_ACCOUNTVERSION))) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write enter\n");
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
#endif
- }
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write wait\n");
- #endif
- if (WAIT_OBJECT_0 != WaitToWrite(ActualAccount))
- {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write wait failed\n");
- #endif
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualBrowserSO-write done\n");
- #endif
WriteDoneSO(POP3Plugin->AccountBrowserSO);
-
+ MessageBox(hDlg, TranslateT("Cannot allocate memory space for new account"), TranslateT("Memory error"), MB_OK);
+ break;
}
+ }
+ else {
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write wait\n");
+ #endif
+ //We have to get full access to AccountBrowser, so other iterating thrads cannot get new account until new account is right set
+ WaitToWriteSO(POP3Plugin->AccountBrowserSO);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write enter\n");
+ #endif
+ }
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write wait\n");
+ #endif
+ if (WAIT_OBJECT_0 != WaitToWrite(ActualAccount)) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write enter\n");
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write wait failed\n");
#endif
-
- GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
- if ( !(Length = mir_strlen( Text )))
- break;
- if (NULL != ActualAccount->Name)
- delete[] ActualAccount->Name;
- ActualAccount->Name = new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Name,Text);
-
- GetDlgItemTextA(hDlg,IDC_EDITSERVER,Text,_countof(Text));
- if (NULL != ActualAccount->Server->Name)
- delete[] ActualAccount->Server->Name;
- ActualAccount->Server->Name=new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Server->Name,Text);
-
- GetDlgItemTextA(hDlg,IDC_EDITLOGIN,Text,_countof(Text));
- if (NULL != ActualAccount->Server->Login)
- delete[] ActualAccount->Server->Login;
- ActualAccount->Server->Login=new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Server->Login,Text);
-
- GetDlgItemTextA(hDlg,IDC_EDITPASS,Text,_countof(Text));
- if (NULL != ActualAccount->Server->Passwd)
- delete[] ActualAccount->Server->Passwd;
- ActualAccount->Server->Passwd=new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Server->Passwd,Text);
-
- GetDlgItemTextW(hDlg,IDC_EDITAPP,TextW,_countof(TextW));
- if (NULL != ActualAccount->NewMailN.App)
- delete[] ActualAccount->NewMailN.App;
- ActualAccount->NewMailN.App=new WCHAR[mir_wstrlen(TextW)+1];
- mir_wstrcpy(ActualAccount->NewMailN.App,TextW);
-
- GetDlgItemTextW(hDlg,IDC_EDITAPPPARAM,TextW,_countof(TextW));
- if (NULL != ActualAccount->NewMailN.AppParam)
- delete[] ActualAccount->NewMailN.AppParam;
- ActualAccount->NewMailN.AppParam=new WCHAR[mir_wstrlen(TextW)+1];
- mir_wstrcpy(ActualAccount->NewMailN.AppParam,TextW);
-
- ActualAccount->Server->Port=Port;
- ActualAccount->Interval=Interval*60;
-
- if (CB_ERR==(index=SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_GETCURSEL,0,0)))
- index = CPDEFINDEX;
- ActualAccount->CP = CodePageNamesSupp[index].CP;
-
- if (NewAcc)
- ActualAccount->TimeLeft=Interval*60;
-
- CheckStart = (IsDlgButtonChecked(hDlg,IDC_CHECKSTART)==BST_CHECKED);
- CheckForce = (IsDlgButtonChecked(hDlg,IDC_CHECKFORCE)==BST_CHECKED);
-
- ActualAccount->Flags=
- (Check ? YAMN_ACC_ENA : 0) |
- (CheckSSL ? YAMN_ACC_SSL23 : 0) |
- (CheckNoTLS ? YAMN_ACC_NOTLS : 0) |
- (CheckAPOP ? YAMN_ACC_APOP : 0) |
- (CheckABody ? YAMN_ACC_BODY : 0) |
- (ActualAccount->Flags & YAMN_ACC_POPN);
-
- ActualAccount->StatusFlags=
- (Check0 ? YAMN_ACC_ST0 : 0) |
- (Check1 ? YAMN_ACC_ST1 : 0) |
- (Check2 ? YAMN_ACC_ST2 : 0) |
- (Check3 ? YAMN_ACC_ST3 : 0) |
- (Check4 ? YAMN_ACC_ST4 : 0) |
- (Check5 ? YAMN_ACC_ST5 : 0) |
- (Check6 ? YAMN_ACC_ST6 : 0) |
- (Check7 ? YAMN_ACC_ST7 : 0) |
- (Check8 ? YAMN_ACC_ST8 : 0) |
- (Check9 ? YAMN_ACC_ST9 : 0) |
- (CheckStart ? YAMN_ACC_STARTS : 0) |
- (CheckForce ? YAMN_ACC_FORCE : 0);
-
- ActualAccount->NewMailN.Flags=
- (CheckSnd ? YAMN_ACC_SND : 0) |
- (CheckMsg ? YAMN_ACC_MSG : 0) |
- (CheckIco ? YAMN_ACC_ICO : 0) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_POP) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC) |
- (CheckApp ? YAMN_ACC_APP : 0) |
- (CheckKBN ? YAMN_ACC_KBN : 0) |
- (CheckContact ? YAMN_ACC_CONT : 0) |
- (CheckContactNick ? YAMN_ACC_CONTNICK : 0) |
- (CheckContactNoEvent ? YAMN_ACC_CONTNOEVENT : 0) |
- YAMN_ACC_MSGP; //this is default: when new mail arrives and window was displayed, leave it displayed.
-
- ActualAccount->NoNewMailN.Flags=
- (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP) |
- (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC) |
- (CheckNMsgP ? YAMN_ACC_MSGP : 0);
-
- ActualAccount->BadConnectN.Flags=
- (CheckFSnd ? YAMN_ACC_SND : 0) |
- (CheckFMsg ? YAMN_ACC_MSG : 0) |
- (CheckFIco ? YAMN_ACC_ICO : 0) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_POP) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC);
-
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write done\n");
+ DebugLog(SynchroFile, "Options:APPLY:ActualBrowserSO-write done\n");
#endif
- WriteDone(ActualAccount);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write done\n");
- #endif
WriteDoneSO(POP3Plugin->AccountBrowserSO);
-
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),TRUE);
-
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
-
- index = SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0);
-
- HPOP3ACCOUNT temp = ActualAccount;
-
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_RESETCONTENT,0,0);
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
-
- ActualAccount = temp;
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_SETCURSEL,(WPARAM)index,(LPARAM)ActualAccount->Name);
-
- WritePOP3Accounts();
- RefreshContact();
- return TRUE;
+
}
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write enter\n");
+ #endif
+
+ GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
+ if (!(Length = mir_strlen(Text)))
+ break;
+ if (NULL != ActualAccount->Name)
+ delete[] ActualAccount->Name;
+ ActualAccount->Name = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Name, Text);
+
+ GetDlgItemTextA(hDlg, IDC_EDITSERVER, Text, _countof(Text));
+ if (NULL != ActualAccount->Server->Name)
+ delete[] ActualAccount->Server->Name;
+ ActualAccount->Server->Name = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Server->Name, Text);
+
+ GetDlgItemTextA(hDlg, IDC_EDITLOGIN, Text, _countof(Text));
+ if (NULL != ActualAccount->Server->Login)
+ delete[] ActualAccount->Server->Login;
+ ActualAccount->Server->Login = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Server->Login, Text);
+
+ GetDlgItemTextA(hDlg, IDC_EDITPASS, Text, _countof(Text));
+ if (NULL != ActualAccount->Server->Passwd)
+ delete[] ActualAccount->Server->Passwd;
+ ActualAccount->Server->Passwd = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Server->Passwd, Text);
+
+ GetDlgItemTextW(hDlg, IDC_EDITAPP, TextW, _countof(TextW));
+ if (NULL != ActualAccount->NewMailN.App)
+ delete[] ActualAccount->NewMailN.App;
+ ActualAccount->NewMailN.App = new WCHAR[mir_wstrlen(TextW) + 1];
+ mir_wstrcpy(ActualAccount->NewMailN.App, TextW);
+
+ GetDlgItemTextW(hDlg, IDC_EDITAPPPARAM, TextW, _countof(TextW));
+ if (NULL != ActualAccount->NewMailN.AppParam)
+ delete[] ActualAccount->NewMailN.AppParam;
+ ActualAccount->NewMailN.AppParam = new WCHAR[mir_wstrlen(TextW) + 1];
+ mir_wstrcpy(ActualAccount->NewMailN.AppParam, TextW);
+
+ ActualAccount->Server->Port = Port;
+ ActualAccount->Interval = Interval * 60;
+
+ if (CB_ERR == (index = SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_GETCURSEL, 0, 0)))
+ index = CPDEFINDEX;
+ ActualAccount->CP = CodePageNamesSupp[index].CP;
+
+ if (NewAcc)
+ ActualAccount->TimeLeft = Interval * 60;
+
+ CheckStart = (IsDlgButtonChecked(hDlg, IDC_CHECKSTART) == BST_CHECKED);
+ CheckForce = (IsDlgButtonChecked(hDlg, IDC_CHECKFORCE) == BST_CHECKED);
+
+ ActualAccount->Flags =
+ (Check ? YAMN_ACC_ENA : 0) |
+ (CheckSSL ? YAMN_ACC_SSL23 : 0) |
+ (CheckNoTLS ? YAMN_ACC_NOTLS : 0) |
+ (CheckAPOP ? YAMN_ACC_APOP : 0) |
+ (CheckABody ? YAMN_ACC_BODY : 0) |
+ (ActualAccount->Flags & YAMN_ACC_POPN);
+
+ ActualAccount->StatusFlags =
+ (Check0 ? YAMN_ACC_ST0 : 0) |
+ (Check1 ? YAMN_ACC_ST1 : 0) |
+ (Check2 ? YAMN_ACC_ST2 : 0) |
+ (Check3 ? YAMN_ACC_ST3 : 0) |
+ (Check4 ? YAMN_ACC_ST4 : 0) |
+ (Check5 ? YAMN_ACC_ST5 : 0) |
+ (Check6 ? YAMN_ACC_ST6 : 0) |
+ (Check7 ? YAMN_ACC_ST7 : 0) |
+ (Check8 ? YAMN_ACC_ST8 : 0) |
+ (Check9 ? YAMN_ACC_ST9 : 0) |
+ (CheckStart ? YAMN_ACC_STARTS : 0) |
+ (CheckForce ? YAMN_ACC_FORCE : 0);
+
+ ActualAccount->NewMailN.Flags =
+ (CheckSnd ? YAMN_ACC_SND : 0) |
+ (CheckMsg ? YAMN_ACC_MSG : 0) |
+ (CheckIco ? YAMN_ACC_ICO : 0) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_POP) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC) |
+ (CheckApp ? YAMN_ACC_APP : 0) |
+ (CheckKBN ? YAMN_ACC_KBN : 0) |
+ (CheckContact ? YAMN_ACC_CONT : 0) |
+ (CheckContactNick ? YAMN_ACC_CONTNICK : 0) |
+ (CheckContactNoEvent ? YAMN_ACC_CONTNOEVENT : 0) |
+ YAMN_ACC_MSGP; //this is default: when new mail arrives and window was displayed, leave it displayed.
+
+ ActualAccount->NoNewMailN.Flags =
+ (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP) |
+ (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC) |
+ (CheckNMsgP ? YAMN_ACC_MSGP : 0);
+
+ ActualAccount->BadConnectN.Flags =
+ (CheckFSnd ? YAMN_ACC_SND : 0) |
+ (CheckFMsg ? YAMN_ACC_MSG : 0) |
+ (CheckFIco ? YAMN_ACC_ICO : 0) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_POP) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC);
+
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write done\n");
+ #endif
+ WriteDone(ActualAccount);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
+ #endif
+ WriteDoneSO(POP3Plugin->AccountBrowserSO);
+
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
+
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+
+ index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0);
+
+ HPOP3ACCOUNT temp = ActualAccount;
+
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_RESETCONTENT, 0, 0);
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
+
+ ActualAccount = temp;
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, (WPARAM)index, (LPARAM)ActualAccount->Name);
+
+ WritePOP3Accounts();
+ RefreshContact();
+ return TRUE;
}
- break;
+ }
+ break;
}
if (Changed)
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
return FALSE;
}
-INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL Changed=FALSE;
- static BOOL InList=FALSE;
+ BOOL Changed = FALSE;
+ static BOOL InList = FALSE;
static HPOP3ACCOUNT ActualAccount;
static UCHAR ActualStatus;
-// static struct CPOP3Options POP3Options;
+ // static struct CPOP3Options POP3Options;
- switch(msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
- DlgEnableAccountPopup(hDlg,FALSE,FALSE);
- DlgShowAccountPopup(hDlg,(WPARAM)M_SHOWDEFAULT,0);
+ DlgEnableAccountPopup(hDlg, FALSE, FALSE);
+ DlgShowAccountPopup(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
//DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read wait\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read wait\n");
#endif
WaitToReadSO(POP3Plugin->AccountBrowserSO);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read enter\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read done\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read done\n");
#endif
ReadDoneSO(POP3Plugin->AccountBrowserSO);
- ActualAccount=NULL;
+ ActualAccount = NULL;
+
-
TranslateDialogDefault(hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
}
- case WM_SHOWWINDOW:
- if ((BOOL)wParam==FALSE)
- {
- WindowList_Remove(pYAMNVar->MessageWnds,hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
- }
- else
- {
- WindowList_Add(pYAMNVar->MessageWnds,hDlg,NULL);
+ case WM_SHOWWINDOW:
+ if ((BOOL)wParam == FALSE) {
+ WindowList_Remove(pYAMNVar->MessageWnds, hDlg);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
+ }
+ else {
+ WindowList_Add(pYAMNVar->MessageWnds, hDlg, NULL);
- int index = SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0);
- HPOP3ACCOUNT temp = ActualAccount;
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_RESETCONTENT,0,0);
+ int index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0);
+ HPOP3ACCOUNT temp = ActualAccount;
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_RESETCONTENT, 0, 0);
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
-
- ActualAccount = temp;
-
- if (ActualAccount != NULL)
- {
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_SETCURSEL,(WPARAM)index,(LPARAM)ActualAccount->Name);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
- DlgEnableAccountPopup(hDlg,TRUE,FALSE);
- }
- else
- {
- DlgShowAccountPopup(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- DlgEnableAccountPopup(hDlg,FALSE,FALSE);
- }
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
+
+ ActualAccount = temp;
+ if (ActualAccount != NULL) {
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, (WPARAM)index, (LPARAM)ActualAccount->Name);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
+ DlgEnableAccountPopup(hDlg, TRUE, FALSE);
}
- return TRUE;
-
- case WM_COMMAND:
+ else {
+ DlgShowAccountPopup(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
+ DlgEnableAccountPopup(hDlg, FALSE, FALSE);
+ }
+
+ }
+ return TRUE;
+
+ case WM_COMMAND:
{
WORD wNotifyCode = HIWORD(wParam);
- switch(LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
LONG Result;
- case IDC_COMBOACCOUNT:
- switch(wNotifyCode)
- {
-
- case CBN_KILLFOCUS:
- GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput));
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput)))
- {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- if (mir_strlen(DlgInput))
- DlgEnableAccountPopup(hDlg,TRUE,TRUE);
- else
- DlgEnableAccountPopup(hDlg,FALSE,FALSE);
- }
- else
- {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
- DlgEnableAccountPopup(hDlg,TRUE,TRUE);
- }
- break;
- case CBN_SELCHANGE:
- if (CB_ERR != (Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_GETLBTEXT,(WPARAM)Result,(LPARAM)DlgInput);
- if ((Result==CB_ERR) || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))))
- {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- }
- else
- {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
- DlgEnableAccountPopup(hDlg,TRUE,FALSE);
- }
- break;
+ case IDC_COMBOACCOUNT:
+ switch (wNotifyCode) {
+
+ case CBN_KILLFOCUS:
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ if (mir_strlen(DlgInput))
+ DlgEnableAccountPopup(hDlg, TRUE, TRUE);
+ else
+ DlgEnableAccountPopup(hDlg, FALSE, FALSE);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
+ DlgEnableAccountPopup(hDlg, TRUE, TRUE);
}
break;
- case IDC_COMBOCP:
- {
- int sel = SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_GETCURSEL,0,0);
- CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP,0,&info);
- DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ case CBN_SELCHANGE:
+ if (CB_ERR != (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_GETLBTEXT, (WPARAM)Result, (LPARAM)DlgInput);
+ if ((Result == CB_ERR) || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
+ DlgEnableAccountPopup(hDlg, TRUE, FALSE);
}
- case IDC_RADIOPOPN:
- case IDC_RADIOPOP1:
- Changed=TRUE;
break;
- case IDC_CPB:
- case IDC_CPT:
- case IDC_CPFB:
- case IDC_CPFT:
- case IDC_CPNB:
- case IDC_CPNT:
- if (HIWORD(wParam) != CPN_COLOURCHANGED)
- break;
- case IDC_CHECKCOL:
- case IDC_CHECKFCOL:
- case IDC_CHECKNCOL:
- EnableWindow(GetDlgItem(hDlg,IDC_CPB),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPT),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNB),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNT),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFB),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFT),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- Changed=TRUE;
+ }
+ break;
+ case IDC_COMBOCP:
+ {
+ int sel = SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_GETCURSEL, 0, 0);
+ CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP, 0, &info);
+ DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ }
+ case IDC_RADIOPOPN:
+ case IDC_RADIOPOP1:
+ Changed = TRUE;
+ break;
+ case IDC_CPB:
+ case IDC_CPT:
+ case IDC_CPFB:
+ case IDC_CPFT:
+ case IDC_CPNB:
+ case IDC_CPNT:
+ if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
-
- case IDC_PREVIEW:
+ case IDC_CHECKCOL:
+ case IDC_CHECKFCOL:
+ case IDC_CHECKNCOL:
+ EnableWindow(GetDlgItem(hDlg, IDC_CPB), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPT), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNB), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNT), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFB), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFT), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ Changed = TRUE;
+ break;
+
+ case IDC_PREVIEW:
{
POPUPDATAT Tester;
POPUPDATAT TesterF;
POPUPDATAT TesterN;
- BOOL TesterC = (IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED);
- BOOL TesterFC = (IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED);
- BOOL TesterNC = (IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED);
-
+ BOOL TesterC = (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED);
+ BOOL TesterFC = (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED);
+ BOOL TesterNC = (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED);
+
memset(&Tester, 0, sizeof(Tester));
memset(&TesterF, 0, sizeof(TesterF));
memset(&TesterN, 0, sizeof(TesterN));
- Tester.lchIcon=g_LoadIconEx(2);
- TesterF.lchIcon=g_LoadIconEx(3);
- TesterN.lchIcon=g_LoadIconEx(1);
-
- mir_tstrncpy(Tester.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
- mir_tstrncpy(TesterF.lptzContactName,TranslateT("Account Test (failed)"),MAX_CONTACTNAME);
- mir_tstrncpy(TesterN.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
- mir_tstrncpy(Tester.lptzText,TranslateT("You have N new mail messages"),MAX_SECONDLINE);
- mir_tstrncpy(TesterF.lptzText,TranslateT("Connection failed message"),MAX_SECONDLINE);
- mir_tstrncpy(TesterN.lptzText,TranslateT("No new mail message"),MAX_SECONDLINE);
- if (TesterC)
- {
- Tester.colorBack=SendDlgItemMessage(hDlg,IDC_CPB,CPM_GETCOLOUR,0,0);
- Tester.colorText=SendDlgItemMessage(hDlg,IDC_CPT,CPM_GETCOLOUR,0,0);
+ Tester.lchIcon = g_LoadIconEx(2);
+ TesterF.lchIcon = g_LoadIconEx(3);
+ TesterN.lchIcon = g_LoadIconEx(1);
+
+ mir_tstrncpy(Tester.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_tstrncpy(TesterF.lptzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
+ mir_tstrncpy(TesterN.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_tstrncpy(Tester.lptzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
+ mir_tstrncpy(TesterF.lptzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
+ mir_tstrncpy(TesterN.lptzText, TranslateT("No new mail message"), MAX_SECONDLINE);
+ if (TesterC) {
+ Tester.colorBack = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
+ Tester.colorText = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
}
- else
- {
- Tester.colorBack=GetSysColor(COLOR_BTNFACE);
- Tester.colorText=GetSysColor(COLOR_WINDOWTEXT);
+ else {
+ Tester.colorBack = GetSysColor(COLOR_BTNFACE);
+ Tester.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if (TesterFC)
- {
- TesterF.colorBack=SendDlgItemMessage(hDlg,IDC_CPFB,CPM_GETCOLOUR,0,0);
- TesterF.colorText=SendDlgItemMessage(hDlg,IDC_CPFT,CPM_GETCOLOUR,0,0);
+ if (TesterFC) {
+ TesterF.colorBack = SendDlgItemMessage(hDlg, IDC_CPFB, CPM_GETCOLOUR, 0, 0);
+ TesterF.colorText = SendDlgItemMessage(hDlg, IDC_CPFT, CPM_GETCOLOUR, 0, 0);
}
- else
- {
- TesterF.colorBack=GetSysColor(COLOR_BTNFACE);
- TesterF.colorText=GetSysColor(COLOR_WINDOWTEXT);
+ else {
+ TesterF.colorBack = GetSysColor(COLOR_BTNFACE);
+ TesterF.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if (TesterNC)
- {
- TesterN.colorBack=SendDlgItemMessage(hDlg,IDC_CPNB,CPM_GETCOLOUR,0,0);
- TesterN.colorText=SendDlgItemMessage(hDlg,IDC_CPNT,CPM_GETCOLOUR,0,0);
+ if (TesterNC) {
+ TesterN.colorBack = SendDlgItemMessage(hDlg, IDC_CPNB, CPM_GETCOLOUR, 0, 0);
+ TesterN.colorText = SendDlgItemMessage(hDlg, IDC_CPNT, CPM_GETCOLOUR, 0, 0);
}
- else
- {
- TesterN.colorBack=GetSysColor(COLOR_BTNFACE);
- TesterN.colorText=GetSysColor(COLOR_WINDOWTEXT);
+ else {
+ TesterN.colorBack = GetSysColor(COLOR_BTNFACE);
+ TesterN.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- Tester.PluginWindowProc=NULL;
- TesterF.PluginWindowProc=NULL;
- TesterN.PluginWindowProc=NULL;
- Tester.PluginData=NULL;
- TesterF.PluginData=NULL;
- TesterN.PluginData=NULL;
-
- if (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED)
+ Tester.PluginWindowProc = NULL;
+ TesterF.PluginWindowProc = NULL;
+ TesterN.PluginWindowProc = NULL;
+ Tester.PluginData = NULL;
+ TesterF.PluginData = NULL;
+ TesterN.PluginData = NULL;
+
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED)
PUAddPopupT(&Tester);
- if (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED)
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED)
PUAddPopupT(&TesterF);
- if (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED)
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED)
PUAddPopupT(&TesterN);
- Changed=TRUE;
+ Changed = TRUE;
}
- break;
- case IDC_CHECKKBN:
- Changed=TRUE;
- break;
- case IDC_CHECKPOP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCOL),IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPB),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPT),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOPN),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOP1),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED));
- break;
- case IDC_CHECKFPOP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFCOL),IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFB),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFT),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITFPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED));
- break;
- case IDC_CHECKNPOP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNCOL),IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNB),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNT),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITNPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED));
- break;
-
- }
- if (HIWORD(wParam)==EN_CHANGE)
- Changed=TRUE;
+ break;
+ case IDC_CHECKKBN:
+ Changed = TRUE;
+ break;
+ case IDC_CHECKPOP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCOL), IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPB), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPT), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOPN), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOP1), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED));
+ break;
+ case IDC_CHECKFPOP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFCOL), IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFB), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFT), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITFPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED));
+ break;
+ case IDC_CHECKNPOP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNCOL), IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNB), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNT), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITNPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED));
+ break;
+
+ }
+ if (HIWORD(wParam) == EN_CHANGE)
+ Changed = TRUE;
break;
}
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- switch(((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- TCHAR Text[MAX_PATH];
- BOOL Translated,CheckPopup,CheckPopupW;
- BOOL CheckNPopup,CheckNPopupW,CheckFPopup,CheckFPopupW;
- BOOL CheckPopN;
- UINT Time,TimeN,TimeF;
-
- if (GetDlgItemText(hDlg,IDC_COMBOACCOUNT,Text,_countof(Text)))
- {
- CheckPopup = (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- CheckPopupW = (IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED);
-
- CheckFPopup = (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- CheckFPopupW = (IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED);
-
- CheckNPopup = (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- CheckNPopupW = (IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED);
-
- CheckPopN = (IsDlgButtonChecked(hDlg,IDC_RADIOPOPN)==BST_CHECKED);
-
-
- Time=GetDlgItemInt(hDlg,IDC_EDITPOPS,&Translated,FALSE);
- if (!Translated)
- {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITPOPS));
- break;
- }
- TimeN=GetDlgItemInt(hDlg,IDC_EDITNPOPS,&Translated,FALSE);
- if (!Translated)
- {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITNPOPS));
- break;
- }
- TimeF=GetDlgItemInt(hDlg,IDC_EDITFPOPS,&Translated,FALSE);
- if (!Translated)
- {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITFPOPS));
- break;
- }
-
-
- DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
-
- ActualAccount->Flags=
- (ActualAccount->Flags & YAMN_ACC_ENA) |
- (ActualAccount->Flags & YAMN_ACC_SSL23) |
- (ActualAccount->Flags & YAMN_ACC_NOTLS) |
- (ActualAccount->Flags & YAMN_ACC_APOP) |
- (ActualAccount->Flags & YAMN_ACC_BODY) |
- (CheckPopN ? YAMN_ACC_POPN : 0);
-
- ActualAccount->NewMailN.Flags=
- (ActualAccount->NewMailN.Flags & YAMN_ACC_SND) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_MSG) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_ICO) |
- (CheckPopup ? YAMN_ACC_POP : 0) |
- (CheckPopupW ? YAMN_ACC_POPC : 0) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_APP) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_KBN) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_CONT) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT) |
- YAMN_ACC_MSGP;
-
- ActualAccount->NoNewMailN.Flags=
- (CheckNPopup ? YAMN_ACC_POP : 0) |
- (CheckNPopupW ? YAMN_ACC_POPC : 0) |
- (ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP);
-
- ActualAccount->BadConnectN.Flags=
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO) |
- (CheckFPopup ? YAMN_ACC_POP : 0) |
- (CheckFPopupW ? YAMN_ACC_POPC : 0);
-
- ActualAccount->NewMailN.PopupB=SendDlgItemMessage(hDlg,IDC_CPB,CPM_GETCOLOUR,0,0);
- ActualAccount->NewMailN.PopupT=SendDlgItemMessage(hDlg,IDC_CPT,CPM_GETCOLOUR,0,0);
- ActualAccount->NewMailN.PopupTime=Time;
-
- ActualAccount->NoNewMailN.PopupB=SendDlgItemMessage(hDlg,IDC_CPNB,CPM_GETCOLOUR,0,0);
- ActualAccount->NoNewMailN.PopupT=SendDlgItemMessage(hDlg,IDC_CPNT,CPM_GETCOLOUR,0,0);
- ActualAccount->NoNewMailN.PopupTime=TimeN;
-
- ActualAccount->BadConnectN.PopupB=SendDlgItemMessage(hDlg,IDC_CPFB,CPM_GETCOLOUR,0,0);
- ActualAccount->BadConnectN.PopupT=SendDlgItemMessage(hDlg,IDC_CPFT,CPM_GETCOLOUR,0,0);
- ActualAccount->BadConnectN.PopupTime=TimeF;
-
-
-
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write done\n");
- #endif
- WriteDone(ActualAccount);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write done\n");
- #endif
- WriteDoneSO(POP3Plugin->AccountBrowserSO);
-
-// if (0==WritePOP3Accounts())
-// Beep(500,100);
- WritePOP3Accounts();
- RefreshContact();
- return TRUE;
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ {
+ TCHAR Text[MAX_PATH];
+ BOOL Translated, CheckPopup, CheckPopupW;
+ BOOL CheckNPopup, CheckNPopupW, CheckFPopup, CheckFPopupW;
+ BOOL CheckPopN;
+ UINT Time, TimeN, TimeF;
+
+ if (GetDlgItemText(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text))) {
+ CheckPopup = (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ CheckPopupW = (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED);
+
+ CheckFPopup = (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ CheckFPopupW = (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED);
+
+ CheckNPopup = (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ CheckNPopupW = (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED);
+
+ CheckPopN = (IsDlgButtonChecked(hDlg, IDC_RADIOPOPN) == BST_CHECKED);
+
+
+ Time = GetDlgItemInt(hDlg, IDC_EDITPOPS, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITPOPS));
+ break;
}
- break;
+ TimeN = GetDlgItemInt(hDlg, IDC_EDITNPOPS, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITNPOPS));
+ break;
+ }
+ TimeF = GetDlgItemInt(hDlg, IDC_EDITFPOPS, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITFPOPS));
+ break;
+ }
+
+ DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+
+ ActualAccount->Flags =
+ (ActualAccount->Flags & YAMN_ACC_ENA) |
+ (ActualAccount->Flags & YAMN_ACC_SSL23) |
+ (ActualAccount->Flags & YAMN_ACC_NOTLS) |
+ (ActualAccount->Flags & YAMN_ACC_APOP) |
+ (ActualAccount->Flags & YAMN_ACC_BODY) |
+ (CheckPopN ? YAMN_ACC_POPN : 0);
+
+ ActualAccount->NewMailN.Flags =
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_SND) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_MSG) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_ICO) |
+ (CheckPopup ? YAMN_ACC_POP : 0) |
+ (CheckPopupW ? YAMN_ACC_POPC : 0) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_APP) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_KBN) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_CONT) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT) |
+ YAMN_ACC_MSGP;
+
+ ActualAccount->NoNewMailN.Flags =
+ (CheckNPopup ? YAMN_ACC_POP : 0) |
+ (CheckNPopupW ? YAMN_ACC_POPC : 0) |
+ (ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP);
+
+ ActualAccount->BadConnectN.Flags =
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO) |
+ (CheckFPopup ? YAMN_ACC_POP : 0) |
+ (CheckFPopupW ? YAMN_ACC_POPC : 0);
+
+ ActualAccount->NewMailN.PopupB = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NewMailN.PopupT = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NewMailN.PopupTime = Time;
+
+ ActualAccount->NoNewMailN.PopupB = SendDlgItemMessage(hDlg, IDC_CPNB, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NoNewMailN.PopupT = SendDlgItemMessage(hDlg, IDC_CPNT, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NoNewMailN.PopupTime = TimeN;
+
+ ActualAccount->BadConnectN.PopupB = SendDlgItemMessage(hDlg, IDC_CPFB, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->BadConnectN.PopupT = SendDlgItemMessage(hDlg, IDC_CPFT, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->BadConnectN.PopupTime = TimeF;
+
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write done\n");
+ #endif
+ WriteDone(ActualAccount);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
+ #endif
+ WriteDoneSO(POP3Plugin->AccountBrowserSO);
+
+ WritePOP3Accounts();
+ RefreshContact();
+ return TRUE;
}
- break;
+ }
+ break;
}
break;
+ }
+ break;
}
if (Changed)
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
return FALSE;
}
-
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 8ffac76e0b..0557790b2d 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -220,7 +220,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) {
case CNFT_BYTE:
{
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.bVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.bVal);
buffer = _tcsdup(tmp);
break;
@@ -228,7 +228,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) case CNFT_WORD:
{
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.wVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.wVal);
buffer = _tcsdup(tmp);
break;
@@ -236,7 +236,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) case CNFT_DWORD:
{
- mir_sntprintf(tmp, _countof(tmp), _T("%ld"), ctInfo.dVal);
+ mir_sntprintf(tmp, _T("%ld"), ctInfo.dVal);
buffer = _tcsdup(tmp);
break;
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index 575d8d203b..e79c66a7c4 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -85,7 +85,7 @@ int AddDebugLogMessageA(const char* fmt, ...) mir_vsnprintf(szText, _countof(szText), fmt, va);
va_end(va);
#ifdef MODULENAME
- mir_snprintf(szFinal, _countof(szFinal), "%s: %s", MODULENAME, szText);
+ mir_snprintf(szFinal, "%s: %s", MODULENAME, szText);
#else
strncpy(szFinal, szText, _countof(szFinal));
#endif
@@ -106,7 +106,7 @@ int AddDebugLogMessage(const TCHAR* fmt, ...) mir_vsntprintf(tszText, _countof(tszText), fmt, va);
va_end(va);
#ifdef MODULENAME
- mir_sntprintf(tszFinal, _countof(tszFinal), _T("%s: %s"), MODULENAME, tszText);
+ mir_sntprintf(tszFinal, _T("%s: %s"), MODULENAME, tszText);
#else
_tcsncpy(tszFinal, tszText, _countof(tszFinal));
#endif
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp index 8e3afd3103..0c734a02b8 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.cpp +++ b/plugins/mTextControl/src/FormattedTextDraw.cpp @@ -120,7 +120,7 @@ HRESULT CFormattedTextDraw::putTextA(char *newVal) cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), _T("MS Shell Dlg"));
+ _tcsncpy_s(cf.szFaceName, _T("MS Shell Dlg"), _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
@@ -148,7 +148,7 @@ HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal) cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), _T("MS Shell Dlg"));
+ _tcsncpy_s(cf.szFaceName, _T("MS Shell Dlg"), _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
}
@@ -170,7 +170,7 @@ HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc) cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), lf.lfFaceName);
+ _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
m_spTextServices->TxDraw(
@@ -211,7 +211,7 @@ HRESULT CFormattedTextDraw::get_NaturalSize(void *hdcDraw, long *Width, long *He cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), lf.lfFaceName);
+ _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
if (!m_spTextServices)
return S_FALSE;
diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp index 0107d2d92f..16008472f9 100644 --- a/plugins/mTextControl/src/richeditutils.cpp +++ b/plugins/mTextControl/src/richeditutils.cpp @@ -77,7 +77,7 @@ public: HRESULT STDMETHODCALLTYPE GetNewStorage(LPSTORAGE * lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), this->nextStgId);
+ mir_sntprintf(sztName, _T("s%u"), this->nextStgId);
if (this->pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 98f227bf41..5d09e1bc6b 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -63,7 +63,7 @@ int ProtoAck(WPARAM,LPARAM lparam) DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE );
if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) {
TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
+ mir_sntprintf(buffer, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
} } }
@@ -121,7 +121,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) return 0;
TCHAR bufferW[512];
- mir_sntprintf(bufferW, _countof(bufferW), TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
+ mir_sntprintf(bufferW, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact);
return 0;
}
@@ -193,7 +193,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) c2 = DbGetEventTextT( &dbe, 0 );
TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), buf, c1, c2);
+ mir_sntprintf(buffer, buf, c1, c2);
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), wParam);
mir_free( c1 );
|