|
CMenuBar Class |
Description
The CMenuBar class provides a menu inside a rebar control. This menu is based on a toolbar control, and CMenuBar inherits from CToolBar.
Member functions
| CMenuBar | CMenuBar();Constructor for CMenuBar. |
HMENU GetMenu() const;Returns the handle to the menu displayed by the menubar.
virtual void SetMenu(HMENU hMenu);Sets the menu for the MenuBar.
Overridables
| OnCreate | virtual void OnCreate();Called when the window is created. |
| OnCustomDraw | virtual LRESULT OnCustomDraw(NMHDR* pNMHDR);Called to perform custom drawing. |
| OnKeyDown | virtual void OnKeyDown(WPARAM wParam, LPARAM lParam);Called when a key is pressed. |
| OnLButtonDown | virtual void OnLButtonDown(WPARAM wParam, LPARAM lParam);Called when the left mouse button is pressed. |
| OnLButtonUp | virtual void OnLButtonUp(WPARAM wParam, LPARAM lParam);Called when a key is released. |
| OnMenuChar | virtual void OnMenuChar(WPARAM wParam, LPARAM lParam);Called when the user presses a menu mnemonic character that doesn't match any of the predefined mnemonics in the current menu. |
| OnMenuInput | virtual BOOL OnMenuInput(UINT uMsg, WPARAM wParam, LPARAM lParam);Called to process menu input. |
| OnMouseLeave | virtual void OnMouseLeave();Called when the cursor leave the client area of the window. |
| OnMouseMove | virtual void OnMouseMove(WPARAM wParam, LPARAM lParam);Called when the cursor moves. |
| OnNotifyReflect | virtual LRESULT OnNotifyReflect(WPARAM wParam, LPARAM lParam);Called in response to a notification from the menubar. |
| OnSysCommand | virtual void OnSysCommand(WPARAM wParam, LPARAM lParam);Called to processes keys when the Alt or F10 key is pressed. |
| OnWindowPosChanged | virtual void OnWindowPosChanged();Called when the windows size or position has changed. |
| PreCreate | virtual void PreCreate(CREATESTRUCT &cs);Sets the window creating parameters. |
| PreRegisterClass | virtual void PreRegisterClass(WNDCLASS &wc);Sets the window class parameters. |
Base class Members
For base class members, refer to the members of CToolBar.
Remarks
CMenuBar is used by CFrame and CMDIFrame to provide the menu.
Summary Information
| Header file | frame.h |
| Win32/64 support | Yes |
| WinCE support | No |
| Library required | Comctl32.lib |