summaryrefslogtreecommitdiff
path: root/plugins/AssocMgr/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AssocMgr/src/utils.cpp')
-rw-r--r--plugins/AssocMgr/src/utils.cpp24
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;