weitere Programme
Übersicht
 

Windows-Version ermitteln


Erkannt werden alle Windows-Versionen von Windows NT 3.51 über Windows 9x bis hin zu Windows 8.
#Include Once "windows.bi" Function GetOSplatform () As Integer Dim OSV As OSVERSIONINFO Dim OSVEx As OSVERSIONINFOEX Dim mOsVersion As String Dim Erg As Integer OSV.dwOSVersionInfoSize = SizeOf(OSV)'Laenge des UDT angeben Erg = GetVersionEx(@OSV) 'Funktion aufrufen und If Erg <> 0 Then 'Rueckgabewert abfragen Select Case OSV.dwPlatformId Case 0 mOsVersion = " ??" Case 1 Select Case OSV.dwMinorVersion Case 0 mOsVersion = "95" Case 10 mOsVersion = " 98" If (OSV.dwBuildNumber And &HFFFF) = 2222 Then mOsVersion = " 98 SE" End If Case 90 mOsVersion = " ME" End Select Case 2 OSVEx.dwOsVersionInfoSize = SizeOf(OSVEx) Erg = GetVersionEx (Cast(LPOSVERSIONINFO,@OSVEx)) Select Case OSVEx.dwMajorVersion Case 3 mOsVersion = " NT 3.51" Case 4 mOsVersion = " NT 4.0" Case 5 Select Case OSVEx.dwMinorVersion Case 0 mOsVersion = "2000" Case 1 mOsVersion = " XP" Case 2 mOsVersion = " Server 2003" End Select Case 6 Select Case OSVEx.dwMinorVersion Case 0 If OSVEx.wProductType = VER_NT_WORKSTATION Then mOsVersion = " Vista" Else mOsVersion = " Server 2008" EndIf Case 1 If OSVEx.wProductType = VER_NT_WORKSTATION Then mOsVersion = "7" Else mOsVersion = " Server 2008 R2" EndIf Case 2 If OSVEx.wProductType = VER_NT_WORKSTATION Then mOsVersion = "8" Else mOsVersion = " Server 2012" EndIf End Select Dim GetProductInfo As Function ( _ dwOSMajorVersion As UInteger, _ dwOSMinorVersion As UInteger, _ dwSpMajorVersion As UInteger, _ dwSpMinorVersion As UInteger, _ pdwReturnedProductType As UInteger Ptr) As Integer Dim dwType As UInteger Dim As Any Ptr kernel32 kernel32 = DylibLoad("kernel32") If kernel32 Then GetProductInfo = DyLibSymbol(kernel32, "GetProductInfo") If GetProductInfo Then GetProductInfo( OSVEx.dwMajorVersion, OSVEx.dwMinorVersion, 0, 0, @dwType) Select case dwType case 1'PRODUCT_ULTIMATE mOsVersion += " Ultimate" case 2'PRODUCT_HOME_BASIC mOsVersion += " Home Basic" case 3'PRODUCT_HOME_PREMIUM mOsVersion += " Home Premium" case 4'PRODUCT_ENTERPRISE mOsVersion += " Enterprise" case 6'PRODUCT_BUSINESS mOsVersion += " Business" case 11'PRODUCT_STARTER mOsVersion += " Starter" case &H30'PRODUCT_PROFESSIONAL mOsVersion += " Professional" case &H67'PRODUCT_PROFESSIONAL_WMC mOsVersion += " Professional Media Center" case &HABCDABCD'PRODUCT_UNLICENSED mOsVersion += " Unlicensed product" End Select EndIf EndIf End Select End Select MessageBox (0, "Windows" + mOsVersion + Chr(10) _ + Trim(Str(OSV.dwMajorVersion)) + ". " _ + Trim(Str(OSV.dwMinorVersion)) + ". " _ + Trim(Str(OSV.dwBuildNumber And &HFFFF)) + " " _ + Trim(OSV.szCSDVersion), "Windows - Version", MB_OK) End If GetOSplatform = OSV.dwPlatformId End Function GetOSplatform

CPU Type ermitteln


