diff --git a/Notepad3.sln b/Notepad3.sln index 8f718046c..ee014100b 100644 --- a/Notepad3.sln +++ b/Notepad3.sln @@ -23,6 +23,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3_en_us", "language\np3_e EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3_es_es", "language\np3_es_es\np3_es_es.vcxproj", "{3B8C289D-FF47-4237-AD7B-0702230F41A3}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3_af_af", "language\np3_af_af\np3_af_af.vcxproj", "{C8E80B4C-C0FD-4119-A05A-AB372A61007F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -107,6 +109,14 @@ Global {3B8C289D-FF47-4237-AD7B-0702230F41A3}.Release|Win32.Build.0 = Release|Win32 {3B8C289D-FF47-4237-AD7B-0702230F41A3}.Release|x64.ActiveCfg = Release|x64 {3B8C289D-FF47-4237-AD7B-0702230F41A3}.Release|x64.Build.0 = Release|x64 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Debug|Win32.ActiveCfg = Debug|Win32 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Debug|Win32.Build.0 = Debug|Win32 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Debug|x64.ActiveCfg = Debug|x64 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Debug|x64.Build.0 = Debug|x64 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|Win32.ActiveCfg = Release|Win32 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|Win32.Build.0 = Release|Win32 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|x64.ActiveCfg = Release|x64 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/language/np3_af_af/dllmain.cpp b/language/np3_af_af/dllmain.cpp new file mode 100644 index 000000000..d132857e3 Binary files /dev/null and b/language/np3_af_af/dllmain.cpp differ diff --git a/language/np3_af_af/np3_af_af.cpp b/language/np3_af_af/np3_af_af.cpp new file mode 100644 index 000000000..592049184 Binary files /dev/null and b/language/np3_af_af/np3_af_af.cpp differ diff --git a/language/np3_af_af/np3_af_af.rc b/language/np3_af_af/np3_af_af.rc new file mode 100644 index 000000000..a212c5a27 Binary files /dev/null and b/language/np3_af_af/np3_af_af.rc differ diff --git a/language/np3_af_af/np3_af_af.vcxproj b/language/np3_af_af/np3_af_af.vcxproj new file mode 100644 index 000000000..a8323e9aa --- /dev/null +++ b/language/np3_af_af/np3_af_af.vcxproj @@ -0,0 +1,199 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {C8E80B4C-C0FD-4119-A05A-AB372A61007F} + Win32Proj + np3afaf + 10.0.17134.0 + + + + DynamicLibrary + true + v141 + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + DynamicLibrary + true + v141 + Unicode + + + DynamicLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + false + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + + + true + false + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + + + false + false + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + + + false + false + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\lng\ + ..\..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\ + + + + Use + Level3 + Disabled + true + _DEBUG;NP3AFAF_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + + + 0x0036 + + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;NP3AFAF_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + + + 0x0036 + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;NP3AFAF_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + 0x0036 + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;NP3AFAF_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + 0x0036 + + + + + + + + + + + + Create + Create + Create + Create + + + + + 0x0036 + 0x0036 + 0x0036 + 0x0036 + + + + + + \ No newline at end of file diff --git a/language/np3_af_af/np3_af_af.vcxproj.filters b/language/np3_af_af/np3_af_af.vcxproj.filters new file mode 100644 index 000000000..0a58172b1 --- /dev/null +++ b/language/np3_af_af/np3_af_af.vcxproj.filters @@ -0,0 +1,44 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/language/np3_af_af/resource.h b/language/np3_af_af/resource.h new file mode 100644 index 000000000..3036f5ad9 --- /dev/null +++ b/language/np3_af_af/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Von Microsoft Visual C++ generierte Includedatei. +// Verwendet durch np3_af_af.rc +// +#define IDS_MUI_UNTITLED 30001 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 30002 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/language/np3_af_af/stdafx.cpp b/language/np3_af_af/stdafx.cpp new file mode 100644 index 000000000..733d68c24 Binary files /dev/null and b/language/np3_af_af/stdafx.cpp differ diff --git a/language/np3_af_af/stdafx.h b/language/np3_af_af/stdafx.h new file mode 100644 index 000000000..b937b12cc Binary files /dev/null and b/language/np3_af_af/stdafx.h differ diff --git a/language/np3_af_af/targetver.h b/language/np3_af_af/targetver.h new file mode 100644 index 000000000..567cd346e Binary files /dev/null and b/language/np3_af_af/targetver.h differ diff --git a/language/np3_de_de/np3_de_de.rc b/language/np3_de_de/np3_de_de.rc index 199e744d2..f807a04db 100644 Binary files a/language/np3_de_de/np3_de_de.rc and b/language/np3_de_de/np3_de_de.rc differ diff --git a/language/np3_de_de/np3_de_de.vcxproj.filters b/language/np3_de_de/np3_de_de.vcxproj.filters index 14aef8f48..ef4d23c70 100644 --- a/language/np3_de_de/np3_de_de.vcxproj.filters +++ b/language/np3_de_de/np3_de_de.vcxproj.filters @@ -1,44 +1,44 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - + {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + - Headerdateien + Header Files - Headerdateien + Header Files - Headerdateien + Header Files - Quelldateien + Source Files - Quelldateien + Source Files - Quelldateien + Source Files - Ressourcendateien + Resource Files \ No newline at end of file diff --git a/language/np3_en_us/np3_en_us.rc b/language/np3_en_us/np3_en_us.rc index dce22a413..a5805cdcc 100644 Binary files a/language/np3_en_us/np3_en_us.rc and b/language/np3_en_us/np3_en_us.rc differ diff --git a/language/np3_en_us/np3_en_us.vcxproj.filters b/language/np3_en_us/np3_en_us.vcxproj.filters index a017a245d..b6df34762 100644 --- a/language/np3_en_us/np3_en_us.vcxproj.filters +++ b/language/np3_en_us/np3_en_us.vcxproj.filters @@ -1,44 +1,44 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - + {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - Headerdateien + Header Files - Headerdateien + Header Files - Headerdateien + Header Files - Quelldateien + Source Files - Quelldateien + Source Files - Quelldateien + Source Files - Ressourcendateien + Resource Files \ No newline at end of file diff --git a/language/np3_es_es/np3_es_es.rc b/language/np3_es_es/np3_es_es.rc index a6419434d..a195bdf73 100644 Binary files a/language/np3_es_es/np3_es_es.rc and b/language/np3_es_es/np3_es_es.rc differ diff --git a/language/np3_es_es/np3_es_es.vcxproj.filters b/language/np3_es_es/np3_es_es.vcxproj.filters index 1ce7c3e5e..42f9e85b7 100644 --- a/language/np3_es_es/np3_es_es.vcxproj.filters +++ b/language/np3_es_es/np3_es_es.vcxproj.filters @@ -1,44 +1,44 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - + {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - Headerdateien + Header Files - Headerdateien + Header Files - Headerdateien + Header Files - Quelldateien + Source Files - Quelldateien + Source Files - Quelldateien + Source Files - Ressourcendateien + Resource Files \ No newline at end of file diff --git a/language/np3_fr_fr/np3_fr_fr.rc b/language/np3_fr_fr/np3_fr_fr.rc index ac3f246aa..50263c377 100644 Binary files a/language/np3_fr_fr/np3_fr_fr.rc and b/language/np3_fr_fr/np3_fr_fr.rc differ diff --git a/language/np3_fr_fr/np3_fr_fr.vcxproj.filters b/language/np3_fr_fr/np3_fr_fr.vcxproj.filters index d57ef1173..3a402f439 100644 --- a/language/np3_fr_fr/np3_fr_fr.vcxproj.filters +++ b/language/np3_fr_fr/np3_fr_fr.vcxproj.filters @@ -1,44 +1,44 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - + {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - Headerdateien + Header Files - Headerdateien + Header Files - Headerdateien + Header Files - Quelldateien + Source Files - Quelldateien + Source Files - Quelldateien + Source Files - Ressourcendateien + Resource Files \ No newline at end of file diff --git a/src/Helpers.h b/src/Helpers.h index a1a4d341a..a6d6d6c87 100644 --- a/src/Helpers.h +++ b/src/Helpers.h @@ -187,7 +187,7 @@ bool IsCmdEnabled(HWND, UINT); if (GetFocus() == hctrl) { SendMessage((hdlg), WM_NEXTDLGCTL, 0, false); } }; EnableWindow(hctrl, (b)); } #define GetString(id,pb,cb) LoadString(g_hInstance,id,pb,cb) -#define GetLngString(id,pb,cb) LoadString((g_hLngResContainer ? g_hLngResContainer : g_hInstance),(id),(pb),(cb)) +#define GetLngString(id,pb,cb) LoadString(g_hLngResContainer,(id),(pb),(cb)) #define StrEnd(pStart) (pStart + lstrlen(pStart)) diff --git a/src/Notepad3.c b/src/Notepad3.c index 5be208cf1..68de7dc14 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -572,45 +572,6 @@ static void __fastcall _SetDocumentModified(bool bModified) //============================================================================== -static bool __fastcall _LngStrToMultiLngStr(WCHAR* pLngStr, WCHAR* pLngMultiStr, size_t lngMultiStrSize) -{ - bool rtnVal = true; - - size_t strLen = (size_t)lstrlenW(pLngStr); - - if ((strLen > 0) && pLngMultiStr && (lngMultiStrSize > 0)) - { - WCHAR* lngMultiStrPtr = pLngMultiStr; - WCHAR* last = pLngStr + (pLngStr[0] == 0xFEFF ? 1 : 0); // if read from unicode (UTF-16 LE) file - while (last && rtnVal) - { - // make sure you validate the user input - WCHAR* next = StrNextTok(last, L",; :"); - if (next) { *next = L'\0'; } - strLen = (size_t)StringCchLenW(last, LOCALE_NAME_MAX_LENGTH); - if ((strLen > 0) && IsValidLocaleName(last)) - { - lngMultiStrPtr[0] = L'\0'; - rtnVal &= SUCCEEDED(StringCchCatW(lngMultiStrPtr, (lngMultiStrSize - (lngMultiStrPtr - pLngMultiStr)), last)); - lngMultiStrPtr += strLen + 1; - } - last = (next ? next + 1 : next); - } - if (rtnVal && (lngMultiStrSize - (lngMultiStrPtr - pLngMultiStr))) // make sure there is a double null term for the multi-string - { - lngMultiStrPtr[0] = L'\0'; - } - else // fail and guard anyone whom might use the multi-string - { - lngMultiStrPtr[0] = L'\0'; - lngMultiStrPtr[1] = L'\0'; - } - } - return rtnVal; -} - - - //============================================================================= // // WinMain() @@ -822,16 +783,54 @@ bool InitApplication(HINSTANCE hInstance) } +//============================================================================= +// +// _LngStrToMultiLngStr +// +// +static bool __fastcall _LngStrToMultiLngStr(WCHAR* pLngStr, WCHAR* pLngMultiStr, size_t lngMultiStrSize) +{ + bool rtnVal = true; + + size_t strLen = (size_t)lstrlenW(pLngStr); + + if ((strLen > 0) && pLngMultiStr && (lngMultiStrSize > 0)) { + WCHAR* lngMultiStrPtr = pLngMultiStr; + WCHAR* last = pLngStr + (pLngStr[0] == 0xFEFF ? 1 : 0); // if read from unicode (UTF-16 LE) file + while (last && rtnVal) { + // make sure you validate the user input + WCHAR* next = StrNextTok(last, L",; :"); + if (next) { *next = L'\0'; } + strLen = (size_t)StringCchLenW(last, LOCALE_NAME_MAX_LENGTH); + if ((strLen > 0) && IsValidLocaleName(last)) { + lngMultiStrPtr[0] = L'\0'; + rtnVal &= SUCCEEDED(StringCchCatW(lngMultiStrPtr, (lngMultiStrSize - (lngMultiStrPtr - pLngMultiStr)), last)); + lngMultiStrPtr += strLen + 1; + } + last = (next ? next + 1 : next); + } + if (rtnVal && (lngMultiStrSize - (lngMultiStrPtr - pLngMultiStr))) // make sure there is a double null term for the multi-string + { + lngMultiStrPtr[0] = L'\0'; + } + else // fail and guard anyone whom might use the multi-string + { + lngMultiStrPtr[0] = L'\0'; + lngMultiStrPtr[1] = L'\0'; + } + } + return rtnVal; +} + + //============================================================================= // // _LoadLanguageResources // // - static HMODULE __fastcall _LoadLanguageResources() { - HMODULE hLangResourceContainer = NULL; - + WCHAR tchUserLangMultiStrg[LARGE_BUFFER]; if (!_LngStrToMultiLngStr(g_tchUserDefinedLanguages, tchUserLangMultiStrg, LARGE_BUFFER)) @@ -849,13 +848,12 @@ static HMODULE __fastcall _LoadLanguageResources() NULL); MessageBox(NULL, (LPCWSTR)lpMsgBuf, L"Notepad3", MB_OK | MB_ICONEXCLAMATION); LocalFree(lpMsgBuf); - return NULL; // exit + return g_hInstance; // default lang } - // set the appropriate fallback list DWORD langCount = 0; - // using SetProcessPreferredUILanguages is recomended for new applications (esp. multi-threaded applications) + // using SetProcessPreferredUILanguages is recommended for new applications (esp. multi-threaded applications) if (!SetProcessPreferredUILanguages(MUI_LANGUAGE_NAME, tchUserLangMultiStrg, &langCount) || (langCount == 0)) { LPVOID lpMsgBuf; @@ -871,7 +869,7 @@ static HMODULE __fastcall _LoadLanguageResources() NULL); MessageBox(NULL, (LPCWSTR)lpMsgBuf, L"Notepad3", MB_OK | MB_ICONEXCLAMATION); LocalFree(lpMsgBuf); - return NULL; // exit + return g_hInstance; // default lang } // NOTES: @@ -885,7 +883,7 @@ static HMODULE __fastcall _LoadLanguageResources() // obtains access to the proper resource container // for standard Win32 resource loading this is normally a PE module - use LoadLibraryEx - hLangResourceContainer = LoadMUILibraryW(L"np3lng.dll", MUI_LANGUAGE_NAME, GetUserDefaultUILanguage()); + HMODULE hLangResourceContainer = LoadMUILibraryW(L"np3lng.dll", MUI_LANGUAGE_NAME, GetUserDefaultUILanguage()); //hLangResourceContainer = LoadMUILibraryW(L"np3lng.dll", MUI_LANGUAGE_NAME, 0x0407); if (!hLangResourceContainer) @@ -903,7 +901,7 @@ static HMODULE __fastcall _LoadLanguageResources() NULL); MessageBox(NULL, (LPCWSTR)lpMsgBuf, L"Notepad3", MB_OK | MB_ICONEXCLAMATION); LocalFree(lpMsgBuf); - return NULL; // exit + return g_hInstance; // default lang } //// 3. Application parses the resource container to find the appropriate item