int WINAPI ProcessPanelInputW(const struct ProcessPanelInputInfo *info) { if (info->StructSize < sizeof(*info)) return FALSE; if (info->Rec.EventType != KEY_EVENT) return FALSE; CServiceManager* sm = (CServiceManager*)info->hPanel; if (info->Rec.Event.KeyEvent.wVirtualKeyCode == VK_F3 && info->Rec.Event.KeyEvent.dwControlKeyState == 0) return ViewServiceInfo(sm); if (info->Rec.Event.KeyEvent.wVirtualKeyCode == VK_F4 && info->Rec.Event.KeyEvent.dwControlKeyState == 0) return EditService(sm); else if (info->Rec.Event.KeyEvent.wVirtualKeyCode == VK_F5 && info->Rec.Event.KeyEvent.dwControlKeyState == 0) return StartService(sm); else if (info->Rec.Event.KeyEvent.wVirtualKeyCode == VK_F6 && info->Rec.Event.KeyEvent.dwControlKeyState == 0) return SelectComputer(sm); else if (info->Rec.Event.KeyEvent.wVirtualKeyCode == VK_F7 && info->Rec.Event.KeyEvent.dwControlKeyState == 0) return PauseService(sm); else if (info->Rec.Event.KeyEvent.wVirtualKeyCode == VK_F8 && info->Rec.Event.KeyEvent.dwControlKeyState == 0) return StopService(sm); return FALSE; }
int main(int argc, char *argv[]) { int loop = 1; struct passwd *pw; /* * Find out who is on the keyboard or automated the keyboard. */ pw = getpwuid(geteuid()); if (strcmp(pw->pw_name, (char *)"ftnd")) { printf("ERROR: only user \"ftnd\" may use this program\n"); exit(FTNERR_INIT_ERROR); } /* * Read the global configuration data, registrate connection */ config_check(getenv("FTND_ROOT")); config_read(); if (strlen(CFG.debuglog) == 0) snprintf(CFG.debuglog, 15, "debug.log"); InitClient(pw->pw_name, (char *)"ftnsetup", CFG.location, CFG.logfile, 0x1f, CFG.error_log, CFG.mgrlog, CFG.debuglog); /* * Setup several signals so when the program terminate's it * will properly close the curses screens. */ signal(SIGINT, (void (*))die); signal(SIGBUS, (void (*))die); signal(SIGSEGV,(void (*))die); signal(SIGTERM,(void (*))die); signal(SIGKILL,(void (*))die); signal(SIGIOT, (void (*))die); oldmask = umask(002); do_quiet = TRUE; Syslog(' ', " "); Syslog(' ', "FTNSETUP v%s started by %s", VERSION, pw->pw_name); if (init) Syslog('+', "Cmd: ftnsetup init"); if ((argc == 2) && (strncmp(tl(argv[1]), "i", 1) == 0)) init = TRUE; else screen_start((char *)"ftnsetup"); if (lockprogram((char *)"ftnsetup")) { printf("\n\7Another ftnsetup is already running, abort.\n\n"); die(FTNERR_NO_PROGLOCK); } bbs_free = FALSE; initdatabases(); if (!init) { do { IsDoing("Browsing Menu"); clr_index(); set_color(WHITE, BLACK); ftnd_mvprintw( 5, 6, "0. MAIN SETUP"); set_color(CYAN, BLACK); ftnd_mvprintw( 7, 6, "1. Edit Global configuration"); ftnd_mvprintw( 8, 6, "2. Edit Fido Networks"); ftnd_mvprintw( 9, 6, "3. Edit Archiver Programs"); ftnd_mvprintw(10, 6, "4. Edit Virus Scanners"); ftnd_mvprintw(11, 6, "5. Edit Modem types"); ftnd_mvprintw(12, 6, "6. Edit TTY lines info"); ftnd_mvprintw(13, 6, "7. Edit Fidonet Nodes"); ftnd_mvprintw(14, 6, "8. Edit BBS Setup"); ftnd_mvprintw(15, 6, "9. Edit Mail Setup"); ftnd_mvprintw(16, 6, "10. Edit File Echo's setup"); ftnd_mvprintw(17, 6, "11. Edit Newfiles Groups"); ftnd_mvprintw( 7,46, "12. Edit Newfiles Reports"); ftnd_mvprintw( 8,46, "13. Edit FileFind Setup"); ftnd_mvprintw( 9,46, "14. Edit Files Database"); ftnd_mvprintw(10,46, "15. Edit BBS Users"); ftnd_mvprintw(11,46, "16. Edit Services"); ftnd_mvprintw(12,46, "17. Edit Domains"); ftnd_mvprintw(13,46, "18. Edit Task Manager"); ftnd_mvprintw(14,46, "19. Edit Routing Table"); ftnd_mvprintw(15,46, "20. Edit Internet BBS Chat"); ftnd_mvprintw(16,46, "21. Show software information"); ftnd_mvprintw(17,46, "22. Create site documents"); switch(select_menu(22)) { case 0: loop = 0; break; case 1: global_menu(); break; case 2: EditFidonet(); break; case 3: EditArchive(); break; case 4: EditVirus(); break; case 5: EditModem(); break; case 6: EditTtyinfo(); break; case 7: EditNodes(); break; case 8: bbs_menu(); break; case 9: mail_menu(); break; case 10: tic_menu(); break; case 11: EditNGroup(); break; case 12: EditNewfiles(); break; case 13: EditFilefind(); break; case 14: EditFDB(); break; case 15: EditUsers(); break; case 16: EditService(); break; case 17: EditDomain(); break; case 18: task_menu(); break; case 19: EditRoute(); break; case 20: EditIBC(); break; case 21: soft_info(); break; case 22: site_docs(); break; } } while (loop == 1); } die(FTNERR_OK); return 0; }