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

Function About

outdated/sys/wince/mhmain.c:953–997  ·  view source on GitHub ↗

Mesage handler for about box.

Source from the content-addressed store, hash-verified

951
952// Mesage handler for about box.
953LRESULT CALLBACK
954About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
955{
956 char buf[BUFSZ];
957 TCHAR wbuf[NHSTR_BUFSIZE];
958 RECT main_rt, dlg_rt;
959 SIZE dlg_sz;
960
961 switch (message) {
962 case WM_INITDIALOG:
963 getversionstring(buf);
964 SetDlgItemText(hDlg, IDC_ABOUT_VERSION,
965 NH_A2W(buf, wbuf, NHSTR_BUFSIZE));
966
967 SetDlgItemText(hDlg, IDC_ABOUT_COPYRIGHT,
968 NH_A2W(COPYRIGHT_BANNER_A "\n" COPYRIGHT_BANNER_B
969 "\n" COPYRIGHT_BANNER_C
970 "\n" COPYRIGHT_BANNER_D,
971 wbuf, NHSTR_BUFSIZE));
972
973 /* center dialog in the main window */
974 GetWindowRect(GetNHApp()->hMainWnd, &main_rt);
975 GetWindowRect(hDlg, &dlg_rt);
976 dlg_sz.cx = dlg_rt.right - dlg_rt.left;
977 dlg_sz.cy = dlg_rt.bottom - dlg_rt.top;
978
979 dlg_rt.left = (main_rt.left + main_rt.right - dlg_sz.cx) / 2;
980 dlg_rt.right = dlg_rt.left + dlg_sz.cx;
981 dlg_rt.top = (main_rt.top + main_rt.bottom - dlg_sz.cy) / 2;
982 dlg_rt.bottom = dlg_rt.top + dlg_sz.cy;
983 MoveWindow(hDlg, (main_rt.left + main_rt.right - dlg_sz.cx) / 2,
984 (main_rt.top + main_rt.bottom - dlg_sz.cy) / 2, dlg_sz.cx,
985 dlg_sz.cy, TRUE);
986
987 return TRUE;
988
989 case WM_COMMAND:
990 if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
991 EndDialog(hDlg, LOWORD(wParam));
992 return TRUE;
993 }
994 break;
995 }
996 return FALSE;
997}
998
999/* Set map display mode */
1000void

Callers

nothing calls this directly

Calls 2

getversionstringFunction · 0.85
GetNHAppFunction · 0.70

Tested by

no test coverage detected