' CPU_ID.Bas - by Volta 01.07.2008 ' bug fix 06.07.2008 (is_intel corcount) #Include Once "windows.bi" #Define ext " Extensions" #Define sim " Streaming SIMD" + ext #Define cr Chr(10) #Define inst " instructions" #Define ins inst + cr #Define Yes =1 #Define insu " instruction support" + cr #Define amde " AMD extensions to" #Define No =0 Type CPU_ID As UInteger hat_CPUID No Private: As String*13 Vendor="no CPUID "+Chr(0) As String*48 CPU_typ="no brand" As UByte is_amd, is_intel As UByte family, model, Stepping As UByte hat_mmx, hat_sse, hat_sse2, hat_sse3, hat_HTT, hat_cor As UByte Intel64, hat_ssse3, hat_SSE41, hat_SSE42, hat_vmx As UByte hat_mmxe, hat_3dNow, hat_3dNowe, AMD64, hat_SSE4A As UByte hat_SSE5, AMD_CmpLegacy Public: Declare Constructor Declare Function WinInfo As String Private: Declare Function Stand_Feature () As Integer Declare Function cpuvendor () As Integer Declare Function brand () As String Declare Function Intel (As Integer) As Integer Declare Function AMD () As Integer End Type Constructor CPU_ID Dim As UInteger erg = fb_CpuDetect If (erg And &h0fffffff) >0 Then hat_CPUID Yes 'Processor Standard Feature Bits 'können ab FB 0.20.0 auch hier bestimmt werden 'If erg And &h00800000 Then hat_mmx Yes'Bit 23 'If erg And &h02000000 Then hat_sse Yes'Bit 25 'If erg And &h04000000 Then hat_sse2 Yes'Bit 26 erg = cpuvendor If InStr(Vendor, "AMD") Then is_amd Yes If InStr(Vendor, "Intel") Then is_intel Yes If erg > 0 Then Stand_Feature If is_intel Then Intel(erg) If is_amd Then AMD Else family = (erg Shr 28) EndIf End Constructor Function CPU_ID.Stand_Feature () As Integer Dim As UInteger tmp, tmp1, tmp2 Asm mov eax, 1 cpuid mov [tmp],eax mov [tmp1],edx mov [tmp2],ecx End Asm Stepping = (tmp And &h0F) model = ((tmp Shr 4) And &h0F) family = ((tmp Shr 8) And &h0F) 'Processor Standard Feature Bits If tmp1 And &h00800000 Then hat_mmx Yes 'Bit 23 If tmp1 And &h02000000 Then hat_sse Yes 'Bit 25 If tmp1 And &h04000000 Then hat_sse2 Yes 'Bit 26 If tmp1 And &h10000000 Then hat_HTT Yes 'Bit 28 If tmp2 And &h00000001 Then hat_sse3 Yes 'Bit 0 If tmp2 And &H00080000 Then hat_SSE41 Yes 'Bit 19 Function=tmp1 End Function Function CPU_ID.cpuvendor () As Integer Dim ven As Any Ptr = @Vendor Asm mov eax, 0 cpuid mov [Function], eax mov eax,[ven] mov [eax], ebx 'vendor String 12 Byte mov [eax+4], edx mov [eax+8], ecx End Asm End Function Function CPU_ID.brand () As String Dim As String*48 Proztyp = String(48," ") Asm mov eax, &H80000002 'Brand String 48Byte cpuid cmp eax, 0 'wenn eax=00 kein String jz noo_brand mov [Proztyp], eax mov [Proztyp+4], ebx mov [Proztyp+8], ecx mov [Proztyp+12], edx mov eax, &H80000003 cpuid mov [Proztyp+16], eax mov [Proztyp+20], ebx mov [Proztyp+24], ecx mov [Proztyp+28], edx mov eax, &H80000004 cpuid mov [Proztyp+32], eax mov [Proztyp+36], ebx mov [Proztyp+40], ecx mov [Proztyp+44], edx noo_brand: End Asm Function = Trim(Proztyp) End Function Function CPU_ID.Intel (erg As Integer) As Integer Dim As UInteger tmp, tmp1, tmp2 Asm mov eax, 1 cpuid mov [tmp],ecx Shr ebx, 16 And ebx, &h0ff mov [tmp2],ebx' LogicalProcessorCount End Asm If tmp And &H00000020 Then hat_vmx Yes 'Bit 5 If tmp And &H00000200 Then hat_ssse3 Yes 'Bit 9 If tmp And &H00100000 Then hat_SSE42 Yes 'Bit 20 If tmp2 > 1 Then 'IF LogicalProcessorCount If hat_HTT Then If erg >= 4 Then 'CPUID(0).EAX >= 4 Asm mov eax, 4 mov ecx, 0 cpuid Shr eax, 26 And eax, &h3F Inc eax mov [tmp],eax ' corcount End Asm If tmp2\tmp <2 Then hat_HTT No If tmp > 1 Then hat_cor = tmp EndIf EndIf Else hat_HTT No EndIf 'Test auf extended functions Asm mov eax,&h80000000 cpuid And eax, &h0fffffff mov [tmp], eax End Asm If tmp > 0 Then Asm mov eax,&h80000001 cpuid mov [tmp1],edx End Asm If tmp1 And &h20000000 Then Intel64 Yes 'Bit 29 End If If tmp > 3 Then CPU_typ= brand Function=tmp1 End Function Function CPU_ID.AMD () As Integer Dim As UInteger erg, tmp, tmp1 Dim As Byte mnc Asm mov eax, &h80000000 cpuid And eax, &h0fffffff mov [erg], eax End Asm 'Test auf extended functions If erg > 0 Then Asm mov eax,&h80000001 cpuid mov [tmp],edx mov [tmp1],ecx End Asm If tmp And &h00400000 Then hat_mmxe Yes 'Bit 22 If tmp And &h80000000 Then hat_3dNow Yes 'Bit 31 If tmp And &h40000000 Then hat_3dNowe Yes 'Bit 30 If tmp And &h20000000 Then AMD64 Yes 'Bit 29 If tmp1 And &h00000002 Then AMD_CmpLegacy Yes 'Bit 1 If tmp1 And &h00000040 Then hat_SSE4A Yes 'Bit 6 If tmp1 And &h00000800 Then hat_SSE5 Yes 'Bit 11 End If If erg > 3 Then CPU_typ= brand If hat_HTT And (erg >=8) Then Asm mov eax,&h80000008 cpuid mov [mnc], cl Shr ecx,12 And ecx,15 mov [tmp],ecx End Asm If tmp=0 Then hat_cor=mnc+1 Else hat_cor=(1 Shl tmp) EndIf End If Function=erg End Function Function CPU_ID.WinInfo ()As String Dim As String aus If hat_CPUID Then aus = "CPU typ : " & CPU_typ & cr aus += "Vendor : " + Vendor + cr aus += "family : " & family & cr If hat_CPUID Then aus += "model : " & model & cr aus += "stepping : " & Stepping & cr If hat_cor Then aus += "cores : " & hat_cor & cr If hat_mmx Then aus += " MMX" + ins If hat_mmxe Then aus += amde + " MMX" + ins If hat_3dNow Then aus += " 3DNow!" + ins If hat_3dNowe Then aus += amde + " 3DNow!" + ins If hat_sse Then aus += " SSE" + ins If hat_sse2 Then aus += " SSE2" + ins If hat_sse3 Then aus += " SSE3" + ins If hat_vmx Then aus += " VMX Virtual Machine" + ext + cr If hat_ssse3 Then aus += " SSSE3 Supplemental" + sim +" 3" + cr If Intel64 Then aus += " Intel 64 Instruction Set Architecture" + cr If AMD64 Then aus += " AMD64 Long Mode" + cr If hat_SSE4A Then aus += " SSE4A" + insu If hat_sse41 Then aus += " SSE4.1" + sim +" 4.1" + cr If hat_sse42 Then aus += " SSE4.2" + sim +" 4.2" + cr If hat_sse5 Then aus += " SSE5" + insu If hat_HTT Then aus += " Hyper-Threading Technology" + cr End If Function=aus End Function Dim cpu As CPU_ID MessageBox (0, cpu.WinInfo, "CPU_ID", MB_OK))

