🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm.x86
Article #116

Re: disable menuitem. Help !!

#116
From: device
Date: Mon, 08 Feb 1999 00:00
36 lines
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 !!!
Technical Details
Message-ID: <79no1f$gkl$1@winter.news.rcn.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <79niu0$ehm$1@winter.news.rcn.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: feaef,78a48dcea00c7952
X-Google-Attributes: gidfeaef,public
X-Google-Thread: f7d8d,78a48dcea00c7952
X-Google-Attributes: gidf7d8d,public
X-Google-Thread: 114917,78a48dcea00c7952
X-Google-Attributes: gid114917,public
From: device <dpsiciliaNO_SPAM@mindspring.com>
Subject: Re: disable menuitem. Help !!
Date: 1999/02/08
Message-ID: <79no1f$gkl$1@winter.news.rcn.net>
X-Deja-AN: 442163982
Content-Transfer-Encoding: 7bit
Approved: <johnfine@erols.com>
References: <79niu0$ehm$1@winter.news.rcn.net>
X-Server-Date: 8 Feb 1999 21:54:20 GMT
Content-Type: text/plain; charset=us-ascii
X-Mozilla-Status: 0801
X-Complaints-To: abuse@rcn.com
X-Trace: oSXHk6nAtgawLFAnGKb0VcudOU+9OPvyVgsQ5okWZmQ=
Organization: MindSpring Enterprises
Mime-Version: 1.0
NNTP-Posting-Date: 8 Feb 1999 22:21:35 GMT
Newsgroups: comp.lang.asm.x86,alt.lang.asm,borland.public.tasm