diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-18 21:20:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-18 21:20:39 +0000 |
commit | ec0e34b4f88ebe03ff12f559e40dda52c51549b7 (patch) | |
tree | 42e8a56fe17d9736527fe79a6345e857842fbf40 /plugins/AssocMgr/src/utils.cpp | |
parent | ca702593c60aa89c06633777feb7cf79ad8e751f (diff) |
langpack services module destroyed from mir_app
the only survived service moved to mir_core
git-svn-id: http://svn.miranda-ng.org/main/trunk@14250 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AssocMgr/src/utils.cpp')
-rw-r--r-- | plugins/AssocMgr/src/utils.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/AssocMgr/src/utils.cpp b/plugins/AssocMgr/src/utils.cpp index 993f0bbaa9..0c76880e29 100644 --- a/plugins/AssocMgr/src/utils.cpp +++ b/plugins/AssocMgr/src/utils.cpp @@ -30,7 +30,7 @@ WCHAR* a2u(const char *pszAnsi,BOOL fMirCp) WCHAR *psz;
if(pszAnsi==NULL) return NULL;
- codepage=fMirCp?CallService(MS_LANGPACK_GETCODEPAGE,0,0):CP_ACP;
+ codepage = fMirCp ? Langpack_GetDefaultCodePage() : CP_ACP;
cch=MultiByteToWideChar(codepage,0,pszAnsi,-1,NULL,0);
if (!cch) return NULL;
@@ -50,7 +50,7 @@ char* u2a(const WCHAR *pszUnicode,BOOL fMirCp) DWORD flags;
if(pszUnicode==NULL) return NULL;
- codepage=fMirCp?CallService(MS_LANGPACK_GETCODEPAGE,0,0):CP_ACP;
+ codepage = fMirCp ? Langpack_GetDefaultCodePage() : CP_ACP;
/* without WC_COMPOSITECHECK some characters might get out strange (see MS blog) */
cch=WideCharToMultiByte(codepage,flags=WC_COMPOSITECHECK,pszUnicode,-1,NULL,0,NULL,NULL);
if (!cch) cch=WideCharToMultiByte(codepage,flags=0,pszUnicode,-1,NULL,0,NULL,NULL);
@@ -158,13 +158,15 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) return; /* success */
}
- mbp=(MSGBOXPARAMSA*)mir_calloc(sizeof(*mbp));
- if(mbp==NULL) return;
- mbp->cbSize=sizeof(*mbp);
- mbp->lpszCaption=mir_strdup(pszTitle);
- mbp->lpszText=mir_strdup(szText);
- mbp->dwStyle=MB_OK|MB_SETFOREGROUND|MB_TASKMODAL;
- mbp->dwLanguageId=LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0));
+ mbp = (MSGBOXPARAMSA*)mir_calloc(sizeof(*mbp));
+ if(mbp == NULL)
+ return;
+
+ mbp->cbSize = sizeof(*mbp);
+ mbp->lpszCaption = mir_strdup(pszTitle);
+ mbp->lpszText = mir_strdup(szText);
+ mbp->dwStyle = MB_OK | MB_SETFOREGROUND | MB_TASKMODAL;
+ mbp->dwLanguageId = LANGIDFROMLCID(Langpack_GetDefaultLocale());
switch(flags&NIIF_ICON_MASK) {
case NIIF_INFO: mbp->dwStyle|=MB_ICONINFORMATION; break;
case NIIF_WARNING: mbp->dwStyle|=MB_ICONWARNING; break;
@@ -177,8 +179,8 @@ void ShowInfoMessage(BYTE flags,const char *pszTitle,const char *pszTextFmt,...) char* GetWinErrorDescription(DWORD dwLastError)
{
char *buf=NULL;
- DWORD flags=FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM;
- if (!FormatMessageA(flags,NULL,dwLastError,LANGIDFROMLCID((LCID)CallService(MS_LANGPACK_GETLOCALE,0,0)),(char*)&buf,0,NULL))
+ DWORD flags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM;
+ if (!FormatMessageA(flags,NULL,dwLastError, LANGIDFROMLCID(Langpack_GetDefaultLocale()),(char*)&buf,0,NULL))
if(GetLastError()==ERROR_RESOURCE_LANG_NOT_FOUND)
FormatMessageA(flags,NULL,dwLastError,0,(char*)&buf,0,NULL);
return buf;
|