[python-win32] mciSendCommand from win32 ???
Michel Claveau
mc at mclaveau.com
Wed Nov 30 08:50:47 CET 2005
Hi!
I had wrapped MCI with ctypes.
Here, begin of my source :
from ctypes import windll, c_buffer
class mci:
def __init__(self):
self.w32mci = windll.winmm.mciSendStringA
self.w32mcierror = windll.winmm.mciGetErrorStringA
def send(self,commande):
buffer = c_buffer(255)
errorcode = self.w32mci(str(commande),buffer,254,0)
if errorcode: # il y a une erreur
return errorcode, self.w32mcierror(errorcode,buffer,254)
else: # commande Ok retourne 0
return errorcode,buffer.value
@-salutation
MCI (Michel Claveau Informatique)
More information about the Python-win32
mailing list