home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Flash_Play20388312222006.psc / frmMain.frm < prev    next >
Text File  |  2006-12-22  |  18KB  |  574 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{D27CDB6B-AE6D-11CF-96B8-444553540000}#1.0#0"; "Flash.ocx"
  4. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  5. Begin VB.Form Form1 
  6.    Caption         =   "Flash Player "
  7.    ClientHeight    =   6555
  8.    ClientLeft      =   165
  9.    ClientTop       =   735
  10.    ClientWidth     =   8865
  11.    Icon            =   "frmMain.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7283.333
  14.    ScaleMode       =   0  'User
  15.    ScaleWidth      =   8865
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin ShockwaveFlashObjectsCtl.ShockwaveFlash swf 
  18.       Height          =   4815
  19.       Left            =   120
  20.       TabIndex        =   0
  21.       Top             =   0
  22.       Width           =   4095
  23.       _cx             =   7223
  24.       _cy             =   8493
  25.       FlashVars       =   ""
  26.       Movie           =   ""
  27.       Src             =   ""
  28.       WMode           =   "Window"
  29.       Play            =   -1  'True
  30.       Loop            =   -1  'True
  31.       Quality         =   "High"
  32.       SAlign          =   ""
  33.       Menu            =   -1  'True
  34.       Base            =   ""
  35.       AllowScriptAccess=   "always"
  36.       Scale           =   "ShowAll"
  37.       DeviceFont      =   0   'False
  38.       EmbedMovie      =   0   'False
  39.       BGColor         =   "000000"
  40.       SWRemote        =   ""
  41.       MovieData       =   ""
  42.       SeamlessTabbing =   -1  'True
  43.    End
  44.    Begin MSComctlLib.ImageList ImageList3 
  45.       Left            =   4200
  46.       Top             =   2880
  47.       _ExtentX        =   1005
  48.       _ExtentY        =   1005
  49.       BackColor       =   -2147483643
  50.       ImageWidth      =   28
  51.       ImageHeight     =   28
  52.       MaskColor       =   12632256
  53.       _Version        =   393216
  54.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  55.          NumListImages   =   6
  56.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  57.             Picture         =   "frmMain.frx":17D2A
  58.             Key             =   ""
  59.          EndProperty
  60.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  61.             Picture         =   "frmMain.frx":180D4
  62.             Key             =   ""
  63.          EndProperty
  64.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  65.             Picture         =   "frmMain.frx":184CE
  66.             Key             =   ""
  67.          EndProperty
  68.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  69.             Picture         =   "frmMain.frx":18897
  70.             Key             =   ""
  71.          EndProperty
  72.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  73.             Picture         =   "frmMain.frx":18D2E
  74.             Key             =   ""
  75.          EndProperty
  76.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  77.             Picture         =   "frmMain.frx":190C8
  78.             Key             =   ""
  79.          EndProperty
  80.       EndProperty
  81.    End
  82.    Begin VB.Timer Timer2 
  83.       Interval        =   250
  84.       Left            =   5040
  85.       Top             =   1080
  86.    End
  87.    Begin MSComctlLib.ImageList ImageList2 
  88.       Left            =   1440
  89.       Top             =   2160
  90.       _ExtentX        =   1005
  91.       _ExtentY        =   1005
  92.       BackColor       =   -2147483643
  93.       ImageWidth      =   16
  94.       ImageHeight     =   16
  95.       MaskColor       =   12632256
  96.       _Version        =   393216
  97.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  98.          NumListImages   =   3
  99.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  100.             Picture         =   "frmMain.frx":195B4
  101.             Key             =   "Icon"
  102.          EndProperty
  103.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  104.             Picture         =   "frmMain.frx":199E3
  105.             Key             =   "Iconz"
  106.          EndProperty
  107.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  108.             Picture         =   "frmMain.frx":19E12
  109.             Key             =   "Icons"
  110.          EndProperty
  111.       EndProperty
  112.    End
  113.    Begin VB.Timer Timer1 
  114.       Interval        =   1000
  115.       Left            =   3960
  116.       Top             =   2040
  117.    End
  118.    Begin MSComctlLib.Slider sld 
  119.       Height          =   375
  120.       Left            =   0
  121.       TabIndex        =   3
  122.       Top             =   4800
  123.       Width           =   8055
  124.       _ExtentX        =   14208
  125.       _ExtentY        =   661
  126.       _Version        =   393216
  127.       LargeChange     =   1
  128.       Max             =   100
  129.       TickStyle       =   3
  130.    End
  131.    Begin MSComDlg.CommonDialog dlg 
  132.       Left            =   2640
  133.       Top             =   1200
  134.       _ExtentX        =   847
  135.       _ExtentY        =   847
  136.       _Version        =   393216
  137.    End
  138.    Begin MSComctlLib.ImageList ImageList1 
  139.       Left            =   3840
  140.       Top             =   3720
  141.       _ExtentX        =   1005
  142.       _ExtentY        =   1005
  143.       BackColor       =   -2147483643
  144.       ImageWidth      =   32
  145.       ImageHeight     =   32
  146.       MaskColor       =   12632256
  147.       _Version        =   393216
  148.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  149.          NumListImages   =   6
  150.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  151.             Picture         =   "frmMain.frx":31B4C
  152.             Key             =   ""
  153.          EndProperty
  154.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  155.             Picture         =   "frmMain.frx":37CD6
  156.             Key             =   ""
  157.          EndProperty
  158.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  159.             Picture         =   "frmMain.frx":380D0
  160.             Key             =   ""
  161.          EndProperty
  162.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  163.             Picture         =   "frmMain.frx":3E932
  164.             Key             =   ""
  165.          EndProperty
  166.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  167.             Picture         =   "frmMain.frx":44ABC
  168.             Key             =   ""
  169.          EndProperty
  170.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  171.             Picture         =   "frmMain.frx":44E56
  172.             Key             =   ""
  173.          EndProperty
  174.       EndProperty
  175.    End
  176.    Begin MSComctlLib.Toolbar Toolbar 
  177.       Align           =   2  'Align Bottom
  178.       Height          =   600
  179.       Left            =   0
  180.       TabIndex        =   2
  181.       Top             =   5955
  182.       Width           =   8865
  183.       _ExtentX        =   15637
  184.       _ExtentY        =   1058
  185.       ButtonWidth     =   1032
  186.       ButtonHeight    =   1005
  187.       Appearance      =   1
  188.       Style           =   1
  189.       ImageList       =   "ImageList1"
  190.       _Version        =   393216
  191.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  192.          NumButtons      =   7
  193.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  194.             Key             =   "Play"
  195.             Object.ToolTipText     =   "Play"
  196.             ImageIndex      =   1
  197.          EndProperty
  198.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  199.             Key             =   "Pause"
  200.             Object.ToolTipText     =   "Pause"
  201.             ImageIndex      =   2
  202.          EndProperty
  203.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  204.             Key             =   "Stop"
  205.             Object.ToolTipText     =   "Stop"
  206.             ImageIndex      =   3
  207.          EndProperty
  208.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  209.             Key             =   "Full"
  210.             Object.ToolTipText     =   "Full Screen"
  211.             ImageIndex      =   4
  212.          EndProperty
  213.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  214.             Style           =   4
  215.          EndProperty
  216.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  217.             Key             =   "URL"
  218.             Object.ToolTipText     =   "Form The Web"
  219.             ImageIndex      =   5
  220.          EndProperty
  221.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  222.             Key             =   "Help"
  223.             Object.ToolTipText     =   "Help"
  224.             ImageIndex      =   6
  225.          EndProperty
  226.       EndProperty
  227.    End
  228.    Begin MSComctlLib.ListView List 
  229.       Height          =   4695
  230.       Left            =   4320
  231.       TabIndex        =   1
  232.       Top             =   120
  233.       Width           =   3495
  234.       _ExtentX        =   6165
  235.       _ExtentY        =   8281
  236.       View            =   3
  237.       Arrange         =   2
  238.       LabelWrap       =   -1  'True
  239.       HideSelection   =   -1  'True
  240.       _Version        =   393217
  241.       Icons           =   "ImageList2"
  242.       SmallIcons      =   "ImageList2"
  243.       ForeColor       =   -2147483625
  244.       BackColor       =   -2147483643
  245.       BorderStyle     =   1
  246.       Appearance      =   1
  247.       NumItems        =   1
  248.       BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  249.          Key             =   "Name"
  250.          Object.Tag             =   "nn"
  251.          Text            =   "Playlist"
  252.          Object.Width           =   6165
  253.       EndProperty
  254.    End
  255.    Begin VB.Label lbClick 
  256.       Caption         =   "0"
  257.       Height          =   375
  258.       Left            =   7560
  259.       TabIndex        =   5
  260.       Top             =   720
  261.       Visible         =   0   'False
  262.       Width           =   135
  263.    End
  264.    Begin VB.Label lb1 
  265.       BackColor       =   &H80000006&
  266.       Caption         =   "Current Frame:"
  267.       BeginProperty Font 
  268.          Name            =   "MS Sans Serif"
  269.          Size            =   9.75
  270.          Charset         =   0
  271.          Weight          =   400
  272.          Underline       =   0   'False
  273.          Italic          =   0   'False
  274.          Strikethrough   =   0   'False
  275.       EndProperty
  276.       ForeColor       =   &H0080FF80&
  277.       Height          =   255
  278.       Left            =   120
  279.       TabIndex        =   4
  280.       Top             =   5400
  281.       Width           =   2655
  282.    End
  283.    Begin VB.Shape shp 
  284.       BackColor       =   &H80000006&
  285.       FillStyle       =   0  'Solid
  286.       Height          =   360
  287.       Left            =   0
  288.       Top             =   5400
  289.       Width           =   8055
  290.    End
  291.    Begin VB.Menu mnFile 
  292.       Caption         =   "File"
  293.       Begin VB.Menu mnOpen 
  294.          Caption         =   "Open"
  295.       End
  296.       Begin VB.Menu mn1 
  297.          Caption         =   "-"
  298.       End
  299.       Begin VB.Menu mnExit 
  300.          Caption         =   "Exit"
  301.       End
  302.    End
  303.    Begin VB.Menu mnView 
  304.       Caption         =   "View"
  305.       Begin VB.Menu mnFull 
  306.          Caption         =   "Full Screen"
  307.       End
  308.    End
  309.    Begin VB.Menu mnAbout 
  310.       Caption         =   "About"
  311.    End
  312. End
  313. Attribute VB_Name = "Form1"
  314. Attribute VB_GlobalNameSpace = False
  315. Attribute VB_Creatable = False
  316. Attribute VB_PredeclaredId = True
  317. Attribute VB_Exposed = False
  318. 'NGUYEN QUANG HUNG
  319. '87 NGO QUYEN ,THU DAU MOT,BINH DUONG
  320. 'CHUONG TRINH CHOI FLASH
  321. Option Explicit
  322. Dim Full As Boolean
  323. Dim Start As Boolean
  324. Dim Ready As Boolean
  325. Dim swfH
  326. Dim swfW
  327. Dim swfT
  328. Dim swfL
  329. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  330.  
  331. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  332.  
  333. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  334.  
  335. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
  336.  
  337. Private Const GWL_STYLE = (-16)
  338. Private Const WS_CAPTION = &HC00000
  339. Private Const WS_MAXIMIZEBOX = &H10000
  340. Private Const WS_MINIMIZEBOX = &H20000
  341. Private Const WS_SYSMENU = &H80000
  342. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  343.  
  344. Private Enum ESetWindowPosStyles
  345.     SWP_SHOWWINDOW = &H40
  346.     SWP_HIDEWINDOW = &H80
  347.     SWP_FRAMECHANGED = &H20
  348.     SWP_NOACTIVATE = &H10
  349.     SWP_NOCOPYBITS = &H100
  350.     SWP_NOMOVE = &H2
  351.     SWP_NOOWNERZORDER = &H200
  352.     SWP_NOREDRAW = &H8
  353.     SWP_NOREPOSITION = SWP_NOOWNERZORDER
  354.     SWP_NOSIZE = &H1
  355.     SWP_NOZORDER = &H4
  356.     SWP_DRAWFRAME = SWP_FRAMECHANGED
  357.     HWND_NOTOPMOST = -2
  358. End Enum
  359.  
  360. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  361. Private Type RECT
  362.     Left As Long
  363.     Top As Long
  364.     Right As Long
  365.     Bottom As Long
  366. End Type
  367.  
  368.  
  369.         
  370. Private Function ShowTitleBar(ByVal bState As Boolean)
  371.     Dim lStyle As Long
  372.     Dim tR As RECT
  373.     GetWindowRect Me.hwnd, tR
  374.     lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
  375.     If (bState) Then
  376.     Me.Caption = Me.Tag
  377.     If Me.ControlBox Then
  378.     lStyle = lStyle Or WS_SYSMENU
  379.     End If
  380.     If Me.MaxButton Then
  381.     lStyle = lStyle Or WS_MAXIMIZEBOX
  382.     End If
  383.     If Me.MinButton Then
  384.     lStyle = lStyle Or WS_MINIMIZEBOX
  385.     End If
  386.     If Me.Caption <> "" Then
  387.     lStyle = lStyle Or WS_CAPTION
  388.     End If
  389.     Else
  390.     Me.Tag = Me.Caption
  391.     Me.Caption = ""
  392.     lStyle = lStyle And Not WS_SYSMENU
  393.     lStyle = lStyle And Not WS_MAXIMIZEBOX
  394.     lStyle = lStyle And Not WS_MINIMIZEBOX
  395.     lStyle = lStyle And Not WS_CAPTION
  396.     End If
  397.     SetWindowLong Me.hwnd, GWL_STYLE, lStyle
  398.     SetWindowPos Me.hwnd, 0, tR.Left, tR.Top, tR.Right - tR.Left, tR.Bottom - tR.Top, SWP_NOREPOSITION Or SWP_NOZORDER Or SWP_FRAMECHANGED
  399.     Me.Refresh
  400.     'Form_Resize
  401. End Function
  402. Private Sub Form_Load()
  403. Full = False
  404. Ready = False
  405. Form_Resize
  406. End Sub
  407. Private Sub Form_Resize()
  408. If Me.WindowState <> 1 Then
  409. If Full = False Then
  410. swfW = Me.ScaleWidth - swf.Left - List.Width - 100
  411. swfH = Me.ScaleHeight - sld.Height - Toolbar.Height - shp.Height
  412. swfT = 10
  413. swfL = 10
  414. Else
  415. swfH = Me.ScaleHeight
  416. swfW = Me.ScaleWidth
  417. swfL = 0
  418. swfT = 0
  419. End If
  420. swf.Move swfT, swfL, swfW, swfH
  421. List.Top = swf.Top
  422. List.Left = swf.Left + swf.Width + 10
  423. List.Height = swf.Height
  424. sld.Top = swf.Top + swf.Height + 10
  425. sld.Width = Me.ScaleWidth - 10
  426. shp.Top = sld.Top + sld.Height + 10
  427. shp.Left = 10
  428. shp.Width = Me.Width - 10
  429. lb1.Height = shp.Height - 20
  430. lb1.Top = shp.Top + 20
  431. End If
  432. End Sub
  433.  
  434. Private Sub Form_Unload(Cancel As Integer)
  435. If Start = True Then
  436. swf.Stop
  437. End If
  438. frmAbout.cmdOk.Value = True
  439. End Sub
  440.  
  441. Private Sub List_DblClick()
  442. If List.SelectedItem.Key <> "" Then
  443. swf.Movie = List.SelectedItem.Key
  444. 'List.SelectedItem.SmallIcon = ImageList2.ListImages("Icons").Key
  445. swf.Play
  446. Start = True
  447. Form1.Caption = "Flash Player - " & List.SelectedItem.text
  448. End If
  449. End Sub
  450.  
  451. Private Sub mnAbout_Click()
  452. frmAbout.show
  453. End Sub
  454.  
  455. Private Sub mnExit_Click()
  456. swf.Stop
  457. End
  458. End Sub
  459.  
  460. Private Sub mnFull_Click()
  461. Call FullScreen
  462. End Sub
  463.  
  464. Private Sub mnOpen_Click()
  465. lbClick = lbClick + 1
  466. Dim Name As String
  467. With dlg
  468. .Flags = cdlOFNExplorer + cdlOFNAllowMultiselect
  469. .Filter = "Shockware Flash File(*.swf)|*.swf|"
  470. .MaxFileSize = 10000
  471. .ShowOpen
  472. End With
  473. Name = StrConv(dlg.FileName, vbProperCase)
  474. List.ListItems.Clear
  475. If dlg.FileName = "" Then Exit Sub
  476.      Dim a As Variant
  477.      Dim P As Integer
  478.  
  479.      a = Split(dlg.FileName, vbNullChar)
  480.      If UBound(a) = 0 Then
  481.      
  482.     List.ListItems.Add , dlg.FileName, dlg.FileTitle, "Icon", "Icon"
  483.         Else
  484.           For P = 1 To UBound(a)
  485.                If Right(a(0), 1) <> "\" Then a(0) = a(0) & "\"
  486.                List.ListItems.Add , a(0) + a(P), P & "   " & a(P), "Icon", "Icon"
  487.           Next
  488.      End If
  489.      dlg.FileName = ""
  490.      On Error Resume Next
  491.     
  492. End Sub
  493. Private Sub sld_Scroll()
  494. Dim x As Integer
  495. x = (sld.Value * swf.TotalFrames) / 100
  496. swf.GotoFrame (x)
  497. swf.Play
  498. Start = True
  499. End Sub
  500.  
  501.  
  502. Private Sub Timer1_Timer()
  503. If Start = True Then
  504. sld.Value = (swf.CurrentFrame * 100) / swf.TotalFrames
  505. lb1.Caption = "Current Frame:" & swf.CurrentFrame & "/" & swf.TotalFrames
  506. End If
  507. End Sub
  508.  
  509. Private Sub Timer2_Timer()
  510. If GetAsyncKeyState(vbKeyEscape) Then
  511. ShowTitleBar True
  512. Full = False
  513. Me.WindowState = 0
  514. mnFile.Visible = True
  515. mnView.Visible = True
  516. mnAbout.Visible = True
  517. List.Visible = True
  518. Toolbar.Visible = True
  519. sld.Visible = True
  520. shp.Visible = True
  521. lb1.Visible = True
  522. End If
  523. End Sub
  524.  
  525.  
  526.  
  527. Private Sub Toolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
  528. Select Case Button.Key
  529. Case "Play"
  530. If lbClick <> 0 Then
  531. swf.Movie = List.SelectedItem.Key
  532. swf.Play
  533. Else: Exit Sub
  534. End If
  535. Case "Stop"
  536. If Start = True Then
  537. swf.Stop
  538. swf.GotoFrame (1)
  539. sld.Value = (swf.CurrentFrame * 100) / swf.TotalFrames
  540. End If
  541. Start = False
  542. Case "Full"
  543. Call FullScreen
  544. Case "Help"
  545. Call mnAbout_Click
  546. Case "URL"
  547. Dim url
  548. url = InputBox("Type the url", "Warning")
  549. If url <> "" Then
  550. List.ListItems.Add , url, url, "Icon", "Icon"
  551. End If
  552. Case "Pause"
  553. swf.Stop
  554. End Select
  555. End Sub
  556.  
  557. Public Sub FullScreen()
  558. ShowTitleBar False
  559. Full = True
  560. Me.WindowState = 2
  561. Me.BorderStyle = 0
  562. mnFile.Visible = False
  563. mnView.Visible = False
  564. mnAbout.Visible = False
  565. List.Visible = False
  566. Toolbar.Visible = False
  567. sld.Visible = False
  568. shp.Visible = False
  569. lb1.Visible = False
  570. End Sub
  571.  
  572.  
  573.  
  574.