English
Source / code snippets

Api detect Windowsversion

 
Windowsversion detect through API:
CompileMarkSeparation
#################################
Windows-Version
Auslesen
#################################
Andreas Miethe * September 2003
#################################
Declare WinVer&,Winver$,WinVer!

Proc GetWinVersion

    Declare OS#
    Windows-Version ermitteln
    DEF &Ver_Platform_Win32_Windows 1
    DEF &Ver_Platform_Win32_NT 2
    Struct OSVERSIONINFO = dwOSVersionInfoSize&,dwMajorVersion&,dwMinorVersion&,dwBuildNumber&,dwPlatformId &,szCSDVersion$(128)
    Dim OS#,OSVERSIONINFO
    OS#.dwOSVersionInfoSize& = 148
    External(Kernel32,GetVersionExA,OS#)
    LET Winver& = 8

    If OS#.dwPlatformId& = &Ver_Platform_Win32_Windows

        If OS#.dwMajorVersion& = 4

            Case OS#.dwMinorVersion& = 0  : Winver& = 1
            Case OS#.dwMinorVersion& = 10 : Winver& = 2
            Case OS#.dwMinorVersion& = 90 : Winver& = 3

        Endif

    ElseIf OS#.dwPlatformId& = &Ver_Platform_Win32_NT

        Case OS#.dwMajorVersion& = 3 : Winver& = 4
        Case OS#.dwMajorVersion& = 4 : Winver& = 5
        Case OS#.dwMajorVersion& = 5 : Winver& = 6
        Case OS#.dwMinorVersion& = 1 : Winver& = 7

    Endif

    Dispose OS#
    case WinVer& = 1: Let Winver$=Win95
    case WinVer& = 2: Let Winver$=Win98
    case WinVer& = 3: Let Winver$=WinME
    case WinVer& = 4: Let Winver$=Win_NT_3.5
    case WinVer& = 5: Let Winver$=Win_NT_4
    case WinVer& = 6: Let Winver$=Win2000
    case WinVer& = 7: Let Winver$=WinXP
    case WinVer& = 8: Let Winver$=Win-Unbekannt
    LET WINVER!=@VAL($WINVER)
    CASE @or(WINVER&=4,Winver!=5) : LET WINVER!=5.01

EndProc

Getwinversion
Print WInVer$
waitinput
Vielen Thanks Andreas!

salvo, iF.
 
08/23/05  
 




Jac
de
Lad
and something extended:
CompileMarkSeparation
#################################
Windows-Version
Auslesen
#################################
Andreas Miethe * September 2003
#################################
Declare Winver&,Winver$,Winver!

Proc Getwinversion

    Declare Os#
    Windows-Version ermitteln
    Def &Ver_platform_win32_windows 1
    Def &Ver_platform_win32_nt 2
    Struct Osversioninfo = Dwosversioninfosize&,Dwmajorversion&,Dwminorversion&,Dwbuildnumber&,Dwplatformid &,Szcsdversion$(128)
    Dim Os#,Osversioninfo
    Os#.Dwosversioninfosize& = 148
    External(Kernel32,GetVersionExA,Os#)
    Let Winver& = 10

    If Os#.Dwplatformid& = &Ver_platform_win32_windows

        If Os#.Dwmajorversion& = 4

            Case Os#.Dwminorversion& = 0 : Winver& = 1
            Case Os#.Dwminorversion& = 10 : Winver& = 2
            Case Os#.Dwminorversion& = 90 : Winver& = 3

        Endif

    Elseif Os#.Dwplatformid& = &Ver_platform_win32_nt

        Case Os#.Dwmajorversion& = 3 : Winver& = 4
        Case Os#.Dwmajorversion& = 4 : Winver& = 5
        Case Os#.Dwmajorversion& = 5 : Winver& = 6
        Case (Os#.Dwminorversion& = 1) & (WinVer&=6): Winver& = 7
        Case Os#.Dwmajorversion& = 6 : Winver& = 8
        Case (Os#.Dwminorversion& = 1) & (WinVer&=8): Winver& = 9

    Endif

    Dispose Os#
    Case Winver& = 1: Let Winver$=Win95
    Case Winver& = 2: Let Winver$=Win98
    Case Winver& = 3: Let Winver$=WinME
    Case Winver& = 4: Let Winver$=Win_NT_3.5
    Case Winver& = 5: Let Winver$=Win_NT_4
    Case Winver& = 6: Let Winver$=Win2000
    Case Winver& = 7: Let Winver$=WinXP
    Case Winver& = 8: Let Winver$=WinVista
    Case Winver& = 9: Let Winver$=WinVistaSP1
    Case Winver& = 10: Let Winver$=Win-Unbekannt
    Let Winver!=@Val($Winver)
    Case @Or(Winver&=4,Winver!=5) : Let Winver!=5.01

Endproc

Getwinversion
Print Winver$
Waitinput

I personally would but the investigation over $WinVer prefer (can but not between 95 and NT4 discern):
CompileMarkSeparation
Jac
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
02/20/08  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.163 Views

Untitledvor 0 min.
ByteAttack09/05/21
boh105/14/13
maxpayne200102/23/13
Wilfried Friebe03/30/12
More...

Themeninformationen

this Topic has 2 subscriber:

Jac de Lad (1x)
iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie