Old 19th January 2007, 23:09   #41
Tardymo
Member
 
Join Date: Sep 2006
Posts: 89
FindWindow is used internally in Bind method. Path is optional parameter. But I guess C# doesn't have optional parameters so you can simply specify an empty string for a path parameter if Winamp is already running.
First thing Bind method does is it tries to find a winamp window (using FindWindow). If it does not find one, it uses a specified path to lauch Winamp.
New version of WACC will be released in next couple of days.
Tardymo is offline   Reply With Quote
Old 13th December 2008, 17:59   #42
Sipps
Junior Member
 
Join Date: Dec 2008
Posts: 6
Re: Solution: Get FileName from external app/dll

Quote:
Originally posted by HeikoSS
code:

function GetWinampFilename: String;
var Text, tempStr: String;
hwndWinamp, TempHandle : THandle;
dat2: array[0..500] of Char;
TrackPos: Integer;
temp, MPointer: Cardinal;
begin
hwndWinamp:= FindWindow('Winamp v1.x',nil);
TrackPos:= SendMessage(hwndWinamp,WM_USER,0 , 125);
MPointer:= SendMessage(hwndWinamp,WM_USER,TrackPos , 211);
GetWindowThreadProcessId(hwndWinamp,TempHandle);
hwndWinamp:= OpenProcess(PROCESS_ALL_ACCESS,False,TempHandle);
ReadProcessMemory(hwndWinamp, Pointer(MPointer), @dat2,500,temp);
CloseHandle(hwndWinamp);
tempStr:= dat2; // ;-)
Result:= tempStr;
end;

I thought I was pretty able to convert this to C#, but I can't get it to work. Any C# people that know for a fact they can rewrite this to C#?
Sipps is offline   Reply With Quote
Old 14th December 2008, 09:27   #43
fdeshayes
Junior Member
 
Join Date: Jan 2007
Location: Caen, France
Posts: 4
using WACC

Hi!
i've coded some C# interaction with Winamp and i've used the WACC .NET library.

you can find this lib here :
WACC Library

With that, it's very simple to have path of current playing song in Winamp :

PHP Code:
String currentSongPath cWinamp.Playlist.GetItemPath(cWinamp.Playlist.Position
hope it can help.

bye!
fdeshayes is offline   Reply With Quote
Old 30th December 2009, 19:59   #44
babazula2
Junior Member
 
Join Date: Dec 2009
Posts: 11
thanks fdeshayes
babazula2 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