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

Function mswin_popup_display

win/win32/mswproc.c:2254–2309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2252}
2253
2254void
2255mswin_popup_display(HWND hWnd, int *done_indicator)
2256{
2257 MSG msg;
2258 HWND hChild;
2259 HMENU hMenu;
2260 int mi_count;
2261 int i;
2262
2263 /* activate the menu window */
2264 GetNHApp()->hPopupWnd = hWnd;
2265
2266 mswin_layout_main_window(hWnd);
2267
2268 /* disable game windows */
2269 for (hChild = GetWindow(GetNHApp()->hMainWnd, GW_CHILD); hChild;
2270 hChild = GetWindow(hChild, GW_HWNDNEXT)) {
2271 if (hChild != hWnd)
2272 EnableWindow(hChild, FALSE);
2273 }
2274
2275 /* disable menu */
2276 hMenu = GetMenu(GetNHApp()->hMainWnd);
2277 mi_count = GetMenuItemCount(hMenu);
2278 for (i = 0; i < mi_count; i++) {
2279 EnableMenuItem(hMenu, i, MF_BYPOSITION | MF_GRAYED);
2280 }
2281 DrawMenuBar(GetNHApp()->hMainWnd);
2282
2283 /* bring menu window on top */
2284 SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
2285 SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
2286 SetFocus(hWnd);
2287
2288 /* go into message loop */
2289 while (IsWindow(hWnd) && (done_indicator == NULL || !*done_indicator)) {
2290 if (!iflags.debug_fuzzer || PeekMessage(&msg, NULL, 0, 0, FALSE)) {
2291 if(GetMessage(&msg, NULL, 0, 0) != 0) {
2292 if (msg.message == WM_MSNH_COMMAND ||
2293 !IsDialogMessage(hWnd, &msg)) {
2294 if (!TranslateAccelerator(msg.hwnd,
2295 GetNHApp()->hAccelTable, &msg)) {
2296 TranslateMessage(&msg);
2297 DispatchMessage(&msg);
2298 }
2299 }
2300 } else {
2301 /* WM_QUIT */
2302 break;
2303 }
2304 } else {
2305 nhassert(iflags.debug_fuzzer);
2306 PostMessage(hWnd, WM_MSNH_COMMAND, MSNH_MSG_RANDOM_INPUT, 0);
2307 }
2308 }
2309}
2310
2311void

Callers 2

Calls 2

GetNHAppFunction · 0.70
mswin_layout_main_windowFunction · 0.70

Tested by

no test coverage detected