home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch08 / playbeep / playbeep.frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-02-20  |  2.4 KB  |  75 lines

  1. VERSION 5.00
  2. Begin VB.Form PlayBeep 
  3.    Caption         =   "PlayBeep"
  4.    ClientHeight    =   3750
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1470
  7.    ClientWidth     =   2655
  8.    LinkTopic       =   "PlayWave"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   3750
  11.    ScaleWidth      =   2655
  12.    Begin VB.OptionButton SndOption 
  13.       Caption         =   "System Exclamation"
  14.       Height          =   375
  15.       Index           =   3
  16.       Left            =   240
  17.       TabIndex        =   4
  18.       Top             =   1680
  19.       Width           =   2055
  20.    End
  21.    Begin VB.OptionButton SndOption 
  22.       Caption         =   "System Question"
  23.       Height          =   375
  24.       Index           =   2
  25.       Left            =   240
  26.       TabIndex        =   3
  27.       Top             =   1200
  28.       Width           =   2055
  29.    End
  30.    Begin VB.OptionButton SndOption 
  31.       Caption         =   "System Asterisk"
  32.       Height          =   375
  33.       Index           =   1
  34.       Left            =   240
  35.       TabIndex        =   2
  36.       Top             =   720
  37.       Width           =   2055
  38.    End
  39.    Begin VB.OptionButton SndOption 
  40.       Caption         =   "System Default"
  41.       Height          =   375
  42.       Index           =   0
  43.       Left            =   240
  44.       TabIndex        =   1
  45.       Top             =   240
  46.       Value           =   -1  'True
  47.       Width           =   2055
  48.    End
  49.    Begin VB.CommandButton Play 
  50.       Caption         =   "Play Beep"
  51.       Height          =   735
  52.       Left            =   480
  53.       TabIndex        =   0
  54.       Top             =   2880
  55.       Width           =   1695
  56.    End
  57. Attribute VB_Name = "PlayBeep"
  58. Attribute VB_GlobalNameSpace = False
  59. Attribute VB_Creatable = False
  60. Attribute VB_PredeclaredId = True
  61. Attribute VB_Exposed = False
  62. Option Explicit
  63.     Private Declare Function MessageBeep Lib "User32" _
  64.                 (ByVal alertLevel As Integer) As Integer
  65.     Const MB_OK = 0
  66.     Const MB_ICONQUESTION = &H30
  67.     Const MB_ICONASTERISK = &H40
  68.     Const MB_ICONEXCLAMATION = &H20
  69. Private Sub Play_Click()
  70.     If SndOption(0) = -1 Then MessageBeep (MB_OK)
  71.     If SndOption(1) = -1 Then MessageBeep (MB_ICONASTERISK)
  72.     If SndOption(2) = -1 Then MessageBeep (MB_ICONQUESTION)
  73.     If SndOption(3) = -1 Then MessageBeep (MB_ICONEXCLAMATION)
  74. End Sub
  75.