home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol10n17.zip / WINVER.ZIP / WINVER4 < prev   
Text File  |  1991-09-12  |  1KB  |  40 lines

  1. REM WinVer4
  2.  
  3. Declare Function GetVersion Lib "kernel" () As Integer
  4. Declare Function GetWinFlags Lib "kernel" () As Long
  5. Declare Function GetSystemMetrics Lib "user" (nIndex As Integer) As Integer
  6. Declare Function GetActiveWindow Lib "user" () As Integer
  7. Declare Sub SendMessage Lib "user" (hWnd As Integer, wMsg As Integer, \
  8.     wParam As Integer, lParam As String)   ' instead of As Long
  9.  
  10. Function LO(x)
  11.     LO = x Mod 256
  12. End Function
  13.  
  14. Function HI(x)
  15.     HI = Int(x / 256)
  16. End Function
  17.  
  18. Sub MAIN
  19.     FileNew
  20.     Font "Helv", 18         ' big font
  21.     hwnd = GetActiveWindow
  22.     wmSetText = 12          ' WM_SETTEXT message
  23.     SendMessage hwnd, wmSetText, 0, "WordBASIC WINVER"
  24.  
  25.     v = GetVersion
  26.     ' use Mid$(s,2) because Str$() produces leading space
  27.     Insert "Windows v. " + Mid$(Str$(LO(v)), 2) + "." + Mid$(Str$(HI(v)), 2)
  28.     ' Insert inserts string into the document created above with FileNew
  29.  
  30.     debug = GetSystemMetrics(22)   ' SM_DEBUG
  31.     If debug Then Insert " (Debug)"
  32.     Insert Chr$(11)                ' newline; InsertPara loses font
  33.  
  34.     flags = GetWinFlags
  35.     If flags And 1 = 0 Then Insert "Real mode"
  36.     If flags And 16 Then Insert "Standard (286) mode"
  37.     If flags And 32 Then Insert "Enhanced (386) mode"
  38.     Insert Chr$(11)
  39. End Sub
  40.