-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMenu.cpp
More file actions
26 lines (19 loc) · 816 Bytes
/
Menu.cpp
File metadata and controls
26 lines (19 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "Menu.h"
#include <Windows.h>
/// <summary>
/// This function creates the menus.
/// </summary>
/// <param name="hwnd:">Handle to the window of interest.</param>
void CreateMenus(HWND hwnd)
{
//Menus
HMENU hMenu = CreateMenu(); //Highest level Menu Bar
HMENU HMenuGame = CreateMenu(); // Top level Menu for the "New Game" menu
HMENU HMenuHelp = CreateMenu(); // Top Level Menu for the "Help" menu
AppendMenu(hMenu, MF_POPUP, (UINT_PTR)HMenuGame, L"Game");
AppendMenu(HMenuGame, MF_STRING, (UINT_PTR)MENU_GAME_MAINMENU, L"New Game");
AppendMenu(HMenuGame, MF_STRING, (UINT_PTR)MENU_GAME_EXIT, L"Exit");
AppendMenu(hMenu, MF_POPUP, (UINT_PTR)HMenuHelp, L"Help");
AppendMenu(HMenuHelp, MF_STRING, (UINT_PTR)MENU_HELP_ABOUT, L"About");
SetMenu(hwnd, hMenu);
}