|
|
#1 |
|
Junior Member
|
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. |
|
|
|
|
|
#2 |
|
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. |
|
|
|
|
|
#3 |
|
Junior Member
|
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! |
|
|
|
|
|
#4 |
|
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? |
|
|
|
|
|
#5 |
|
Junior Member
|
Where can you get delphi from....
Well, www.borland.com The file has about 160 mb ![]() Or you can get it from KaZaA ! |
|
|
|
|
|
#6 | |
|
Junior Member
|
Re: Delphi Hook
Quote:
|
|
|
|
|
|
|
#7 |
|
Senior Member
|
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. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|