Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 22nd September 2001, 19:29   #1
anthony_s
Junior Member
 
Join Date: Sep 2001
Location: UK
Posts: 14
Send a message via ICQ to anthony_s
Docking + Menu APIs

Im working on a gen plugin but I have no clue how to make my plugins window dock onto the other winamp windows. I'd be very grateful if someone could point me in the right direction!

Also, I have seen some gen plugins that add themselves to the winamp menu of the list of windows and also assign a hot key to them. How is this done? (the shoutamp plugin is an example of this).

Im working in delphi btw.
anthony_s is offline   Reply With Quote
Old 25th September 2001, 17:04   #2
spib
Senior Member
 
Join Date: Jun 2000
Location: Manchester, UK
Posts: 106
I know absolutely nothing about Delphi I'm afraid, but I have done all this kind of thing in C++. If you take a visit to codeproject.com you'll find code for a skinnable, dockable window and other tricks which you can use.

To insert your own menu into the winamp menu you will need to subclass winamp's main window and catch the WM_INITMENU message, adjusting the passed menu structure with your own menu items. Then catch the WM_COMMAND message.
spib is offline   Reply With Quote
Old 5th January 2002, 18:50   #3
andrei_t3
Junior Member
 
Join Date: Jan 2002
Location: Lyon, France
Posts: 14
Send a message via ICQ to andrei_t3 Send a message via Yahoo to andrei_t3
Delphi Hook

Ok. I'm gonna give you some help here.

If you want to dock to winamp's Window, you got to find out first of all Winamp's handle, and after that process all WM_MOVE messages.

To hook winamp window:

I. You declare a global variable

var lpWndProcOld: Pointer;

II. In the plugin's init procedure, you do the following:

function Init: integer;
var filename: array[0..512] of char;
k: integer;
s: string;
begin
lpWndProcOld := Pointer(GetWindowLong(plugin.hwndParent, GWL_WNDPROC));

SetWindowLong(plugin.hwndParent, GWL_WNDPROC, Longint(@MyWndProc));
{bla bla bla here, you do whatever else you want}
end;


III. You declare your procedure. Note that you have to declare it before the init procedure (or use a forward cause)

function MyWndProc(HWindow: HWnd; Message, WParam, LParam: Longint): Longint;
begin
if message = WM_MOVE then
begin
showmessage(' Winamp is moving ' );
{here, you take a look into the Win32.hlp file to see how to where are the coordonates of the window - in LPAram and WPAram }
end;
}
Result := CallWindowProc(lpWndProcOld, hWindow, message, wParam, lParam);
end;

Enjoy!

Delphi is the best!
andrei_t3 is offline   Reply With Quote
Old 6th January 2002, 17:38   #4
Ximo
Junior Member
 
Join Date: Dec 2001
Location: The earth
Posts: 27
Re: Delphi Hook

Delphi is the best!

__________________
Want something, and you'll get it!



I want Delphi, where can I get it?
Ximo is offline   Reply With Quote
Old 7th January 2002, 12:20   #5
andrei_t3
Junior Member
 
Join Date: Jan 2002
Location: Lyon, France
Posts: 14
Send a message via ICQ to andrei_t3 Send a message via Yahoo to andrei_t3
Where can you get delphi from....

Well, www.borland.com

The file has about 160 mb

Or you can get it from KaZaA !
andrei_t3 is offline   Reply With Quote
Old 7th January 2002, 12:31   #6
anthony_s
Junior Member
 
Join Date: Sep 2001
Location: UK
Posts: 14
Send a message via ICQ to anthony_s
Re: Delphi Hook

Quote:
Originally posted by andrei_t3
Ok. I'm gonna give you some help here.
Thanx but I got the menu code + docking + monitoring winamps minimize status etc all sorted now.
anthony_s is offline   Reply With Quote
Old 8th January 2004, 11:21   #7
Pvs3
Senior Member
 
Pvs3's Avatar
 
Join Date: Jan 2002
Location: My Pc
Posts: 116
Send a message via ICQ to Pvs3 Send a message via Yahoo to Pvs3
Problems

I started a plugin in Delphi and tried to hook to Winamp, and whne Winamp loaded it performed an illegal operation, because of my plugin.
I searched the forums and found this thread, only it still does not work. I am using the example on http://www.stnd.de . I uploaded a project and the compiled DLL that does not work for me.
Maby someone could tell me what i'm doing wrong or give an example that works.
Attached Files
File Type: zip testplug.zip (5.8 KB, 106 views)
Pvs3 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