Help with ownerdraw menu! 
Author Message
 Help with ownerdraw menu!

Hya all!
I'm coding a program launcher and I use a loop to add programs to the menu.
I see a lot of guys do this:

AppendMenu((HMENU)wParam, MF_OWNERDRAW, i+1, (const char*)i);

and something like this in a WindowProc function
 if ( 1 <= wParam && wParam < 1+n_MAXITEM ) {
blablbla

Quote:
}

This obviously means that the menuitem has been clicked.

I know the i+1 is the ID of the menu item. But when I use this, I can't get
a WM_COMMAND
from the menu? Any ideas?
I always use something like ID_POPUP_PROGRAM1 or something this will work,
but
as you can see this is a very difficult way, and you can't use infinite menu
items.

Any help would be appreciated!!

Cya

Da Phoenix



Tue, 03 Sep 2002 03:00:00 GMT  
 Help with ownerdraw menu!
Phoenix

I am writting something very similar and this suggestion was given to me
and it works very well.  

BOOL CVCToolBarDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
        UINT uID = LOWORD(wParam);    // item, control, or accelerator identifier

        return CDialog::OnCommand(wParam, lParam);

Quote:
}

I hope this helps???

Regards,

Brad



Quote:
> Hya all!
> I'm coding a program launcher and I use a loop to add programs to the
menu.
> I see a lot of guys do this:

> AppendMenu((HMENU)wParam, MF_OWNERDRAW, i+1, (const char*)i);

> and something like this in a WindowProc function
>  if ( 1 <= wParam && wParam < 1+n_MAXITEM ) {
> blablbla
> }

> This obviously means that the menuitem has been clicked.

> I know the i+1 is the ID of the menu item. But when I use this, I can't
get
> a WM_COMMAND
> from the menu? Any ideas?
> I always use something like ID_POPUP_PROGRAM1 or something this will
work,
> but
> as you can see this is a very difficult way, and you can't use infinite
menu
> items.

> Any help would be appreciated!!

> Cya

> Da Phoenix



Tue, 03 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need Help with OwnerDraw Menu, GetTextExtentPoint32 & Menu Fonts

2. Need Help with OwnerDraw Menu, GetTextExtentPoint32 & Menu Fonts

3. Please help me with a ownerdraw menu problem!

4. Ownerdraw context menu fails.

5. WTL - OwnerDrawn menus

6. OwnerDraw menu problems on Win95

7. Colors come up wrong in OwnerDraw Menu

8. Ownerdrawn Menu

9. Drawing the check mark etc for OwnerDraw menu

10. OwnerDraw menus

11. OwnerDrawn Menu font problem

12. ownerdrawn menu

 

 
Powered by phpBB® Forum Software