1. Windows Versions

Hey all,

I have a question regarding OS Versions under Windows.
Are XP and .Net Server the same thing? I know this may sound
really silly to someone who knows right off but I cant seem to
find an answer readily available on the iNet.

BTW, here's code that should detect all of the Windows OS vers
If anyone has a better way please let me know.

<snip...>

atom OSVersion, ptOS, junk, major, minor, build, platf
global sequence OS

   OSVersion = link_c_func(kernel32, "GetVersionExA", {C_POINTER}, C_INT)

   ptOS = allocate( 148 )
   poke4(ptOS,148)
   junk = c_func(OSVersion, { ptOS } )
   
   major = peek4u(ptOS+4)
   minor = peek4u(ptOS+8)
   build = peek4u(ptOS+12)
   platf = peek4u(ptOS+16)
   
   if major = 3 then --NT3.51
      OS = "Windows NT 3.51"
   elsif major = 4 then --95,98,ME,NT4
      if minor = 0 then
         if platf = 0 then
            OS = "Windows 95"
         elsif platf = 2 then
            OS = "Windows NT 4.0"
         end if             
      elsif minor = 10 then
            OS = "Windows 98"
      elsif minor = 90 then
            OS = "Windows ME"
      end if    
   elsif major = 5 then --2k,XP,.Net Server
      if minor = 0 then
         OS = "Windows 2000"
      elsif minor = 1 then
         OS = "Windows XP or .Net Server"
      end if
   end if
   
   free(ptOS)

<...snip>

TIA,

Euman
euman at bellsouth.net

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu