ctypes to customize MSN now playing status

est electronixtar at gmail.com
Tue Jan 6 09:09:24 CET 2009

Hi guys, I am trying to switch MSN/WLM now playing status using ctypes
with python, here's my code

import ctypes, win32con, win32api, win32gui

FindWindow = ctypes.windll.User32.FindWindowA
SendMessage = ctypes.windll.User32.SendMessageA

hWnd = FindWindow('MsnMsgrUIManager', None)

s = u"\\0Music\\01\\0{test}\\0\\0\\0\\0\\0<file://0Music//01//0%7Btest

class MsnData(ctypes.Structure):
    _fields_ = [("dwData", ctypes.c_int),
                ("cbData", ctypes.c_int),
                ("lpData", ctypes.c_wchar_p),

msndata = MsnData(0x547, 256, ctypes.c_wchar_p(s))

SendMessage(hWnd, win32con.WM_COPYDATA, 0, ctypes.byref(msndata))

The code is not working, could anybody help?

More information about the Python-list mailing list