Windows - Versionsinfo


#Include "windows.bi" #Define No =0 #Define CrLf Chr(13, 10) #Define WTitel "Windows - Versionsinfo " + filename #Define E_ICON MB_OK Or MB_ICONERROR Dim Anzeige As String*4000 Dim As String filename = "Versionsinfo.exe"'Datei mit VersionsInfo Dim As Integer dwSize = GetFileVersionInfoSize( filename, NULL ) If dwSize No Then MessageBox (0, "Fehler, kein Versionsinfo!", WTitel, E_ICON) End EndIf Dim As String Buffer = String(dwSize, 0) If GetFileVersionInfo( filename, NULL, dwSize, StrPtr(Buffer) ) No Then MessageBox (0, "Fehler, im Versionsinfo!", WTitel, E_ICON) End EndIf Dim As Short Ptr xpFileInfo Dim As UInteger LenFileInfo If VerQueryValue( StrPtr(Buffer),"\\", @xpFileInfo, @LenFileInfo ) No Then MessageBox (0, "Fehler, im Versionsinfo!", WTitel, E_ICON) End EndIf Anzeige = "FileVersion : " & _ *(xpFileInfo+5) & "." & *(xpFileInfo+4) & "." & _ *(xpFileInfo+7) & "." & *(xpFileInfo+6) & CrLf Anzeige += "ProductVersion: " & _ *(xpFileInfo+9) & "." & *(xpFileInfo+8) & "." & _ *(xpFileInfo+11) & "." & *(xpFileInfo+10) & CrLf & CrLf ' CodePage und LanguageID auslesen Dim As Integer Ptr pvInfo Dim As Integer wInfoLen VerQueryValue(StrPtr(Buffer),"\\VarFileInfo\\Translation", @pvInfo,@wInfoLen ) Dim As String Lang_String = Hex(*pvInfo And &hffff, 4) + Hex(*pvInfo Shr 16, 4) Dim As String VerInfo(14) = {"CompanyName","FileDescription", _ "FileVersion","InternalName","LegalCopyright","LegalTrademarks",_ "OriginalFileName","PrivateBuild","ProductName","ProductVersion",_ "SpecialBuild","Comments","Language","Email","Website","Special"} Dim As String Buffer2 For i As Integer = 0 To 14 If VerQueryValue(StrPtr(Buffer), _ "\\StringFileInfo\\" + Lang_String + "\\" + VerInfo(i), _ @pvInfo, @wInfoLen) <> 0 Then Buffer2 = String(wInfoLen, 0) lstrcpy Buffer2, Cast(LPTSTR,pvInfo) Anzeige += VerInfo(i) + ": " + Buffer2 + CrLf End If Next MessageBox (0, Anzeige, WTitel, MB_OK)