home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / frmmenus.fr_ / frmmenus.bin
Text File  |  1993-04-28  |  3KB  |  106 lines

  1. VERSION 2.00
  2. Begin Form frmMenus 
  3.    Caption         =   "Form2"
  4.    Height          =   3450
  5.    Left            =   1290
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   2760
  8.    ScaleWidth      =   5145
  9.    Top             =   3720
  10.    Width           =   5265
  11.    Begin Menu mnuBar 
  12.       Caption         =   "Sounds"
  13.       Index           =   1
  14.       Begin Menu mnuSounds 
  15.          Caption         =   "(no sounds)"
  16.          Enabled         =   0   'False
  17.          Index           =   0
  18.       End
  19.    End
  20.    Begin Menu mnuBar 
  21.       Caption         =   "System Info"
  22.       Index           =   2
  23.       Begin Menu mnuSysInfo 
  24.          Caption         =   "&Windows"
  25.          Index           =   0
  26.       End
  27.       Begin Menu mnuSysInfo 
  28.          Caption         =   "&CPU"
  29.          Index           =   1
  30.       End
  31.       Begin Menu mnuSysInfo 
  32.          Caption         =   "&Video"
  33.          Index           =   2
  34.       End
  35.       Begin Menu mnuSysInfo 
  36.          Caption         =   "&General"
  37.          Index           =   3
  38.       End
  39.       Begin Menu mnuSysInfo 
  40.          Caption         =   "-"
  41.          Index           =   4
  42.       End
  43.       Begin Menu mnuSysInfo 
  44.          Caption         =   "Always on top"
  45.          Index           =   5
  46.       End
  47.    End
  48. End
  49. Option Explicit
  50.  
  51. Sub Form_Load ()
  52. Dim WinPath As String, SoundFile As String, i As Integer
  53.     WinPath = WindowsDirectory()
  54.     SoundFile = Dir(WinPath & "\" & "*.wav")
  55.     If WindowsVersion() > 3# Then
  56.         If waveOutGetNumDevs() = 0 Then
  57.             ' No wave output devices available.
  58.             mnuSounds(0).Caption = "No Wave audio device available"
  59.         ElseIf SoundFile = "" Then
  60.             ' No sound files in Windows directory
  61.             Exit Sub
  62.         Else
  63.             mnuSounds(0).Caption = Left(SoundFile, InStr(1, SoundFile, ".") - 1)
  64.             mnuSounds(0).Enabled = True
  65.             i = 1
  66.             Do
  67.                 SoundFile = Dir
  68.                 If SoundFile = "" Then Exit Do
  69.                 Load mnuSounds(i)
  70.                 mnuSounds(i).Caption = Left(SoundFile, InStr(1, SoundFile, ".") - 1)
  71.                 i = i + 1
  72.             Loop
  73.         End If
  74.     Else
  75.         ' Wave audio and "always on top" only available in Windows 3.1+
  76.         Unload mnuSysInfo(5)
  77.         Unload mnuSysInfo(4)
  78.     End If
  79. End Sub
  80.  
  81. Sub mnuSounds_Click (Index As Integer)
  82. Dim R As Integer
  83. Const SYNC = 1
  84.     R = sndPlaySound(ByVal CStr(WindowsDirectory() & "\" & mnuSounds(Index).Caption & ".wav"), SYNC)
  85. End Sub
  86.  
  87. Sub mnuSysInfo_Click (Index As Integer)
  88.     If Index <> 5 Then
  89.         If VisibleFrame Is Nothing Then
  90.             frmCallDlls!fraInfo(0).Visible = False
  91.         Else
  92.             VisibleFrame.Visible = False
  93.         End If
  94.         frmCallDlls!fraInfo(Index + 1).Visible = True
  95.         Set VisibleFrame = frmCallDlls!fraInfo(Index + 1)
  96.     Else
  97.         mnuSysInfo(Index).Checked = Not mnuSysInfo(Index).Checked
  98.         If mnuSysInfo(Index).Checked Then
  99.             SetWindowPos frmCallDlls.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW
  100.         Else
  101.             SetWindowPos frmCallDlls.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW
  102.         End If
  103.     End If
  104. End Sub
  105.  
  106.