Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet203/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   199   200   201   202   203   204   205   206   ...   453
Defining an Interop DLL
 

 
185
the actual settings for the application appear as part
of the 
.RESOURCES
file. What you see when you run this
application appears in Figure 9-14.
This is a fully functional Windows Media Player. You 
can adjust the volume, set the starting position, pause 
the play, or do anything else you normally do with the 
Windows Media Player. It’s even possible to right-click 
the Windows Media Player to see the standard context 
menu. The context menu contains options to do things 
like slow the play time, see properties, and change 
options. Play with the example a bit to see just how fully 
functional it is.
A quICk vIEW Of THE WINDOWS MEDIA PLAyER COMPONENT fORM
You may encounter times when you really don’t want to display the Windows Media 
Player as a control — you simply want it to work in the background. In this case, 
you can use the Windows Media Player as a component. The following code snippet 
shows the fastest way to perform this task in IronPython (the 
sys.path.append()
call should appear on a single line, even though it appears on two lines in the book). 
(You can find the entire source in the MPComponent example supplied with the 
book’s source code.)
# Set up the path to the .NET Framework.
import sys 
sys.path.append(
‘C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727’)
# Make clr accessible.
import clr
# Add any required references.
clr.AddReference(‘System.Windows.Forms.DLL’)
clr.AddReference(‘WMPLib.DLL’)
# Import the .NET assemblies.
import System 
import System.Windows.Forms
import WMPLib
# import the form. 
from frmMPComponent import *
# Define the event handlers.
def btnPlay_Click(*args):
# Create the Media Player object.
fIguRE 9-14: 
The example application shows 
a form with Windows Media Player on it.
(continues)
548592c09.indd 185
2/24/10 12:48:23 PM
www.finebook.ir



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   199   200   201   202   203   204   205   206   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish