Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 1st October 2004, 09:36   #1
Ganymed
Junior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 40
Inserting Menu Items

Hi!

I try to insert a menu item into the playlist editors menu.
So far it works, but the item is enserted into the first menu I select.
If I first select the "File" menu, it appears in the file menu, when I first select the "Manage Playlist" menu, it appears there etc.
I do catch the WM_INITMENUPOPUP message, but there seems to be no way to find out what menu has been selected, is it?

Comments and Suggestions welcome :-)

Sysinfo: winamp 5.05, winXP pro, delphi 7.

Greetings
Ganymed
Ganymed is offline   Reply With Quote
Old 1st October 2004, 12:12   #2
DrO
-
 
DrO's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 22,210
look at GetMenuItemId(..) (is a Win32 api) and use that to check on what item is say at the start of the given popup menu

-daz
DrO is offline   Reply With Quote
Old 5th October 2004, 06:35   #3
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
You must follow DrO's tip before Nullsoft gives us more info about their menus, like extending the IPC_GET_HMENU ipc to allow access to playlist editor menus as well.
saivert is offline   Reply With Quote
Old 5th October 2004, 20:33   #4
alesek
Junior Member
 
Join Date: Jun 2004
Posts: 3
Hej,
I need to know something, and i hope that you will know what i'm trying to ask,because i'm not writing in my language.
I'm trying to insert "myPlugin" in to systemMenu.I have tried this way:
CMenu* pSystemMenu=GetSystemMenu(FALSE)
pSystemMenu->AppendMenu(MF_SEPARATOR);
pSystemMenu->AppendMenu(MF_STRING,ID_MY_PLUGIN,_T("&myPlugin"));

but it doesn't work.Can somebody help me.For now i'm using MFC,becase i haven't learn API yet,and it looks much easyer to me.
Soory my english
alesek is offline   Reply With Quote
Old 6th October 2004, 06:24   #5
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
MFC mayham!

Looks like alesek is Swedish, though he wont tell us in his profile.

Du måste bara prova hårdare, kille!

Solution:
CMenu* pSystemMenu=::GetSystemMenu(plugin.hwndParent, FALSE);
pSystemMenu->AppendMenu(MF_SEPARATOR);
pSystemMenu->AppendMenu(MF_STRING,ID_MY_PLUGIN,_T("&myPlugin"));

Use "::" in front to use the raw Win32 API version of GetSystemMenu(), and not the method of your CWnd/CDlg or whatever. Using ::GetSystemMenu() let you put in the handle of the window you want to get the the system menu from.

It's very easy to forget, trust me I know
saivert is offline   Reply With Quote
Old 7th October 2004, 18:29   #6
alesek
Junior Member
 
Join Date: Jun 2004
Posts: 3
I've updated my profile
You were very wrong,well at list it starts on S
I've tried your solution,but it returns me an error : cannot convert from 'struct HMENU__ *' to 'class CMenu *'
I think i'll read some books to learn win32 programming better.

PS: It doesn't wont to display my country.I'm from Slovenia

Last edited by alesek; 7th October 2004 at 18:48.
alesek is offline   Reply With Quote
Old 8th October 2004, 06:15   #7
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Oh sorry do this:

code:

mnu = new CMenu;
mnu->Attach(::GetSystemMenu(plugin.hwndParent, FALSE));
// Do things with mnu and then delete mnu;

saivert 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