ctypes to customize MSN now playing status

E

est

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
%7D//0//0//0//0//0>"

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top