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

Function mswin_init_status_window

outdated/sys/wince/mhstatus.c:25–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23static void FormatStatusString(char *text, int format);
24
25HWND
26mswin_init_status_window()
27{
28 static int run_once = 0;
29 HWND ret;
30 NHStatusWindow *data;
31
32 if (!run_once) {
33 register_status_window_class();
34 run_once = 1;
35 }
36
37 ret = CreateWindow(szStatusWindowClass, NULL,
38 WS_CHILD | WS_DISABLED | WS_CLIPSIBLINGS,
39 0, /* x position */
40 0, /* y position */
41 0, /* x-size - we will set it later */
42 0, /* y-size - we will set it later */
43 GetNHApp()->hMainWnd, NULL, GetNHApp()->hApp, NULL);
44 if (!ret)
45 panic("Cannot create status window");
46
47 EnableWindow(ret, FALSE);
48
49 data = (PNHStatusWindow) malloc(sizeof(NHStatusWindow));
50 if (!data)
51 panic("out of memory");
52
53 ZeroMemory(data, sizeof(NHStatusWindow));
54 data->nhstat_format = NHSTAT_LINES_4;
55 SetWindowLong(ret, GWL_USERDATA, (LONG) data);
56 return ret;
57}
58
59void
60register_status_window_class()

Callers 1

mswin_create_nhwindowFunction · 0.70

Calls 3

GetNHAppFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected