home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / COMPTOOL / CALLDLLS / FRMMENUS.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1996-12-03  |  4.0 KB  |  121 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMenus 
  3.    Caption         =   "Form2"
  4.    ClientHeight    =   2430
  5.    ClientLeft      =   4845
  6.    ClientTop       =   5640
  7.    ClientWidth     =   5175
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form2"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2430
  20.    ScaleWidth      =   5175
  21.    Begin VB.Menu mnuBar 
  22.       Caption         =   "Sounds"
  23.       Index           =   1
  24.       Begin VB.Menu mnuSounds 
  25.          Caption         =   "(no sounds)"
  26.          Enabled         =   0   'False
  27.          Index           =   0
  28.       End
  29.    End
  30.    Begin VB.Menu mnuBar 
  31.       Caption         =   "System Info"
  32.       Index           =   2
  33.       Begin VB.Menu mnuSysInfo 
  34.          Caption         =   "&Windows"
  35.          Index           =   0
  36.       End
  37.       Begin VB.Menu mnuSysInfo 
  38.          Caption         =   "&CPU"
  39.          Index           =   1
  40.       End
  41.       Begin VB.Menu mnuSysInfo 
  42.          Caption         =   "&Video"
  43.          Index           =   2
  44.       End
  45.       Begin VB.Menu mnuSysInfo 
  46.          Caption         =   "&General"
  47.          Index           =   3
  48.       End
  49.       Begin VB.Menu mnuSysInfo 
  50.          Caption         =   "-"
  51.          Index           =   4
  52.       End
  53.       Begin VB.Menu mnuSysInfo 
  54.          Caption         =   "Always on top"
  55.          Index           =   5
  56.       End
  57.    End
  58. Attribute VB_Name = "frmMenus"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Option Explicit
  64. Private Sub Form_Load()
  65. Dim WinPath As String, SoundFile As String, i As Integer
  66.     WinPath = WindowsDirectory()
  67.     'This can be changed to ..Windows\Media\*.wav for Win95
  68.     SoundFile = Dir(WinPath & "\*.wav")
  69.     If waveOutGetNumDevs() = 0 Then
  70.         ' No wave output devices available.
  71.         mnuSounds(0).Caption = "No Wave audio device available"
  72.     ElseIf SoundFile = "" Then
  73.         ' No sound files in Windows directory
  74.         Exit Sub
  75.     Else
  76.         mnuSounds(0).Caption = Left(SoundFile, InStr(1, SoundFile, ".") - 1)
  77.         mnuSounds(0).Enabled = True
  78.         i = 1
  79.         Do
  80.             SoundFile = Dir
  81.             If SoundFile = "" Then Exit Do
  82.             Load mnuSounds(i)
  83.             mnuSounds(i).Caption = Left(SoundFile, InStr(1, SoundFile, ".") - 1)
  84.             i = i + 1
  85.         Loop
  86.     End If
  87. End Sub
  88. Private Sub mnuSounds_Click(Index As Integer)
  89. Dim R As Integer
  90. Const SYNC = 1
  91.     R = sndPlaySound(ByVal CStr(WindowsDirectory() & "\" & mnuSounds(Index).Caption & ".wav"), SYNC)
  92. End Sub
  93. Private Sub mnuSysInfo_Click(Index As Integer)
  94. Static iPrevious As Integer
  95.     If Index <> 5 Then
  96.         
  97.         If VisibleFrame Is Nothing Then
  98.             frmCallDlls.fraInfo(0).Visible = False
  99.         Else
  100.             VisibleFrame.Visible = False
  101.         End If
  102.         frmCallDlls.fraInfo(Index + 1).Visible = True
  103.         Set VisibleFrame = frmCallDlls.fraInfo(Index + 1)
  104.     Else
  105.         mnuSysInfo(Index).Checked = Not mnuSysInfo(Index).Checked
  106.         
  107.         If mnuSysInfo(Index).Checked Then
  108.            SetWindowPos frmCallDlls.hWnd, HWND_TOPMOST, frmCallDlls.Left / 15, _
  109.                         frmCallDlls.Top / 15, frmCallDlls.Width / 15, _
  110.                         frmCallDlls.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW
  111.         Else
  112.            SetWindowPos frmCallDlls.hWnd, HWND_NOTOPMOST, frmCallDlls.Left / 15, _
  113.                         frmCallDlls.Top / 15, frmCallDlls.Width / 15, _
  114.                         frmCallDlls.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW
  115.         End If
  116.     End If
  117.     If Index = 3 Then
  118.         frmCallDlls.fraInfo(4).Visible = False
  119.     End If
  120. End Sub
  121.