home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / grafik / anmati / ring.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-27  |  3.7 KB  |  116 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    ClientHeight    =   2205
  5.    ClientLeft      =   4050
  6.    ClientTop       =   3000
  7.    ClientWidth     =   4155
  8.    ControlBox      =   0   'False
  9.    Height          =   2730
  10.    Left            =   3990
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2205
  15.    ScaleWidth      =   4155
  16.    Top             =   2535
  17.    Width           =   4275
  18.    Begin PictureBox Picture3 
  19.       AutoRedraw      =   -1  'True
  20.       AutoSize        =   -1  'True
  21.       BorderStyle     =   0  'None
  22.       Height          =   480
  23.       Left            =   1200
  24.       Picture         =   RING.FRX:0000
  25.       ScaleHeight     =   480
  26.       ScaleWidth      =   480
  27.       TabIndex        =   3
  28.       Top             =   1320
  29.       Width           =   480
  30.    End
  31.    Begin PictureBox Picture1 
  32.       AutoRedraw      =   -1  'True
  33.       AutoSize        =   -1  'True
  34.       BorderStyle     =   0  'None
  35.       Height          =   480
  36.       Left            =   720
  37.       Picture         =   RING.FRX:0302
  38.       ScaleHeight     =   480
  39.       ScaleWidth      =   480
  40.       TabIndex        =   0
  41.       Top             =   1320
  42.       Width           =   480
  43.    End
  44.    Begin PictureBox Picture4 
  45.       AutoSize        =   -1  'True
  46.       BorderStyle     =   0  'None
  47.       Height          =   495
  48.       Left            =   480
  49.       ScaleHeight     =   495
  50.       ScaleWidth      =   495
  51.       TabIndex        =   4
  52.       Top             =   720
  53.       Width           =   495
  54.    End
  55.    Begin Timer Timer2 
  56.       Enabled         =   0   'False
  57.       Interval        =   50
  58.       Left            =   1920
  59.       Top             =   480
  60.    End
  61.    Begin Timer Timer1 
  62.       Enabled         =   0   'False
  63.       Interval        =   600
  64.       Left            =   1800
  65.       Top             =   240
  66.    End
  67.    Begin CommandButton Command1 
  68.       Caption         =   "Ring my Bell"
  69.       Height          =   495
  70.       Left            =   120
  71.       TabIndex        =   2
  72.       Top             =   120
  73.       Width           =   1215
  74.    End
  75.    Begin PictureBox Picture2 
  76.       AutoRedraw      =   -1  'True
  77.       AutoSize        =   -1  'True
  78.       BorderStyle     =   0  'None
  79.       Height          =   480
  80.       Left            =   240
  81.       Picture         =   RING.FRX:0604
  82.       ScaleHeight     =   480
  83.       ScaleWidth      =   480
  84.       TabIndex        =   1
  85.       Top             =   1320
  86.       Width           =   480
  87.    End
  88. Declare Function sndPlaySound Lib "MMSYSTEM.DLL" (ByVal lpszSoundName As String, ByVal wFlags As Integer) As Integer
  89. Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  90. Const SRCCOPY = &HCC0020
  91. Const SND_ASYNC = &H1
  92. Const SND_NODEFAULT = &H2
  93. Sub Command1_Click ()
  94. Timer1.Enabled = True
  95. End Sub
  96. Sub Timer1_Timer ()
  97. Static Ringing As Integer
  98. Dim Result As Integer
  99. If Ringing Then
  100.     Result = BitBlt(Picture4.hDC, 0, 0, 32, 32, Picture2.hDC, 0, 0, SRCCOPY)
  101.     Timer2.Enabled = False
  102.     Result = sndPlaySound("c:\windows\ringin.wav", SND_ASYNC Or SND_NODEFAULT)
  103.     Timer2.Enabled = True
  104. End If
  105. Ringing = Not Ringing
  106. End Sub
  107. Sub Timer2_Timer ()
  108. Static Toggle As Integer
  109. Dim Result As Integer
  110. If Toggle Then
  111.     Result = BitBlt(Picture4.hDC, 0, 0, 32, 32, Picture1.hDC, 0, 0, SRCCOPY)
  112.     Result = BitBlt(Picture4.hDC, 0, 0, 32, 32, Picture3.hDC, 0, 0, SRCCOPY)
  113. End If
  114. Toggle = Not Toggle
  115. End Sub
  116.