home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / amovie / sdk / vbfix / ocxvb01.bas next >
Encoding:
BASIC Source File  |  1996-06-28  |  1.7 KB  |  75 lines

  1. Attribute VB_Name = "AMSample"
  2. ' ActiveMovie OCX Sample Code
  3. ' Copyright (c) 1996 Microsoft Corporation
  4. ' All Rights Reserved
  5.     
  6. Option Explicit
  7.  
  8. ' Counters for Timer, PositionChange, and StateChange events.
  9. Global g_cTimer As Long
  10. Global g_cPositionChange As Long
  11. Global g_cStateChange As Long
  12.  
  13. ' Tracks file name extension and whether or not a file is currently open.
  14. Global g_FileExtension As String
  15. Global g_FileOpened As Boolean
  16.     
  17.  
  18. Sub Main()
  19.  
  20.     ' Main entry point to ActiveMovie OCX Sample application.
  21.     
  22.     ' Load main form, position and show.
  23.     Load frmMain
  24.     With frmMain
  25.         .Top = Screen.Height * 0.05
  26.         .Left = Screen.Width * 0.05
  27.         .Visible = True
  28.     End With
  29.     
  30.     ' Load viewer form but don't show yet.
  31.     Load frmViewer
  32.     With frmViewer
  33.         .Visible = False
  34.         .Left = frmMain.Left + frmMain.Width
  35.         .Top = frmMain.Top
  36.     End With
  37.     
  38.     ' Initialize global variables.
  39.     g_FileOpened = False
  40.     g_FileExtension = ""
  41.     
  42. End Sub
  43.  
  44.  
  45. Sub ResizeViewer()
  46.  
  47.     ' Resize form to dimensions of ActiveMovie control + nonclient region.
  48.     With frmViewer
  49.         .Visible = False
  50.         .Height = .ActiveMovie1.Height + (.Height - .ScaleHeight)
  51.         .Width = .ActiveMovie1.Width + (.Width - .ScaleWidth)
  52.         .Visible = True
  53.     End With
  54.     
  55. End Sub
  56.  
  57.  
  58.  
  59. Sub UpdateStatusBar()
  60.  
  61.     ' Update the main form status bar to show the current number of events.
  62.  
  63.     With frmMain.StatusBar1
  64.          .Panels(1).Text = "Timer Events: " & g_cTimer
  65.          .Panels(2).Text = "State Changes: " & g_cStateChange
  66.          .Panels(3).Text = "Position Changes: " & g_cPositionChange
  67.     End With
  68.     
  69. End Sub
  70.  
  71.   
  72.  
  73.  
  74.  
  75.