Re: Controlling WinAMP (WM_COPYDATA problem)
- From: "The Collector" <thecollector.2k@xxxxxxxxx>
- Date: 30 Jun 2005 13:38:44 -0700
Hi, i changed the code to this:
----------------------------------
from win32gui import FindWindow
from win32api import SendMessage
import struct
import array
hWnd = FindWindow('Winamp v1.x', None)
def packData( dwData, item ):
global cds, lpData
lpData = array.array('c', item)
lpData_ad = lpData.buffer_info()[0]
cbData = lpData.buffer_info()[1]
cds = array.array('c', struct.pack("IIP", dwData, cbData,
lpData_ad) )
cds_ad = cds.buffer_info()[0]
return cds_ad
def addItemToPlaylist( item ):
SendMessage( hWnd, 0x004A, 0, packData( 100, item ) )
file = r"C:\Party Animals - Atomic.mp3"
addItemToPlaylist( file )
----------------------------------
it's working like a charm now... I did found some other mistakes, but
the main problem was indeed solved by the 'global' thingy... so simple
(/me bangs head against the wall), thanks very much!
.
- References:
- Controlling WinAMP (WM_COPYDATA problem)
- From: The Collector
- Re: Controlling WinAMP (WM_COPYDATA problem)
- From: Thomas Heller
- Controlling WinAMP (WM_COPYDATA problem)
- Prev by Date: Re: saving pre-compiled scripts
- Next by Date: Re: When someone from Britain speaks, Americans hear a "British accent"...
- Previous by thread: Re: Controlling WinAMP (WM_COPYDATA problem)
- Next by thread: Re: %g and fpformat.sci()
- Index(es):