home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / appx_c / playdays / playdays.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-01  |  4.0 KB  |  115 lines

  1. VERSION 5.00
  2. Begin VB.Form PlayDays 
  3.    Caption         =   "Play Days"
  4.    ClientHeight    =   4500
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1470
  7.    ClientWidth     =   4140
  8.    LinkTopic       =   "PlayWave"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   4500
  11.    ScaleWidth      =   4140
  12.    Begin VB.CommandButton Play 
  13.       Caption         =   "Sunday"
  14.       Height          =   495
  15.       Index           =   6
  16.       Left            =   720
  17.       TabIndex        =   6
  18.       Top             =   3720
  19.       Width           =   2535
  20.    End
  21.    Begin VB.CommandButton Play 
  22.       Caption         =   "Saturday"
  23.       Height          =   495
  24.       Index           =   5
  25.       Left            =   720
  26.       TabIndex        =   5
  27.       Top             =   3120
  28.       Width           =   2535
  29.    End
  30.    Begin VB.CommandButton Play 
  31.       Caption         =   "Friday"
  32.       Height          =   495
  33.       Index           =   4
  34.       Left            =   720
  35.       TabIndex        =   4
  36.       Top             =   2520
  37.       Width           =   2535
  38.    End
  39.    Begin VB.CommandButton Play 
  40.       Caption         =   "Thursday"
  41.       Height          =   495
  42.       Index           =   3
  43.       Left            =   720
  44.       TabIndex        =   3
  45.       Top             =   1920
  46.       Width           =   2535
  47.    End
  48.    Begin VB.CommandButton Play 
  49.       Caption         =   "Monday"
  50.       Height          =   495
  51.       Index           =   0
  52.       Left            =   720
  53.       TabIndex        =   2
  54.       Top             =   120
  55.       Width           =   2535
  56.    End
  57.    Begin VB.CommandButton Play 
  58.       Caption         =   "Wednesday"
  59.       Height          =   495
  60.       Index           =   2
  61.       Left            =   720
  62.       TabIndex        =   1
  63.       Top             =   1320
  64.       Width           =   2535
  65.    End
  66.    Begin VB.CommandButton Play 
  67.       Caption         =   "Tuesday"
  68.       Height          =   495
  69.       Index           =   1
  70.       Left            =   720
  71.       TabIndex        =   0
  72.       Top             =   720
  73.       Width           =   2535
  74.    End
  75. Attribute VB_Name = "PlayDays"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81. Private Declare Function mciSendString Lib "winmm.dll" _
  82.     Alias "mciSendStringA" (ByVal lpstrCommand As String, _
  83.     ByVal lpstrReturnString As String, _
  84.     ByVal uReturnLength As Long, _
  85.     ByVal hwndCallback As Long) As Long
  86. Private Sub Form_Unload(Cancel As Integer)
  87.     cmd = "close day"
  88.     errorCode = mciSendString(cmd, returnStr, 255, 0)
  89. End Sub
  90. Private Sub Play_Click(Index As Integer)
  91. Dim errorCode As Integer
  92. Dim returnStr As Integer
  93. Dim cmd As String * 255
  94.     ' make sure that device with the DAYS alias is open
  95.     cmd = "close days"
  96.     errorCode = mciSendString(cmd, returnStr, 255, 0)
  97.     ' now open the DAYS.WAV file as DAYS
  98.     cmd = "open " & Chr(34) & App.Path & "\days.wav " & Chr(34) & " type waveaudio alias days"
  99.     errorCode = mciSendString(cmd, returnStr, 255, 0)
  100.     If errorCode <> 0 Then
  101.         MsgBox "There was an error on opening the DAYS.WAV file." & vbCrLf _
  102.                & "Please make sure the DAYS.WAV file in the same folder as the application"
  103.         Exit Sub
  104.     End If
  105.     Select Case Index
  106.         Case 0: errorCode = mciSendString("play days from 150 to 850 wait", returnStr, 255, 0)
  107.         Case 1: errorCode = mciSendString("play days from 1200 to 1900 wait", returnStr, 255, 0)
  108.         Case 2: errorCode = mciSendString("play days from 2200 to 2900 wait", returnStr, 255, 0)
  109.         Case 3: errorCode = mciSendString("play days from 3100 to 4000 wait", returnStr, 255, 0)
  110.         Case 4: errorCode = mciSendString("play days from 4300 to 4900 wait", returnStr, 255, 0)
  111.         Case 5: errorCode = mciSendString("play days from 5100 to 5800 wait", returnStr, 255, 0)
  112.         Case 6: errorCode = mciSendString("play days from 6100 to 6800 wait", returnStr, 255, 0)
  113.     End Select
  114. End Sub
  115.