Old 18th May 2004, 15:23   #1
CaboWaboAddict
Forum Sot
(Major Dude)
 
CaboWaboAddict's Avatar
 
Join Date: Mar 2004
Location: Marietta, Ga. U.S.A.
Posts: 3,915
Many Thanks!

Mas Tequila!

Idiot's Advocate
My site (under construction)
CaboWaboAddict is offline   Reply With Quote
Old 30th June 2004, 17:16   #2
artitumis
Junior Member
 
Join Date: Jun 2004
Location: Camp Lejeune, NC
Posts: 12
Send a message via AIM to artitumis Send a message via Yahoo to artitumis
Hrm is there not a WM_COMMAND for mute? Or any other way to mute for that matter?
artitumis is offline   Reply With Quote
Old 8th July 2004, 13:24   #3
cjard
Junior Member
 
Join Date: Feb 2004
Posts: 5
mute is a feature of the windows volume control panel? send that a WM_COMMAND instead?
cjard is offline   Reply With Quote
Old 11th September 2004, 00:11   #4
4rfvgz7tdfght4
Junior Member
 
Join Date: Sep 2004
Posts: 3
I am trying to control winamp 5 from a vb.net application and i have problems using SendMessage: everything seems to work except I don't get results either for WM_USER nor WM_COMMAND stuff.
It seems strange to me that the hwnd is always between something like 364673202778132480 and 372391402778132480 ...

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

'function ...

Dim hwndWinamp As Long = FindWindow("waam1.2.1", vbNullString)
'having called winamp with the parameter /CLASS="waam1.2.1"
'otherwise FindWindow("winamp v1.x", vbNullString) ?

SendMessage(hwndWinamp, 273, 40029, 0) 'should pop up some window
SendMessage(hwndWinamp, 1024, 128, 122) 'should set volume to 50%
'...
'nothing works!
'
'end function
'
'btw. WM_USER=1024=h400, WM_COMMAND=273=h111
4rfvgz7tdfght4 is offline   Reply With Quote
Old 30th September 2004, 21:34   #5
mpdil
Junior Member
 
Join Date: Sep 2004
Posts: 4
Do you know if winamp can be accesed/controlled using java
mpdil is offline   Reply With Quote
Old 1st October 2004, 01:16   #6
4rfvgz7tdfght4
Junior Member
 
Join Date: Sep 2004
Posts: 3
i am not good at java, but i guess there should be some windows api library for java so yes it should be possible.
4rfvgz7tdfght4 is offline   Reply With Quote
Old 1st October 2004, 12:58   #7
mpdil
Junior Member
 
Join Date: Sep 2004
Posts: 4
Do you have any idea where I could find out how to to make a plugin in java
mpdil is offline   Reply With Quote
Old 1st October 2004, 13:06   #8
4rfvgz7tdfght4
Junior Member
 
Join Date: Sep 2004
Posts: 3
try a java forum ???
4rfvgz7tdfght4 is offline   Reply With Quote
Old 9th October 2004, 06:19   #9
Squirrelinabox
Junior Member
 
Join Date: Oct 2004
Posts: 2
Like 4rfvgz7tdfght4 I am not getting the correct window handle back from FindWindow. The number it returns is a constantly increasing number so it clearly isn't returning the right value. Any help on figuring out why FindWindow doesn't seem to work properly would be great.
Squirrelinabox is offline   Reply With Quote
Old 9th October 2004, 19:15   #10
Frivolous Sam
Junior Member
 
Join Date: Jan 2003
Location: UK
Posts: 2
Is there any way to hook onto the play function in this API?

I'd like to intercept whenever the PLAY button is pushed, whenever the hotkey for PLAY is used, whenever PLAY is pushed on the Playlist editor, and whenever the Playback option is selected from the context menu.

Has anyone achieved any of these?

Dave.
Frivolous Sam is offline   Reply With Quote
Old 9th October 2004, 22:35   #11
DrO
 
Join Date: Sep 2003
Posts: 27,873
Dave: you need to subclass the main window and look for the second winamp button being pressed (id is in the sdk) under the wm_command message and also the relevant key in the wm_keydown message (which covers all areas i think - no access to any of my source code at the moment but i'm sure that's what i do when i track it)

Squirrelinabox: FindWindow("Winamp v1.x","") should be working (does for me) so really not sure why the issues, maybe it's a vb thing, dunno

-daz
DrO is offline   Reply With Quote
Old 14th October 2004, 21:29   #12
anderslinder
Junior Member
 
Join Date: Jul 2004
Location: Umeå, Sweden
Posts: 6
Send a message via ICQ to anderslinder
To 4rfvgz7tdfght4 and Squirrelinabox (If you still have trouble):
The declaration of FindWindow is wrong, it should look like this:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

The same is for SendMessage which shold look like this:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Object) As Integer

Long is used in Windows API calls when you use VB6 but not in VB.NET
Look here for Windows API reference for VB.NET.

I have done this myself in VB.NET but I changed to C# when I wanted to make a function that adds tracks to playlist due to problems with pointers.

