Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 4th December 2005, 14:41   #1
cyby2005
Junior Member
 
Join Date: Dec 2005
Posts: 4
Help don't know what I make wrong! get titel and Interpret from winamp!

Hi, I have some problems to get the songtitel and interpret!

I use following code for it:

//programming with C++ Borland Builder 6
//Winamp Version 5.112
//wa sdk 504
Quote:
---- Header ----
//Die Structur aus der SDK deklariert!

typedef struct {
char *filename;
char *metadata;
char *ret;
int retlen;
} extendedFileInfoStruct;

//ein Structur Objekt erstellt!
extendedFileInfoStruct File;

---- Cpp Datei ----
//Winamp Handle
HANDLE hwnd_winamp;
//Winamp Handle Finden
hwnd_winamp = FindWindow("Winamp v1.x",NULL);
//Position ausfindig machen
int currentPos = SendMessage(hwnd_winamp,WM_USER,0,IPC_GETLISTPOS);
//Strucktur abrufen
SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&File,IPC_GET_EXTENDED_FILE_INFO);
//File Name auslesen!!!
File.filename = (char*)SendMessage(hwnd_winamp, WM_WA_IPC, currentPos, IPC_GETPLAYLISTFILE);
But this Code Crasht Winamp...
*don't now why...*

So I search, and get this Code in the Winamp - Forum:

Quote:
#define IPC_GET_BASIC_FILE_INFO 291
//pass a pointer to the following struct in wParam
typedef struct {
char *filename;

int quickCheck; /*
set to 0 to always get,
1 for quick, 2 for default
(if 2, quickCheck will be set to 0 if
quick wasnot used) */

// filled in by winamp
int length;
char *title;
int titlelen;
} basicFileInfoStruct;

basicFileInfoStruct bfi;

bfi.quickCheck = 0;
bfi.filename = (char*)SendMessage(hwndWinamp, WM_WA_IPC, any_index, IPC_GETPLAYLISTFILE);
bfi.title = GlobalAlloc(GPTR, 1024);
SendMessage(hwndWinamp, WM_WA_IPC, (WPARAM)&bfi, IPC_GET_BASIC_FILE_INFO);
// Do whatever you want with bfi.title and bfi.length now...
GlobalFree((HGLOBAL)bfi.title);
but it crashed Winamp too.

*Don't know what I make wrong*

So I test it again:

Quote:

typedef struct {
char *filename;
char *title;
int length;
} enqueueFileWithMetaStruct;

enqueueFileWithMetaStruct File;

SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&File,IPC_PLAYFILE);
It crashed down again... -.-

I have search @ google and this forum! *long time* but nothing!

I don't know what i make wrong...

Can anyone Help me please ?

I only whant to get the titel & interprett!

MFG
Dennis
cyby2005 is offline   Reply With Quote
Old 4th December 2005, 17:41   #2
cyby2005
Junior Member
 
Join Date: Dec 2005
Posts: 4
I have found it
http://forums.winamp.com/showthread....hreadid=175978
in the magic SourceCode!

cyby2005 is offline   Reply With Quote
Old 4th December 2005, 18:14   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
one little thing, you never said if it was a plugin or an exe that you were trying to access the data with which would have made it easier to make that suggestion (i've only just seen this thread but i'm sure others will have read and ignored it since it wasn't clear). working between process spaces is fun

-daz
DrO 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