# coding: gb2312
# author symware 08/03/11 21:09
import wx
import os
from wx.lib.activexwrapper import MakeActiveXClass
import win32com.client.gencache as win32

flashControl = win32.EnsureModule('{D27CDB6B-AE6D-11CF-96B8-444553540000}',0,1,0)
print dir(flashControl)
if flashControl is None:
raise ImportError("Can't load flashcontrol. Make sure you have flashplayer installed.")

class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,'FlashPlayer',(300,250),(350,300))
#窗体图标
icon=wx.EmptyIcon()
icon.LoadFile( os.path.abspath('qq.ico'),wx.BITMAP_TYPE_ICO)
self.SetIcon(icon)
sizer = wx.BoxSizer(wx.VERTICAL)
#Flash 播放器
ActiveXWrapper =MakeActiveXClass(flashControl.ShockwaveFlash)
self.med = ActiveXWrapper(self,-1)
self.med.LoadMovie(0, 'file://' + os.path.abspath('wxFlash.swf'))
sizer.Add(self.med, proportion=1, flag=wx.EXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(True)
if __name__=="__main__":
app=wx.PySimpleApp(False)
frame=MyFrame()
frame.Show()
app.MainLoop() 
1136




被折叠的 条评论
为什么被折叠?



