代碼: 選擇全部
#define HKEY_LOCAL_MACHINE 2147483650 // 0x80000002
function IsWindows10()
local oReg := TReg32():New( HKEY_LOCAL_MACHINE,;
"SOFTWARE\Microsoft\Windows NT\CurrentVersion",;
.f. )
local cProductName := oReg:Get( "ProductName" )
oReg:Close()
return "Windows 10" $ cProductName
代碼: 選擇全部
if GetNTVersionNumbers( @dwMajorVer, @dwMinorVer, @dwBuildNumber)
msginfo( 'dwMajorVer: '+str(dwMajorVer)+hb_eol()+;
'dwMinorVer: '+str(dwMinorVer)+hb_eol()+;
'dwBuildNumber: '+str(dwBuildNumber) )
else
msgstop('fail')
endif
於 windows 8 下取得 dwMajorVer:6, dwMinorVer:2
於 windows 8.1 下取得 dwMajorVer:6, dwMinorVer:3
於 windows 10 下取得 dwMajorVer:10, dwMinorVer:0
經測試,這個 BuildNumber 似乎不太正確,直接沿用舊的 GetVersionEx() 取得的 BuildNumber 即可!