16 bit API call to detect Windows NT version - help! 
Author Message
 16 bit API call to detect Windows NT version - help!

I have a VB3 application and wish to detect if it is running under
Windows NT. The following code detects Windows 3.x and 95 and 98 but
returns 3.1 as the version for Windows NT4.

Declare Function GetVersion Lib "Kernel" () As Long

Function windowsversion ()
    Dim ver As Long, winver As Integer
    ver = GetVersion()
    winver = CInt(ver And &HFFFF&)
    windowsversion = Val(Trim(Str(winver And &HFF)) & "." &
Trim(Str(CInt(winver / 256))))
End Function

Am I doing something wrong or is this not possible? Perhaps there is a
better way??

Thanks very much

  ,-._|\    David Aylott (Melbourne, Australia)

 \_,--.x/   Shareware, FAQ, hints & tips all at:
       v     http://www.*-*-*.com/ ~daylott/



Mon, 18 Mar 2002 03:00:00 GMT  
 16 bit API call to detect Windows NT version - help!


I have a VB3 application and wish to detect if it is running under
Windows NT. The following code detects Windows 3.x and 95 and 98 but
returns 3.1 as the version for Windows NT4.

Declare Function GetVersion Lib "Kernel" () As Long

Function windowsversion ()
    Dim ver As Long, winver As Integer
    ver = GetVersion()
    winver = CInt(ver And &HFFFF&)
    windowsversion = Val(Trim(Str(winver And &HFF)) & "." &
Trim(Str(CInt(winver / 256))))
End Function

The GetWinFlags API function call (which is obsolete in Win32) will do
this for you:

http://support.microsoft.com/support/kb/articles/Q122/3/53.asp

Paul
~~~~



Tue, 19 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to detect 16-bit Windows-based application running under Windows NT

2. API calls from ActiveX - must I make both 16 and 32 bit versions?l

3. HELP - detecting if windows in 256 or 16-bit color modes

4. 32 bit equivalent of 16 bit API call GetModuleUsage

5. 16 bit API calls in VB 3 supported in 32 bit VB 4.0

6. 16-bit/32-bit API calls

7. Launching and Monitoring a 16-bit Windows app from VB5 application running on Windows NT 4.0

8. Launching and Monitoring a 16-bit Windows app from VB5 application running on Windows NT 4.0

9. Version 4 16-bit to Version 4 32-bit

10. Calling 16 bit DLL from VB4 16 bit in Win 95

11. Help..-NT 4.0-ISA access with 16 Bit GFA and 32 Bit DLL

12. Detecting 16-bit task under NT 4.0

 

 
Powered by phpBB® Forum Software