Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionError in ShowWindow() function ? Pin
Amarelia14-Sep-05 3:12
Amarelia14-Sep-05 3:12 
AnswerRe: Error in ShowWindow() function ? Pin
krmed14-Sep-05 3:24
krmed14-Sep-05 3:24 
GeneralRe: Error in ShowWindow() function ? Pin
Amarelia14-Sep-05 3:44
Amarelia14-Sep-05 3:44 
AnswerRe: Error in ShowWindow() function ? Pin
kakan14-Sep-05 4:12
professionalkakan14-Sep-05 4:12 
QuestionHow to disable a menu item Pin
snprani14-Sep-05 2:50
snprani14-Sep-05 2:50 
AnswerRe: How to disable a menu item Pin
-Dy14-Sep-05 9:45
-Dy14-Sep-05 9:45 
QuestionHow to disable a menu item Pin
snprani14-Sep-05 2:46
snprani14-Sep-05 2:46 
AnswerRe: How to disable a menu item Pin
kakan14-Sep-05 2:56
professionalkakan14-Sep-05 2:56 
From MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wcemfc4/html/aflrfcmenucolcolenablemenuitem.asp[^])

This method either enables or disables and dims a menu item.

UINT EnableMenuItem (
UINT nIDEnableItem,
UINT nEnable );
Parameters
nIDEnableItem
Specifies the menu item to be enabled, as determined by nEnable. This parameter can specify pop-up menu items as well as standard menu items.
nEnable
Specifies the action to take. It can be a combination of MF_DISABLED, MF_ENABLED, or MF_GRAYED, with MF_BYCOMMAND or MF_BYPOSITION. These values can be combined by using the bitwise OR operator. These values have the following meanings:
MF_BYCOMMAND Specifies that the parameter gives the command ID of the existing menu item. This is the default.
MF_BYPOSITION Specifies that the parameter gives the position of the existing menu item. The first item is at position zero.
MF_DISABLED Disables the menu item so that it cannot be selected but does not dim it.
MF_ENABLED Enables the menu item so that it can be selected and restores it from its dimmed state.
MF_GRAYED Disables the menu item so that it cannot be selected and dims it.
Return Value
Previous state (MF_DISABLED, MF_ENABLED, or MF_GRAYED) or –1 if not valid.

So, try MF_GRAYED. The the menu item will be both disabled and grayed.

-- modified at 8:56 Wednesday 14th September, 2005
QuestionWMI,Help,help,help,Help,help,help,Help,help,help Pin
Tcpip200514-Sep-05 2:31
Tcpip200514-Sep-05 2:31 
AnswerRe: WMI,Help,help,help,Help,help,help,Help,help,help Pin
Tcpip200514-Sep-05 2:37
Tcpip200514-Sep-05 2:37 
GeneralRe: WMI,gni gni gni gni gni Pin
toxcct14-Sep-05 3:00
toxcct14-Sep-05 3:00 
GeneralRe: WMI,gni gni gni gni gni Pin
David Crow14-Sep-05 3:12
David Crow14-Sep-05 3:12 
GeneralRe: WMI,gni gni gni gni gni Pin
toxcct14-Sep-05 3:17
toxcct14-Sep-05 3:17 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 3:27
Tcpip200514-Sep-05 3:27 
GeneralRe: WMI,gni gni gni gni gni Pin
toxcct14-Sep-05 3:33
toxcct14-Sep-05 3:33 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 3:57
Tcpip200514-Sep-05 3:57 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 4:06
Tcpip200514-Sep-05 4:06 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 3:22
Tcpip200514-Sep-05 3:22 
GeneralSorry,I'm so sorry.Code here Pin
Tcpip200514-Sep-05 3:53
Tcpip200514-Sep-05 3:53 
GeneralRe: Sorry,I'm so sorry.Code here Pin
David Crow14-Sep-05 8:41
David Crow14-Sep-05 8:41 
GeneralRe: Sorry,I'm so sorry.Code here Pin
G Haranadh15-Sep-05 1:10
G Haranadh15-Sep-05 1:10 
QuestionSOCKETS SUPPORT Pin
REU14-Sep-05 2:22
REU14-Sep-05 2:22 
AnswerRe: SOCKETS SUPPORT Pin
charlieg14-Sep-05 12:04
charlieg14-Sep-05 12:04 
QuestionHow to settle this problem Pin
momer14-Sep-05 1:17
momer14-Sep-05 1:17 
AnswerRe: How to settle this problem Pin
prasad_som14-Sep-05 1:52
prasad_som14-Sep-05 1:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.