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

Function WinMain

outdated/sys/wince/winhack.c:31–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29#define MAX_CMDLINE_PARAM 255
30
31int APIENTRY
32WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine,
33 int nCmdShow)
34{
35 INITCOMMONCONTROLSEX InitCtrls;
36 HWND nethackWnd;
37 int argc;
38 char *argv[MAX_CMDLINE_PARAM];
39 size_t len;
40 TCHAR *p;
41 TCHAR wbuf[NHSTR_BUFSIZE];
42 char buf[NHSTR_BUFSIZE];
43 boolean resuming;
44
45 early_init();
46
47 /* ensure that we don't access violate on a panic() */
48 windowprocs.win_raw_print = mswin_raw_print;
49 windowprocs.win_raw_print_bold = mswin_raw_print_bold;
50
51 /* init applicatio structure */
52 _nethack_app.hApp = hInstance;
53 _nethack_app.nCmdShow = nCmdShow;
54 _nethack_app.hAccelTable =
55 LoadAccelerators(hInstance, (LPCTSTR) IDC_WINHACK);
56 _nethack_app.hMainWnd = NULL;
57 _nethack_app.hPopupWnd = NULL;
58 _nethack_app.hMenuBar = NULL;
59 _nethack_app.bmpTiles = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TILES));
60 if (_nethack_app.bmpTiles == NULL)
61 panic("cannot load tiles bitmap");
62 _nethack_app.bmpPetMark =
63 LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_PETMARK));
64 if (_nethack_app.bmpPetMark == NULL)
65 panic("cannot load pet mark bitmap");
66 _nethack_app.bmpMapTiles = _nethack_app.bmpTiles;
67 _nethack_app.mapTile_X = TILE_X;
68 _nethack_app.mapTile_Y = TILE_Y;
69 _nethack_app.mapTilesPerLine = TILES_PER_LINE;
70 _nethack_app.bNoHScroll = FALSE;
71 _nethack_app.bNoVScroll = FALSE;
72
73 _nethack_app.bCmdPad = !mswin_has_keyboard();
74
75 _nethack_app.bWrapText = TRUE;
76 _nethack_app.bFullScreen = TRUE;
77
78#if defined(WIN_CE_SMARTPHONE)
79 _nethack_app.bHideScrollBars = TRUE;
80#else
81 _nethack_app.bHideScrollBars = FALSE;
82#endif
83
84 _nethack_app.bUseSIP = TRUE;
85
86 // check for running nethack programs
87 nethackWnd = FindWindow(szMainWindowClass, NULL);
88 if (nethackWnd) {

Callers

nothing calls this directly

Calls 8

early_initFunction · 0.85
mswin_has_keyboardFunction · 0.85
InitInstanceFunction · 0.85
_strdupFunction · 0.85
pcmainFunction · 0.85
moveloopFunction · 0.85
_get_cmd_argFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected