WIN10以后如果Manifest中不寫支持WIN10的話,獲取版本號的API獲取的是6


  if TOSVersion.Major = 10 then  // 高版本的Delphi(比如Berlin)可以這樣寫

    ShowMessage('Windows 10');

或者:

   if Win32MajorVersion = 10 then

 

WIN10以后如果Manifest中不寫支持WIN10的話,獲取版本號的API獲取的是6,最新版的Delphi的manifest中寫了支持WIN10,所以沒問題。
老版本Delphi要自己寫manifest中間加上
    <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 Vista -->
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
          <!-- Windows 7 -->
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
          <!-- Windows 8 -->
          <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>    
    
          <!--This Id value indicates the application supports Windows Vista/Server 2008 functionality -->
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
          <!--This Id value indicates the application supports Windows 7/Server 2008 R2 functionality-->
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
          <!--This Id value indicates the application supports Windows 8/Server 2012 functionality-->
          <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
          <!-- This Id value indicates the application supports Windows Blue/Server 2012 R2 functionality-->
          <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
          <!-- This Id value indicates the application supports Windows Threshold functionality-->
          <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
        </application>
    </compatibility>

 

http://bbs.2ccc.com/topic.asp?topicid=529101


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM