Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

8 Ocak 2011 Cumartesi

ShockWave File [swf] Animation



'UserForm1

'A) VBProject References List

'A1) Name: VBA, Description: Visual Basic For Applications, FullPath: C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
'A2) Name: Excel, Description: Microsoft Excel 11.0 Object Library, FullPath: C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE
'A3) Name: stdole, Description: OLE Automation, FullPath: C:\WINDOWS\system32\STDOLE2.TLB
'A4) Name: Office, Description: Microsoft Office 11.0 Object Library, FullPath: C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL
'A5) Name: MSForms, Description: Microsoft Forms 2.0 Object Library, FullPath: C:\WINDOWS\system32\FM20.DLL
'A6) Name: MSComctlLib, Description: Microsoft Windows Common Controls 6.0 (SP6), FullPath: C:\WINDOWS\system32\MSCOMCTL.OCX

'B) Addition Tools on UserForm1

'B1)Frame1
'B2)Frame1\Image1, Label1, Label2
'B3)ComboBox1

Option Explicit
Dim i As Single
Private ActiveX As Control
Dim swFile As String
Private Sub UserForm_Initialize()

On Error Resume Next
Me.Caption = "[PBİD®] Shock Wave File [swf] Animation"
Call EkranDüzenle
Call Resim_Ekle(Me)
Call UserForm_Tip1(Me)

End Sub
Private Sub UserForm_Resize()

On Error Resume Next
With ActiveX

.Top = 60
.Left = 6
.Height = Me.InsideHeight - .Top - 6
.Width = Me.InsideWidth - .Left - 6
.SetFocus

End With
With ComboBox1

.Top = 36
.Left = 6
.Height = 18
.Width = Me.InsideWidth - .Left - 6

End With

End Sub
Private Sub UserForm_Terminate()

On Error Resume Next
ActiveX.Playing = False
Application.Visible = True

End Sub
Private Sub ComboBox1_Click()

On Error Resume Next
swFile = ComboBox1.List(ComboBox1.ListIndex, 1)
With ActiveX

.Playing = False
.Playing = True
.LoadMovie 0, swFile
.Play
.SetFocus

End With

End Sub
Sub EkranDüzenle()

On Error Resume Next
With Me

.Height = 414
.Width = 636
.BackColor = vbWhite
With Frame1

.Caption = ""
.Left = -1
.Top = -1
.Height = 30
.Width = Me.Width + 12
.Picture = Resim(URL1)
.Picture = LoadPicture("C:\*.jpg")
.PictureAlignment = fmPictureAlignmentCenter
.PictureSizeMode = fmPictureSizeModeStretch
.SpecialEffect = fmSpecialEffectFlat
With Image1

.Left = 1.5
.Top = 1.5
.Height = 24
.Width = 24
.BorderColor = vbBlue
.BackStyle = fmBackStyleTransparent
.Picture = Resim(URL2)
.Picture = LoadPicture("C:\*.ico")
.PictureAlignment = fmPictureAlignmentCenter
.PictureSizeMode = fmPictureSizeModeClip

End With
With Label1

.Left = 1.5 + 24 + 3
.Top = 1.5
.Caption = "Mustafa ULUSARAÇ"
.BackStyle = fmBackStyleTransparent
.SpecialEffect = fmSpecialEffectFlat
.BorderStyle = fmBorderStyleNone
.Height = 12
.Width = 180
.Font.Bold = True
.ForeColor = vbBlue

End With
With Label2

.Left = 1.5 + 24 + 3
.Top = 13.5
.Caption = "01ulusarac@superonline.com"
.BackStyle = fmBackStyleTransparent
.SpecialEffect = fmSpecialEffectFlat
.BorderStyle = fmBorderStyleNone
.Height = 12
.Width = 180
.Font.Bold = True
.ForeColor = vbBlue

End With

End With
With ComboBox1

.ListIndex = -1
.Left = 6
.Top = 36
.Height = 18
.Width = Me.InsideWidth - .Left - 6
.SpecialEffect = fmSpecialEffectFlat
.BackStyle = fmBackStyleTransparent
.ForeColor = vbBlue
.Font.Bold = True
.AddItem "Celine Dion [My heart will go on ]": ComboBox1.List(0, 1) = "https://media.dreamhost.com/mp4/player.swf?file=http://video.ak.fbcdn.net/cfs-ak-snc4/48526/46/1487798708433_61271.mp4"
.AddItem "Celine Dion [When i need you]": ComboBox1.List(1, 1) = "https://www.4shared.com/flash/player.swf?file=http://video.l3.fbcdn.net/cfs-l3-snc4/70055/725/455700840418_47831.mp4"
.AddItem "Barış Manço [Kol düğmeleri]": ComboBox1.List(2, 1) = "https://www.4shared.com/flash/player.swf?file=http://video.ak.fbcdn.net/cfs-ak-snc6/79056/256/150352078347010_45641.mp4"
.AddItem "Celine Dion [Beauty and The Beast]": ComboBox1.List(3, 1) = "http://fliiby.com/embed/gadget.swf?fileID=138747&fileShort=7udcoycw70"
.AddItem "Kanal D [Program Akışı]": ComboBox1.List(4, 1) = "http://cdn.dogantv.com.tr/Uploads/loadedbanner/miniplayer_yedek.swf"
.AddItem "Ata Demirer [BKM]": ComboBox1.List(5, 1) = "http://video.google.com/googleplayer.swf?docId=2865758229414156184"
.AddItem "Leconcombre [Animation1]": ComboBox1.List(6, 1) = "http://www.leconcombre.com/stock/calmbay3nail.swf"
.AddItem "Leconcombre [Animation2]": ComboBox1.List(7, 1) = "http://www.leconcombre.com/stock/atomicsmall.swf"

