Enhance the version detection capacity

By adding targeting in notepad++.manifest:

https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx
Windows 8.1 and windows 10 are detected correctely
This commit is contained in:
Don Ho 2015-12-05 21:39:53 +01:00
parent 6c7ca02fea
commit 48e9b84bb2
4 changed files with 21 additions and 3 deletions

View File

@ -44,7 +44,7 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
// The end of enumated language type, so it should be always at the end
L_EXTERNAL};
enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81};
enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10};

View File

@ -722,6 +722,7 @@ generic_string ThemeSwitcher::getThemeFromXmlFileName(const TCHAR *xmlFullPath)
#pragma warning(disable : 4996)
winVer getWindowsVersion()
{
OSVERSIONINFOEX osvi;
@ -750,6 +751,9 @@ winVer getWindowsVersion()
{
case VER_PLATFORM_WIN32_NT:
{
if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
return WV_WIN10;
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
return WV_WIN81;

View File

@ -20,6 +20,20 @@
/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>

View File

@ -336,7 +336,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
// tell the running instance the FULL path to the new files to load
size_t nrFilesToOpen = params.size();
for(size_t i = 0; i < nrFilesToOpen; ++i)
for (size_t i = 0; i < nrFilesToOpen; ++i)
{
const TCHAR * currentFile = params.at(i);
if (currentFile[0])
@ -460,7 +460,7 @@ DEVOMER*/
{
// According to MSDN ChangeWindowMessageFilter may not be supported in future versions of Windows,
// that is why we use ChangeWindowMessageFilterEx if it is available (windows version >= Win7).
if(pNppParameters->getWinVersion() == WV_VISTA)
if (pNppParameters->getWinVersion() == WV_VISTA)
{
typedef BOOL (WINAPI *MESSAGEFILTERFUNC)(UINT message,DWORD dwFlag);
const DWORD MSGFLT_ADD = 1;