Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 21st September 2009, 17:36   #1
ykahlon
Junior Member
 
Join Date: Sep 2009
Location: New York
Posts: 5
how to listen to winamp events

Hi,

I try to create an application that will listen to winamp events like playing a song, adding new song, etc...

I thought of creating a plugin that will post a message to my process each time I catch these events. My question is how can I do it.

For the plugin I know I need to do:

WNDPROC lpWinampWndProcOld;
LRESULT CALLBACK WinampWndProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam) {
switch (message) {
case WM_WA_IPC :
if (lParam == IPC_PLAYING_FILE) {
// Here I need to post the message
}
break;
}
return
CallWindowProc(lpWinampWndProcOld,hwnd,message,
wParam,lParam);
}

// event functions follow
int init() {
lpWinampWndProcOld = (WNDPROC)SetWindowLong(plugin.hwndParent,GWL_WNDPROC,(LONG)WinampWndProc);
return 0;
}

My question is, how to post the message.
ykahlon is offline   Reply With Quote
Old 21st September 2009, 19:16   #2
DrO
-
 
DrO's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 22,278
all depends on how you want to do it. you could just get a window handle from the application and just SendMessage(..)/PostMessage(..) to send it from the plugin to your app (using a WM_USER+? message range). or you could use a DDE based mechanism, mem-mapped file/structure, etc etc.

the options are pretty much countless, it just comes down to what form of inter-process communication you're looking for based on the complexity (or not) of any messages you might be sending.

-daz
DrO is offline   Reply With Quote
Reply
Go Back   Winamp 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