Prev Previous Post   Next Post Next
Old 17th October 2007, 16:17   #1
wrybread
Junior Member
 
Join Date: Oct 2007
Posts: 22
quick winamp control question

I'm new to SDKs and had a quick question about controlling Winamp. I'm using Python, but the principles should be pretty universal.

# launch winamp with the class name Winamp_a
a = win32api.WinExec('c:/program files/winamp/winamp.exe /CLASS="Winamp_a"')

# make the handle (returns for example "65640")
hWinamp = win32gui.FindWindow(a, None)

# execute a command (numbers taken from the file wa_ipc.h in the Winamp SDK)
# format is SendMessage(hwnd_winamp, WM_COMMAND, command_name, 0);
# Winamp volume up is WIN_COMMAND 40058
win32api.SendMessage(hWinamp, 40058, 0, 0)

I can't get any response, it always returns 0 and does nothing. One thing I'm wondering about is the command_name parameter (2nd from last parameter above), if I use a non-integer I always get an error saying it wants an integer, so I'm just using 0.

Anyway, any help would be so appreciated.
wrybread is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump