View Full Version : Docking + Menu APIs
anthony_s
22nd September 2001, 19:29
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.
spib
25th September 2001, 17:04
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 (http://www.codeproject.com/dialog/winampwnd.asp) 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.
andrei_t3
5th January 2002, 18:50
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! :up:
Ximo
6th January 2002, 17:38
Delphi is the best! :up:
__________________
Want something, and you'll get it! :p
I want Delphi, where can I get it?
andrei_t3
7th January 2002, 12:20
Where can you get delphi from.... :D
Well, www.borland.com
The file has about 160 mb :)
Or you can get it from KaZaA !
anthony_s
7th January 2002, 12:31
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.
Pvs3
8th January 2004, 11:21
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 (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.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.