home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / grafik / anmati / ring.txt < prev    next >
Encoding:
Text File  |  1995-02-27  |  1.1 KB  |  39 lines

  1. Declare Function sndPlaySound Lib "MMSYSTEM.DLL" (ByVal lpszSoundName As String, ByVal wFlags As Integer) As Integer
  2. 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
  3. Const SRCCOPY = &HCC0020
  4. Const SND_ASYNC = &H1
  5. Const SND_NODEFAULT = &H2
  6.  
  7. Sub Command1_Click ()
  8. Timer1.Enabled = True
  9. End Sub
  10.  
  11. Sub Timer1_Timer ()
  12. Static Ringing As Integer
  13. Dim Result As Integer
  14.  
  15. If Ringing Then
  16.     Result = BitBlt(Picture4.hDC, 0, 0, 32, 32, Picture2.hDC, 0, 0, SRCCOPY)
  17.     Timer2.Enabled = False
  18. Else
  19.     Result = sndPlaySound("c:\windows\ringin.wav", SND_ASYNC Or SND_NODEFAULT)
  20.     Timer2.Enabled = True
  21. End If
  22. Ringing = Not Ringing
  23.  
  24.     
  25. End Sub
  26.  
  27. Sub Timer2_Timer ()
  28. Static Toggle As Integer
  29. Dim Result As Integer
  30.  
  31. If Toggle Then
  32.     Result = BitBlt(Picture4.hDC, 0, 0, 32, 32, Picture1.hDC, 0, 0, SRCCOPY)
  33. Else
  34.     Result = BitBlt(Picture4.hDC, 0, 0, 32, 32, Picture3.hDC, 0, 0, SRCCOPY)
  35. End If
  36. Toggle = Not Toggle
  37. End Sub
  38.  
  39.