Thread View: comp.lang.asm.x86
3 messages
3 total messages
Started by <anybody>
Mon, 08 Feb 1999 00:00
disable menuitem. Help !!
Author: <anybody>
Date: Mon, 08 Feb 1999 00:00
Date: Mon, 08 Feb 1999 00:00
16 lines
1197 bytes
1197 bytes
Hello Out there I try to disable a menu item with the following code call GetMenu,hdlg mov ebx,eax call GetMenuItemID,ebx,0 call EnableMenuItem,ebx,eax,MF_GRAYED This fails... 1. I dont know if this is the way to disable a menu (are there other ways) 2. I don't understand the menu item positioning in GetMenuItemID Please explain !!!
Re: disable menuitem. Help !!
Author: device
Date: Mon, 08 Feb 1999 00:00
Date: Mon, 08 Feb 1999 00:00
36 lines
1871 bytes
1871 bytes
To disable a menu item(ex. the exit in the file menu), do this: call GetMenu,[win_handle] call GetSubMenu,eax,0 ; index of drop-down menu mov ebx,eax call GetMenuItemID,eax,5 ; index of item in menu call EnableMenuItem,ebx,eax,MF_GRAYED call DrawMenuBar,[win_handle] To disable a whole drop down menu(ex. the whole file menu), do this: call GetMenu,[win_handle] mov ebx,eax call GetSubMenu,eax,0 ; index of drop-down menu call EnableMenuItem,ebx,eax,1 call DrawMenuBar,[win_handle] Dave ---- Hello Out there > > I try to disable a menu item with the following code > > call GetMenu,hdlg > mov ebx,eax > call GetMenuItemID,ebx,0 > call EnableMenuItem,ebx,eax,MF_GRAYED > > This fails... > > 1. I dont know if this is the way to disable a menu (are there other > ways) > 2. I don't understand the menu item positioning in GetMenuItemID > > Please explain !!!
Re: disable menuitem. Help !!
Author: Alan Illeman
Date: Tue, 09 Feb 1999 00:00
Date: Tue, 09 Feb 1999 00:00
32 lines
1603 bytes
1603 bytes
Try.. call GetMenu,hdlg mov ebx,eax call GetMenuItemID,ebx,0 call EnableMenuItem,ebx,eax,MF_GRAYED+MF_BYPOSITION ^^^^^^^^^^^^^^^^^^^^^^^ The position is zero based. If you have a top-level menu item called File which when clicked produces a drop-down menu consisting of New, Save, SaveAs, Exit then New is 0, Save is 1, etc wrote in message <79niu0$ehm$1@winter.news.rcn.net>... >Hello Out there > >I try to disable a menu item with the following code > >call GetMenu,hdlg >mov ebx,eax >call GetMenuItemID,ebx,0 >call EnableMenuItem,ebx,eax,MF_GRAYED > >This fails... > > 1. I dont know if this is the way to disable a menu (are there other >ways) > 2. I don't understand the menu item positioning in GetMenuItemID > >Please explain !!!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads