MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_init_menu_window

Function mswin_init_menu_window

win/win32/mhmenu.c:102–135  ·  view source on GitHub ↗

-----------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

100
101/*-----------------------------------------------------------------------------*/
102HWND
103mswin_init_menu_window(int type)
104{
105 HWND ret;
106 RECT rt;
107
108 /* get window position */
109 if (GetNHApp()->bAutoLayout) {
110 SetRect(&rt, 0, 0, 0, 0);
111 } else {
112 mswin_get_window_placement(NHW_MENU, &rt);
113 }
114
115 /* create menu window object */
116 ret = CreateDialog(GetNHApp()->hApp, MAKEINTRESOURCE(IDD_MENU),
117 GetNHApp()->hMainWnd, MenuWndProc);
118 if (!ret) {
119 panic("Cannot create menu window");
120 }
121
122 /* move it in the predefined position */
123 if (!GetNHApp()->bAutoLayout) {
124 MoveWindow(ret, rt.left, rt.top, rt.right - rt.left,
125 rt.bottom - rt.top, TRUE);
126 }
127
128 /* Set window caption */
129 SetWindowText(ret, "Menu/Text");
130
131 mswin_apply_window_style(ret);
132
133 SetMenuType(ret, type);
134 return ret;
135}
136/*-----------------------------------------------------------------------------*/
137int
138mswin_menu_window_select_menu(HWND hWnd, int how, MENU_ITEM_P **_selected,

Callers 2

mswin_putstr_exFunction · 0.70
mswin_start_menuFunction · 0.70

Calls 6

CreateDialogFunction · 0.85
mswin_apply_window_styleFunction · 0.85
GetNHAppFunction · 0.70
SetMenuTypeFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected