Manually created menus handling! 
Author Message
 Manually created menus handling!

Hi!
I'm creating the menus using API's CreateMenu and InsertMenuItem. But i
doesn't succeeded to catch the menu's Click event. There mignt be another
way to menu handling.
Can anybody suggest me how can i use these menus?
Thanks!

- Vit



Sat, 06 Jul 2002 03:00:00 GMT  
 Manually created menus handling!
If you're using TrackPopupMenuEx to display the menu, then use the
TPM_RETURNCMD flag, and the return value of TrackPopupMenuEx will be the
menu ID of the item clicked, or 0 if they cancel the menu.

You can also subclass.

Quote:

>Hi!
>I'm creating the menus using API's CreateMenu and InsertMenuItem. But i
>doesn't succeeded to catch the menu's Click event. There mignt be another
>way to menu handling.
>Can anybody suggest me how can i use these menus?



Sat, 06 Jul 2002 03:00:00 GMT  
 Manually created menus handling!
Sorry, i'm not using Popup menu. I'm using Top Level menu, and i can't
handle by opening specific menu item. Form_Click event  doesn't catch menu
click.
    Vit

Quote:
> If you're using TrackPopupMenuEx to display the menu, then use the
> TPM_RETURNCMD flag, and the return value of TrackPopupMenuEx will be the
> menu ID of the item clicked, or 0 if they cancel the menu.

> You can also subclass.


> >Hi!
> >I'm creating the menus using API's CreateMenu and InsertMenuItem. But i
> >doesn't succeeded to catch the menu's Click event. There mignt be another
> >way to menu handling.
> >Can anybody suggest me how can i use these menus?



Sat, 06 Jul 2002 03:00:00 GMT  
 Manually created menus handling!
If you're using APIs to add items to VB menus, then you're out of luck unless
you subclass your form and trap WM_COMMANDs. That technique is generally not
recommended.

If you're doing pure API popup menus, then look at the QuickMenu sample at
www.vbbox.com. It shows how to use the TPM_RETURNCMD flag on the call to
TrackPopupMenuEx() to return the ID of the item clicked, so you don't need to
subclass.

. . . . . . . . . . . . . . . . . . . . . .
Please post/reply to the
newsgroup(s)

Klaus H. Probst, MVP
   http://www.vbbox.com/
   http://www.mvps.org/ccrp/


Quote:
> Hi!
> I'm creating the menus using API's CreateMenu and InsertMenuItem. But i
> doesn't succeeded to catch the menu's Click event. There mignt be another
> way to menu handling.
> Can anybody suggest me how can i use these menus?
> Thanks!

> - Vit



Sat, 06 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Manually created menus handling!

2. Multi-select Menu or Permanent Menu and MDI_CHILD Menu Handle

3. Handling property pages manually.

4. Progamming manually a Context Menu Items

5. Displaying menus with a menu handle

6. Manually create cookies in vb

7. Hooking WNDPROC on a manually created window

8. Sorting results in EOF/BOF for a manually created recordset

9. Manually Created disconnected recordset help???

10. Manually create a results set?

11. Manually creating a Setup program

12. create a manually timer thread.

 

 
Powered by phpBB® Forum Software