home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l407 / 4.ddi / ANIMATE.FR_ / ANIMATE.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  5.0 KB  |  163 lines

  1. VERSION 2.00
  2. Begin Form Animate 
  3.    BackColor       =   &H00404040&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "MCI Animation Theater"
  6.    ClientHeight    =   5790
  7.    ClientLeft      =   1065
  8.    ClientTop       =   705
  9.    ClientWidth     =   7695
  10.    Height          =   6480
  11.    Left            =   1005
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form3"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5790
  17.    ScaleWidth      =   7695
  18.    Top             =   75
  19.    Width           =   7815
  20.    Begin MMControl MMControl1 
  21.       EjectVisible    =   0   'False
  22.       Height          =   495
  23.       Left            =   2520
  24.       RecordVisible   =   0   'False
  25.       TabIndex        =   1
  26.       Top             =   5040
  27.       Width           =   2760
  28.    End
  29.    Begin Frame Frame1 
  30.       BackColor       =   &H00808080&
  31.       Height          =   4860
  32.       Left            =   120
  33.       TabIndex        =   0
  34.       Top             =   -120
  35.       Width           =   7455
  36.       Begin Frame Frame3 
  37.          BackColor       =   &H00000080&
  38.          Caption         =   "(((((((((((((((((((((((((((((((((((((((((((((((((((((((("
  39.          Height          =   4695
  40.          Left            =   3720
  41.          TabIndex        =   3
  42.          Top             =   120
  43.          Width           =   3720
  44.       End
  45.       Begin PictureBox Picture1 
  46.          Height          =   4695
  47.          Left            =   720
  48.          ScaleHeight     =   4665
  49.          ScaleWidth      =   5865
  50.          TabIndex        =   4
  51.          Top             =   120
  52.          Visible         =   0   'False
  53.          Width           =   5895
  54.       End
  55.       Begin Frame Frame2 
  56.          BackColor       =   &H00000080&
  57.          Caption         =   ")))))))))))))))))))))))))))))))))))))))))))))))))))))))))"
  58.          Height          =   4695
  59.          Left            =   0
  60.          TabIndex        =   2
  61.          Top             =   120
  62.          Width           =   3720
  63.       End
  64.    End
  65.    Begin Menu AL_FILE 
  66.       Caption         =   "&File"
  67.       Begin Menu AI_OPEN 
  68.          Caption         =   "&Open..."
  69.       End
  70.       Begin Menu AI_SEPARATOR 
  71.          Caption         =   "-"
  72.       End
  73.       Begin Menu AI_EXIT 
  74.          Caption         =   "&Exit"
  75.       End
  76.    End
  77. Dim HwndFrame As Integer
  78. Dim CurtainFlag As Integer
  79. Sub AI_EXIT_Click ()
  80.     Unload Animate
  81. End Sub
  82. Sub AI_OPEN_Click ()
  83.     ' Display the "File Open..." dialog.
  84.     OpenDlg.CMDialog1.FilterIndex = 1
  85.     OpenDlg.CMDialog1.Flags = OFN_READONLY Or OFN_FILEMUSTEXIST
  86.     OpenDlg.CMDialog1.CancelError = True
  87.     OpenDlg.CMDialog1.FileName = ""
  88.     On Error Resume Next
  89.     OpenDlg.CMDialog1.Action = 1
  90.     If Err <> 0 Then
  91.         ' No file selected in the "File Open..." dialog.
  92.         Exit Sub
  93.     End If
  94.     ' If the device is already open, close it.
  95.     If Not mmcontrol1.Mode = MCI_MODE_NOT_OPEN Then
  96.         mmcontrol1.Command = "Close"
  97.     End If
  98.     ' Open the device with the new filename.
  99.     mmcontrol1.FileName = OpenDlg.CMDialog1.FileName
  100.     caption = DialogCaption + mmcontrol1.FileName
  101.     'Attempt to open the Animation device
  102.     On Error Resume Next
  103.     mmcontrol1.Command = "Open"
  104.     'If the open faild, try the MMMovie device name
  105.     If Err = MCIERR_DEVICE_OPEN Then
  106.         mmcontrol1.DeviceType = "MMMovie"
  107.         If Not mmcontrol1.Mode = MCI_MODE_NOT_OPEN Then
  108.            mmcontrol1.Command = "Close"
  109.         End If
  110.         On Error GoTo MCI_ERROR
  111.         mmcontrol1.Command = "Open"
  112.     End If
  113.     ' If the curtains haven't been opened, open them.
  114.     If CurtainFlag = False Then
  115.         OpenCurtain
  116.     End If
  117.     ' Play the movie into the picture control.
  118.     On Error GoTo MCI_ERROR
  119.     mmcontrol1.Command = "Play"
  120.     On Error GoTo 0
  121.     Exit Sub
  122. MCI_ERROR:
  123.     DisplayErrorMessageBox
  124.     Resume MCI_EXIT
  125. MCI_EXIT:
  126.     Unload Animate
  127. End Sub
  128. Sub Form_Load ()
  129.     CurtainFlag = False
  130. End Sub
  131. Sub Form_Unload (Cancel As Integer)
  132.              
  133.     If Not mmcontrol1.Mode = MCI_MODE_NOT_OPEN Then
  134.         mmcontrol1.Command = "CLOSE"
  135.     End If
  136.     MCITest.Show
  137. End Sub
  138. ' This subroutine moves the frame controls slightly
  139. ' to the left and right to simulate curtains opening.
  140. Sub OpenCurtain ()
  141.     Dim i As Integer
  142.     For i = 1 To 25
  143.         frame2.Left = frame2.Left - 100
  144.         frame3.Left = frame3.Left + 100
  145.     Next i
  146.     ' Display the picture control.
  147.     Picture1.Visible = True
  148.     WaitForEventsToFinish 50
  149.     ' Set the focus to the picture control, so that the
  150.     ' hwnd for the picture control can be retrieved.
  151.     Picture1.SetFocus
  152.     WaitForEventsToFinish 50
  153.     ' Play the movie in this control rather than playing
  154.     ' the movie in a default popup window.
  155.     mmcontrol1.hWndDisplay = HwndFrame
  156.     ' Once the curtain is opened, don't open it again.
  157.     CurtainFlag = True
  158. End Sub
  159. Sub Picture1_GotFocus ()
  160.     ' The movie is played into this control.
  161.     HwndFrame = GetFocus()
  162. End Sub
  163.