End With
Set ActiveX = Me.Controls.Add("ShockwaveFlash.ShockwaveFlash.10", "ShockwaveFlash1", "1")
With ActiveX

.Top = 60
.Left = 6
.Height = Me.InsideHeight - .Top - 6
.Width = Me.InsideWidth - .Left - 6
.SetFocus

End With
.Move (Application.Width - Me.Width) / 2, (Application.Height - Me.Height) / 2, Me.Width, Me.Height

End With

End Sub

'Module1

Option Explicit
Public Declare Function CLSIDFromString Lib "ole32" (ByVal lpstrCLSID As Long, lpCLSID As Any) As Long
Public Declare Function OleLoadPicturePath Lib "oleaut32" (ByVal szURLorPath As Long, ByVal punkCaller As Long, ByVal dwReserved As Long, ByVal clrReserved As OLE_COLOR, ByRef riid As Any, ByRef ppvRet As Any) As Long
Public IPic(15) As Byte
Public Const ClsID As Variant = "{7BF80980-BF32-101A-8BBB-00AA00300CAB}" 'It may take a few seconds, please wait.
Public Const URL1 As String = "http://2.bp.blogspot.com/_hsHTxo_5L8E/S7rn6KHVfNI/AAAAAAAACRs/fxVMg9YGzb4/s1600/VectorBackround.jpg" 'Microsoft Office Excel® Kod Klavuzu [Vector Backround]
Public Const URL2 As String = "http://2.bp.blogspot.com/_hsHTxo_5L8E/S78EbvJyhRI/AAAAAAAACS0/txbOQ1qubg8/s1600/PB%C4%B0D_jpg.jpg" 'Microsoft Office Excel® Kod Kılavuzu [PBİD Icon]
Public Const URL3 As String = "http://4.bp.blogspot.com/_hsHTxo_5L8E/TKHXL1-dHVI/AAAAAAAAClo/xxJAhuSHReI/s1600/seven-shine-1024-768.jpg" 'Microsoft Office Excel® Kod Kılavuzu [PBİD BackroundPicture]
Public URL As String
Private Enum WindowStyles 'Enumerate windows styles

WS_OVERLAPPED = &H0
WS_POPUP = &H80000000
WS_CHILD = &H40000000
WS_MINIMIZE = &H20000000
WS_VISIBLE = &H10000000
WS_DISABLED = &H8000000
WS_CLIPSIBLINGS = &H4000000
WS_CLIPCHILDREN = &H2000000
WS_MAXIMIZE = &H1000000
WS_BORDER = &H800000
WS_DLGFRAME = &H400000
WS_VSCROLL = &H200000
WS_HSCROLL = &H100000
WS_SYSMENU = &H80000
WS_THICKFRAME = &H40000
WS_GROUP = &H20000
WS_TABSTOP = &H10000
WS_MINIMIZEBOX = &H20000
WS_MAXIMIZEBOX = &H10000
WS_CAPTION = WS_BORDER Or WS_DLGFRAME
WS_TILED = WS_OVERLAPPED
WS_ICONIC = WS_MINIMIZE
WS_SIZEBOX = WS_THICKFRAME
WS_OVERLAPPEDWINDOW = WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW
WS_POPUPWINDOW = WS_POPUP Or WS_BORDER Or WS_SYSMENU
WS_CHILDWINDOW = WS_CHILD

End Enum
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal WindowStyles As Long) As Long
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private hForm As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal Index As Long) As Long
Private IList As New ImageList
Private hImage As Long
Private UWind As Long
Sub Form_Aç() 'Open UserForm

Application.Visible = False
Load UserForm1

End Sub
Public Function UserForm_Tip1(UForm As UserForm) 'Enumerated windows styles [X][X][X]

If Val(Application.Version) = 8 Then

hForm = FindWindow("ThunderXFrame", UForm.Caption)

Else

hForm = FindWindow("ThunderDFrame", UForm.Caption)

End If
SetWindowLong hForm, -16, WS_CAPTION + WS_SYSMENU + WS_MINIMIZEBOX + WS_MAXIMIZEBOX
ShowWindow hForm, 5

End Function
Public Function Resim_Ekle(UForm As UserForm) 'Add icon on sysmenu

IList.ListImages.Add 1, "R1", LoadPicture("C:\Program Files\Microsoft Office\OFFICE11\MSN.ico")
hImage = IList.ListImages(1).Picture
If Val(Application.Version) = 8 Then

UWind = FindWindow("ThunderXFrame", UForm.Caption)

Else

UWind = FindWindow("ThunderDFrame", UForm.Caption)

End If
If UWind = 0 Then Exit Function
SendMessage UWind, &H80, True, hImage: SendMessage UWind, &H80, False, hImage
SetWindowLong UWind, (-20), GetWindowLong(UWind, (-20)) And Not &H1
DrawMenuBar UWind

End Function
Public Function Resim(URL) As Picture 'Picture load frome web address...

On Error Resume Next
CLSIDFromString StrPtr(ClsID), IPic(0)
OleLoadPicturePath StrPtr(URL), 0&, 0&, 0&, IPic(0), Resim

End Function
'Sub References_List()

' On Error Resume Next
' Dim Eleman, No
' No = 1
' For Each Eleman In ThisWorkbook.VBProject.References

' Sheets(1).Cells(No, 1) = No & ") Name: "
' Sheets(1).Cells(No, 2) = Eleman.Name
' Sheets(1).Cells(No, 3) = ", Description: "
' Sheets(1).Cells(No, 4) = Eleman.Description
' Sheets(1).Cells(No, 5) = ", FullPath: "
' Sheets(1).Cells(No, 6) = Eleman.FullPath
' No = No + 1

' Next Eleman

'End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul