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

Function mswin_ext_cmd_window

win/win32/mhdlg.c:174–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172INT_PTR CALLBACK ExtCmdDlgProc(HWND, UINT, WPARAM, LPARAM);
173
174int
175mswin_ext_cmd_window(int *selection)
176{
177 if (iflags.debug_fuzzer) {
178 *selection = rnd_extcmd_idx();
179
180 if (*selection != -1)
181 return IDOK;
182 else
183 return IDCANCEL;
184 }
185
186 INT_PTR ret;
187 struct extcmd_data data;
188
189 /* init dialog data */
190 ZeroMemory(&data, sizeof(data));
191 *selection = -1;
192 data.selection = selection;
193
194 /* create modal dialog window */
195 ret = DialogBoxParam(GetNHApp()->hApp, MAKEINTRESOURCE(IDD_EXTCMD),
196 GetNHApp()->hMainWnd, ExtCmdDlgProc, (LPARAM) &data);
197 if (ret == -1)
198 panic("Cannot create extcmd window");
199 return (int) ret;
200}
201
202INT_PTR CALLBACK
203ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Callers 1

mswin_get_ext_cmdFunction · 0.70

Calls 3

rnd_extcmd_idxFunction · 0.85
GetNHAppFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected