From 4deb7fa0d330de4de27c5f89c2a38131f4152122 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Fri, 3 Jul 2020 15:16:21 +0200 Subject: [PATCH] i18n --- CMainWindow.cpp | 16 ++++++++++++++++ CMainWindow.h | 3 +-- pEpCOMServerAdapter.rc | Bin 8318 -> 12656 bytes pEpCOMServerAdapter.vcxproj | 2 ++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMainWindow.cpp b/CMainWindow.cpp index a20aded..3bc0288 100644 --- a/CMainWindow.cpp +++ b/CMainWindow.cpp @@ -5,6 +5,22 @@ static const GUID nidGUID = { 0xa4dbdbe1, 0x4051, 0x4d89, { 0xb1, 0x17, 0x62, 0x82, 0x18, 0x5a, 0x61, 0x5c } }; +CMainWindow::CMainWindow() : + _schedule_updates(true), CWindowImpl() +{ + ULONG ulNumLanguages = 0; + PZZWSTR pwszLanguagesBuffer = NULL; + ULONG pcchLanguagesBuffer = 0; + BOOL bResult = GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, NULL, &pcchLanguagesBuffer); + assert(bResult); + pwszLanguagesBuffer = new WCHAR[pcchLanguagesBuffer]; + bResult = GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, pwszLanguagesBuffer, &pcchLanguagesBuffer); + assert(bResult); + bResult = SetProcessPreferredUILanguages(MUI_LANGUAGE_NAME, pwszLanguagesBuffer, &ulNumLanguages); + assert(bResult); + delete[] pwszLanguagesBuffer; +} + LRESULT CMainWindow::OnCreate(UINT, WPARAM, LPARAM, BOOL&) { // remove leftoff before creating a new one diff --git a/CMainWindow.h b/CMainWindow.h index 9113c0f..630061c 100644 --- a/CMainWindow.h +++ b/CMainWindow.h @@ -12,8 +12,7 @@ class CMainWindow : bool _schedule_updates; public: - CMainWindow() : - _schedule_updates(true), CWindowImpl() { } + CMainWindow(); DECLARE_WND_CLASS(_T("pEpCOMServerAdapterMainWndClass")) BEGIN_MSG_MAP(CMainWindow) diff --git a/pEpCOMServerAdapter.rc b/pEpCOMServerAdapter.rc index d2b11e55b853019dd8e8a0ef962469233ff8fe20..379df39c3dd1e1e9a24898dd22adde2a9cad48d7 100644 GIT binary patch delta 802 zcmZ{i&1(};6vfYLQ?a$_1fflIs!od^2u(>u=}wF`L?s3>cB@Qm^8qoLPNoKQQNf+r zhiwCH4w+0XEJO#Y% z@Z6!2zS&^TB9>$!)w6Sq1!x-sG*2hW;A`op7Q&yY@5&x6l*VoPH6(b1Z6{^gzOX%H zliEoyx($qLZAP6)ezc0lsZp*%@n!DIM5qw8NnoAdAmYIW96U1htJJQUT%Q>l*eG2$ z8<*m`TkV4fchTdz&a*CdgR@T7B2D8;gQ7a7k=t}nyVQ|y_O)}PsE%>WH|^@$zIkn` z%D_G^t@+e;o-g-c{)ex@HS!+UzwKxvR*iyQ+vt+6$<;NcblI$Lb~Qt)JBhj-!?NTK s&&uxn@xT7_F}Zi*y_6>3hQ-+FLnGhw$Jl|N7WQYlYX5tM^~7A_5Ar^_m;e9( delta 65 zcmey6^v_{~AIoMZQ6)A;gUPXMhKvTA``P9*ZZ?zkU<9)3<#ZX@ix@H)(it)~ZwEvuN`x#WsEbqd^of diff --git a/pEpCOMServerAdapter.vcxproj b/pEpCOMServerAdapter.vcxproj index 606363e..56b6d81 100644 --- a/pEpCOMServerAdapter.vcxproj +++ b/pEpCOMServerAdapter.vcxproj @@ -90,6 +90,8 @@ xcopy /y "..\Dependencies\zlib\zlib1.dll" "$(OutDir)" 0x0409 $(IntDir);%(AdditionalIncludeDirectories) _DEBUG;%(PreprocessorDefinitions) + + Windows