Results 1 to 5 of 5

Thread: how to recognize the op system on which my program running?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    how to recognize the op system on which my program running?

    how to recognize the op system on which my program running?

    I need to examine if my program is run on win98.

    plz help

  2. #2

  3. #3
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: how to recognize the op system on which my program running?

    This might help also.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    Re: how to recognize the op system on which my program running?

    thx for that

  5. #5
    Member
    Join Date
    Jun 2004
    Location
    Puerto Rico
    Posts
    43

    Re: how to recognize the op system on which my program running?

    There is actually an API for that... I will post up some code for it...

    <<I got this code from API Guide... I take no credit for it. I suggest all of you download API Guide since it contains a list of all the APIs and examples of how to use them >>

    VB Code:
    1. Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
    2. Private Type OSVERSIONINFO
    3.     dwOSVersionInfoSize As Long
    4.     dwMajorVersion As Long
    5.     dwMinorVersion As Long
    6.     dwBuildNumber As Long
    7.     dwPlatformId As Long
    8.     szCSDVersion As String * 128
    9. End Type
    10. Private Sub Form_Load()
    11.     Dim OSInfo As OSVERSIONINFO, PId As String
    12.     'KPD-Team 1998
    13.     'URL: [url]http://www.allapi.net/[/url]
    14.     'Set the graphical mode to persistent
    15.     Me.AutoRedraw = True
    16.     'Set the structure size
    17.     OSInfo.dwOSVersionInfoSize = Len(OSInfo)
    18.     'Get the Windows version
    19.     Ret& = GetVersionEx(OSInfo)
    20.     'Chack for errors
    21.     If Ret& = 0 Then MsgBox "Error Getting Version Information": Exit Sub
    22.     'Print the information to the form
    23.     Select Case OSInfo.dwPlatformId
    24.         Case 0
    25.             PId = "Windows 32s "
    26.         Case 1
    27.             PId = "Windows 95/98"
    28.         Case 2
    29.             PId = "Windows NT "
    30.     End Select
    31.     Print "OS: " + PId
    32.     Print "Win version:" + Str$(OSInfo.dwMajorVersion) + "." + LTrim(Str(OSInfo.dwMinorVersion))
    33.     Print "Build: " + Str(OSInfo.dwBuildNumber)
    34. End Sub

    Any problems post up

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width