Hope this will fix your problems.
// Anders
anderslinder is offline   Reply With Quote
Old 15th October 2004, 07:06   #13
Squirrelinabox
Junior Member
 
Join Date: Oct 2004
Posts: 2
HUGE thanks to anderslinder. That was the problem... was using Long everywhere. Somebody should add the note about using integers for .net here http://forums.winamp.com/showthread....hreadid=180297 so some people don't get mixed up like me

Everything works perfect now... thanks again, I was getting very frustrated... thought i tried everything, its those damn simple little things you overlook that bite you in the butt
Squirrelinabox is offline   Reply With Quote
Old 15th October 2004, 10:24   #14
CraigF
Passionately Apathetic
Administrator
 
CraigF's Avatar
 
Join Date: May 2000
Location: Hell
Posts: 5,435
included in the sticky

CraigF is offline   Reply With Quote
Old 15th October 2004, 12:38   #15
DrO
 
Join Date: Sep 2003
Posts: 27,873
will update the sdk to include that as well when i get the chance over the next week

-daz
DrO is offline   Reply With Quote
Old 14th February 2005, 14:30   #16
mrbean87
Junior Member
 
Join Date: Dec 2004
Posts: 9
Is there a windows message or a command line text or any other thing that can randomize the playlist?
mrbean87 is offline   Reply With Quote
Old 14th February 2005, 17:36   #17
DrO
 
Join Date: Sep 2003
Posts: 27,873
from the installer version of the sdk which has the message id's in wa_msgids.h you find #define ID_PE_S_RANDOM 40212 (which matches to the menu entry in the playlist editor for randomising the current playlist - sent as a WM_COMMAND message to the playlist window)

-daz
DrO is offline   Reply With Quote
Old 1st April 2005, 16:51   #18
mad-boy
Junior Member
 
Join Date: Oct 2002
Posts: 6
Send a message via ICQ to mad-boy
Delete files from playlist?

Hi,
is there any workaround to delete files from the playlist via command line? I want to /ADD ... a new file and delete the old file in the playlist so that winamp plays the file up to the end and that starts looping a new one!?

Thanks, Michael
mad-boy is offline   Reply With Quote
Old 18th October 2005, 07:53   #19
smurfslayer
Junior Member
 
Join Date: Oct 2005
Posts: 1
Hello,

i'm using the ActiveWinamp-Plugin to control (multiple) winamp instances.

But now i need a possibility to set the device of the output plugin for each single instance.
(either for directsound or waveout plugin.. )

Is there any possibility to set that via Sendmessage?
Do you see any chance?

Thanks,
Thomas
smurfslayer is offline   Reply With Quote
Old 24th October 2005, 21:49   #20
teetow
Junior Member
 
Join Date: Oct 2005
Posts: 1
Well, here's another one...

I'm currently one of the people involved in hacking up a Winamp remote for Salling Clicker (Cell phone <- Bluetooth -> computer thingie), and we've stumbled across the problem with Winamp returning pointers to strings of interest (especially playlist items).

Are there ANY plans to change this, as to return a string instead? In our case, we have to code using WSH (VBScript / JScript) so pointers are of no use to us.

Any thoughts on this?
teetow is offline   Reply With Quote
Old 25th October 2005, 09:07   #21
Lord Darius
Senior Member
 
Lord Darius's Avatar
 
Join Date: Jul 2003
Posts: 248
teetow, in C/C++, a string is a pointer to a memory location where several characters are located.
The problem you have there is that as long as you reside in the same process as the pointer, it points to a valid location.
But if you try to use the address from another process, it will point to a totally different location.
A solution would be to use OpenProcess and ReadProcessMemory to place yourself in the context of winamp process, and hence be able to have your pointer correctly pointing to the string you're looking for.
Lord Darius is offline   Reply With Quote
Old 5th December 2008, 08:11   #22
mycal143
Junior Member
 
Join Date: Dec 2008
Posts: 4
How i control winamp by asp.net with vb.net plz help me
Thanks in advance
mycal143 is offline   Reply With Quote
Old 19th April 2010, 08:53   #23
Ag.Smith
Junior Member
 
Join Date: Apr 2010
Posts: 2
How i can retrieve current winamp volume? I see only 'set volume to data' command(122).
Ag.Smith is offline   Reply With Quote
Old 19th April 2010, 09:03   #24
DrO
 
Join Date: Sep 2003
Posts: 27,873
PHP Code:
#define IPC_GETVOLUME(hwnd_winamp) SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)-666,IPC_SETVOLUME)
/* (requires Winamp 2.0+)
** int curvol = IPC_GETVOLUME(hwnd_winamp);
** This will return the current volume of Winamp or 
*/ 
(taken from wa_ipc.h)

-daz
DrO is offline   Reply With Quote
Old 19th April 2010, 13:44   #25
Ag.Smith
Junior Member
 
Join Date: Apr 2010
Posts: 2
Thanks
Ag.Smith 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