Re: Intercepting Range of Menu Commands by r_z_aret
r_z_aret
Tue Sep 19 15:23:16 CDT 2006
On Mon, 18 Sep 2006 16:44:06 -0500, r_z_aret@pen_fact.com wrote:
>On Sun, 17 Sep 2006 08:37:54 GMT, "Sam" <Sam@nospam.com> wrote:
>
>>Hello,
>>
>>I have a dialog box with a menu that I dynamically add Menu items to the
>>menu. I also assign consecutive commands to this menu list. However, I'm
>>not sure how to intercept menu user events in single function with the
>>command id passed as parameter. I can not use ON_COMMAND since i do not know
>
>I assume ON_COMMAND is a function that handles WM_COMMAND messages. If
From Scott Seligman's contribution I gather this is a bad assumption.
Sigh.
>so, then the low word of the corresponding WPARAM will contain the
>control id associated with the menu item. Use LOWORD to extract it. If
>each menu item has a different control id, then you can use a switch
>statement or "if" block to match the right code for each one. If the
>items are unique across menus, you don't even need to know which menu
>an item is in.
>
>
>>how many menu items i will append.
>
>Shouldn't matter.
>
>
>>
>>Is there an easy way to do that.
>>
>>Thanks
>>
>
>-----------------------------------------
>To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>
>Robert E. Zaret, eMVP
>PenFact, Inc.
>20 Park Plaza, Suite 478
>Boston, MA 02116
>www.penfact.com
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com