<html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> <p>The Api used for this are</p> <p>&nbsp;</p> <p>Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long </p> <p>Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 ' Maintenance string for PSS usage End Type</p> <p>The GetVersion Api just takes one parameter of type OSVERSIONINFO. The OSVERSIONINFO structure will contain all the details about the OS after GetVersionApi has been successfully executed. The parameters of&nbsp; OSVERSIONINFO are&nbsp;</p> <ul> <li>dwMajorVersion which gives info about the major version of the OS .This value is&nbsp; 3 for win Nt 3.51, 4 for win95/98/me and win nt4 and it is 5 for win2k.</li> <li>dwMinorVersion ,another parameter to differentiate the OS further .It is 0 for win 95,10 for win 98 ,98 for win ME,0&nbsp;&nbsp; for win2k ,0 for win nt4 and 51 for win nt 3.51</li> <li> dwPlatformId&nbsp; .This is an important parameter which helps in further differentiating the varios win OS.It is 1 for win 95/ 98/ME ,and 2 for win NT&nbsp;&nbsp;</li> </ul> <p>Once Declared we can use this in the following way</p> <p>Dim os As OSVERSIONINFO&nbsp;</p> <p> os.dwOSVersionInfoSize = Len(os)&nbsp;&nbsp;&nbsp;&nbsp; 'Assign some size to store the received information Dim m As Long Dim mv As Long Dim pd As Long Dim miv As Long m = GetVersionEx(os)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'The actual API call to GetVersionEx mv = os.dwMajorVersion pd = os.dwPlatformId miv = os.dwMinorVersion If pd = 2 Then MsgBox " OS is Windows NT" &amp; mv &amp; "." &amp; miv If pd = 1 Then If miv = 10 Then MsgBox " OS is Windows 98 " If miv = 0 Then MsgBox " OS is Windows 95 " If miv = 90 Then MsgBox " OS is Windows ME " End If</p> <p>This can be quite useful if you are making OS specific Applications. Send your comments to venky_dude@yahoo.com. .Visit my homepage for some cool VBcodes.&nbsp;&nbsp; </p> <p>&nbsp;</p> </body> </html>