Old 27th December 2004, 10:00   #1
Juicy2k
Junior Member
 
Join Date: Oct 2003
Posts: 4
Ipc_setvolume

Hi there..

I've been coding an external program that will listen over TCP/IP and relay commands on to winamp (for a network jukebox ) and I've run into a problem.

I've not got any dodgy plugins, I'm using version 5008 of winamp and my other code (play, pause, stop, etc) works fine.

The line that's giving me problems is below:

SendMessage(winamp_hWnd, WM_WA_IPC, iVolume, IPC_SETVOLUME);

my hWnd is fine, the constants are defined and I've tried making sure iVolume is various types to maybe satisfy the API.

Has anyone else had this problem or can see what I'm doing wrong?
Juicy2k is offline   Reply With Quote
Old 27th December 2004, 14:53   #2
eleet-2k2
Forum King
 
eleet-2k2's Avatar
 
Join Date: Aug 2001
Location: Mobil Ave.
Posts: 5,381
It seems to work fine for me, here's what I did (it's VB):

code:
Public Const IPC_SETVOLUME = 122 'set volume (0-255)

Public Function SetVolume(Volume As Integer) As Long
'Sets the volume (Volume must be between 0 - 255)
SetVolume = SendMessage(hwnd_winamp, WM_WA_IPC, Volume, IPC_SETVOLUME)
End Function


"Welcome to the Island of people who know too much."..."Did you really think balloons would stop him?!"
See what I'm listening too.
eleet-2k2 is offline   Reply With Quote
Old 27th December 2004, 18:57   #3
Juicy2k
Junior Member
 
Join Date: Oct 2003
Posts: 4
Solved it. For some reason winamp wasn't working with SendMessage (just on this one command), so I'm currently using SendNotifyMessage. This does work.

Why SendMessage doesn't work, I don't know. But I have a solution now, so I'm happy
Juicy2k is offline   Reply With Quote
Old 27th December 2004, 19:52   #4
eleet-2k2
Forum King
 
eleet-2k2's Avatar
 
Join Date: Aug 2001
Location: Mobil Ave.
Posts: 5,381
Quote:
Originally posted by Juicy2k
Solved it. For some reason winamp wasn't working with SendMessage (just on this one command), so I'm currently using SendNotifyMessage. This does work.

Why SendMessage doesn't work, I don't know. But I have a solution now, so I'm happy
Try it with SendMessageA() since it should be sending ASCII (as that's how Winamp wants it). Otherwise, there's something fishy why it's not working.

"Welcome to the Island of people who know too much."..."Did you really think balloons would stop him?!"
See what I'm listening too.
eleet-2k2 is offline   Reply With Quote
Old 27th December 2004, 20:35   #5
KJMan
Junior Member
 
Join Date: Dec 2004
Location: Midwest USA
Posts: 3
I could not get any WM_USER type messages to work using the 'SendMessage' function in VB. I don't know if this is because of the VB IDE or not.
I had to use 'SendMessageTimeout' instead and it worked great.
KJMan is offline   Reply With Quote
Old 27th December 2004, 20:44   #6
Juicy2k
Junior Member
 
Join Date: Oct 2003
Posts: 4
This may be why SendNotifyMessage works where SendMessage doesn't, since the Notify version returns back to the calling application immediately and places the message on the called application's message queue.

Maybe it's another example of VB being pants.

Don't suppose anyone has any experience of VB.net and winamp?
Juicy2k is offline   Reply With Quote
Reply
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