Advertisement

Disabling File Menu

Started by November 09, 2004 02:18 PM
0 comments, last by llvllatrix 20 years, 1 month ago
Hello all, I cannot figure out how to disable the menu key ( alt key ) in a windowed application. Both the MFC & Win32 Nehe basecode have this "problem", where if you press alt during the program the window will cease to update, because you have selected the "file" menu. If you hit enter after pressing alt it will actually bring the file menu up. One would generally assume the that sending in NULL for the hMenu paramater to CreateWindow() or CreateWindowEx() would get rid of the menu, but looking into the msdn specifying NULL for that parameter just gives you a default class menu: hMenu [in] Handle to a menu, or specifies a child-window identifier, depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. The problem gets a little more complex with MFC i supppose, since you arent calling CreateWinow at all. Anyone know how to disable the file menu completely? -gf
Have you tried manually checking and removing the message in winproc?

This topic is closed to new replies.

Advertisement