G_MODULE_EXPORT void VideoOk_released() // Change video mode { ResetBar(); MoveWindows(); gtk_widget_hide(Window_VideoMode); KbootRun(); }
BOOL CreateMonitor() { WNDCLASS wc; HBRUSH bgBrush; char Text[80]; if (hMonitor) { ShowWindow(hMonitor, SW_SHOWNORMAL); SetForegroundWindow(hMonitor); return FALSE; // Alreaqy open } bgBrush = CreateSolidBrush(BGCOLOUR); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = MonWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = DLGWINDOWEXTRA; wc.hInstance = hInst; wc.hIcon = LoadIcon( hInst, MAKEINTRESOURCE(BPQICON) ); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = bgBrush; wc.lpszMenuName = NULL; wc.lpszClassName = ClassName; RegisterClass(&wc); hMonitor=CreateDialog(hInst,ClassName,0,NULL); if (!hMonitor) return (FALSE); wsprintf(Text, "Chat %s Monitor", Session); SetWindowText(hMonitor, Text); readbuff = zalloc(1000); readbufflen = 1000; hMenu=GetMenu(hMonitor); CheckMenuItem(hMenu,MONBBS, MonBBS ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,MONCHAT, MonCHAT ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,MONTCP, MonTCP ? MF_CHECKED : MF_UNCHECKED); DrawMenuBar(hWnd); // Retrieve the handlse to the edit controls. hwndOutput = GetDlgItem(hMonitor, 121); // Set our own WndProcs for the controls. wpOrigOutputProc = (WNDPROC)SetWindowLong(hwndOutput, GWL_WNDPROC, (LONG)OutputProc); if (cfgMinToTray) { AddTrayMenuItem(hMonitor, Text); } ShowWindow(hMonitor, SW_SHOWNORMAL); if (MonitorRect.right < 100 || MonitorRect.bottom < 100) { GetWindowRect(hMonitor, &MonitorRect); } MoveWindow(hMonitor,MonitorRect.left,MonitorRect.top, MonitorRect.right-MonitorRect.left, MonitorRect.bottom-MonitorRect.top, TRUE); MoveWindows(); return TRUE; }
static LRESULT CALLBACK MonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; LPRECT lprc; switch (message) { case WM_ACTIVATE: SetFocus(hwndInput); break; case WM_COMMAND: wmId = LOWORD(wParam); // Remember, these are... wmEvent = HIWORD(wParam); // ...different for Win32! switch (wmId) { case MONBBS: ToggleParam(hMenu, hWnd, &MonBBS, MONBBS); break; case MONCHAT: ToggleParam(hMenu, hWnd, &MonCHAT, MONCHAT); break; case MONTCP: ToggleParam(hMenu, hWnd, &MonTCP, MONTCP); break; case BPQCLEAROUT: SendMessage(hwndOutput,LB_RESETCONTENT, 0, 0); break; case BPQCOPYOUT: CopyToClipboard(hwndOutput); break; //case BPQHELP: // HtmlHelp(hWnd,"BPQTerminal.chm",HH_HELP_FINDER,0); // break; default: return 0; } case WM_SYSCOMMAND: wmId = LOWORD(wParam); // Remember, these are... wmEvent = HIWORD(wParam); // ...different for Win32! switch (wmId) { case SC_MINIMIZE: if (cfgMinToTray) return ShowWindow(hWnd, SW_HIDE); default: return (DefWindowProc(hWnd, message, wParam, lParam)); } case WM_SIZING: lprc = (LPRECT) lParam; Height = lprc->bottom-lprc->top; Width = lprc->right-lprc->left; MoveWindows(); return TRUE; case WM_DESTROY: // Remove the subclass from the edit control. GetWindowRect(hWnd, &MonitorRect); // For save soutine SetWindowLong(hwndInput, GWL_WNDPROC, (LONG) wpOrigInputProc); if (cfgMinToTray) DeleteTrayMenuItem(hWnd); hMonitor = NULL; free(readbuff); readbufflen = 0; break; default: return (DefWindowProc(hWnd, message, wParam, lParam)); } return (0); }
UINT UIARQExtInit(EXTPORTDATA * PortEntry) { int i, port; char Msg[255]; struct TNCINFO * TNC; char * ptr; struct PORTCONTROL * PORT; struct STREAMINFO * STREAM; srand((unsigned int)time(NULL)); port = PortEntry->PORTCONTROL.PORTNUMBER; ReadConfigFile(port, ProcessLine); TNC = TNCInfo[port]; if (TNC == NULL) { // Not defined in Config file sprintf(Msg," ** Error - no info in BPQ32.cfg for this port\n"); WritetoConsole(Msg); return (int) ExtProc; } for (i = 0; i <MAXARQ; i++) { TNC->Streams[i].ARQInfo = zalloc(sizeof(struct ARQINFO)); } TNC->Port = port; TNC->PortRecord = PortEntry; if (PortEntry->PORTCONTROL.PORTCALL[0] == 0) memcpy(TNC->NodeCall, MYNODECALL, 10); else ConvFromAX25(&PortEntry->PORTCONTROL.PORTCALL[0], TNC->NodeCall); TNC->Interlock = PortEntry->PORTCONTROL.PORTINTERLOCK; PortEntry->PORTCONTROL.PROTOCOL = 10; PortEntry->PERMITGATEWAY = TRUE; // Can change ax.25 call on each stream PortEntry->PORTCONTROL.UICAPABLE = 1; // Can send beacons PortEntry->PORTCONTROL.PORTQUALITY = 0; PortEntry->SCANCAPABILITIES = NONE; // Scan Control - None if (PortEntry->PORTCONTROL.PORTPACLEN == 0 || PortEntry->PORTCONTROL.PORTPACLEN > 128) PortEntry->PORTCONTROL.PORTPACLEN = 64; ptr=strchr(TNC->NodeCall, ' '); if (ptr) *(ptr) = 0; // Null Terminate TNC->Hardware = H_UIARQ; if (TNC->BusyWait == 0) TNC->BusyWait = 10; PortEntry->MAXHOSTMODESESSIONS = MAXARQ; i = 0; while (TNC->ARQPorts[i]) { PORT = GetPortTableEntryFromPortNum(TNC->ARQPorts[i]); PORT->UIHook = (FARPROCY)UIHook; PORT->HookPort = (struct PORTCONTROL *)PortEntry; i++; } TNC->WEB_MODE = zalloc(50); TNC->WEB_TRAFFIC = zalloc(100); TNC->WebWindowProc = WebProc; TNC->WebWinX = 520; TNC->WebWinY = 500; TNC->WebBuffer = zalloc(5000); TNC->WEB_COMMSSTATE = zalloc(100); TNC->WEB_TNCSTATE = zalloc(100); TNC->WEB_CHANSTATE = zalloc(100); TNC->WEB_BUFFERS = zalloc(100); TNC->WEB_PROTOSTATE = zalloc(100); TNC->WEB_RESTARTTIME = zalloc(100); TNC->WEB_RESTARTS = zalloc(100); TNC->WEB_MODE = zalloc(50); TNC->WEB_TRAFFIC = zalloc(100); #ifndef LINBPQ CreatePactorWindow(TNC, ClassName, WindowTitle, RigControlRow, PacWndProc, 560, 350); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " MyCall", WS_CHILD | WS_VISIBLE, 5,6,79,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " DestCall", WS_CHILD | WS_VISIBLE, 85,6,79,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " Status", WS_CHILD | WS_VISIBLE, 165,6,84,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " Sent", WS_CHILD | WS_VISIBLE, 250,6,59,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " Rxed", WS_CHILD | WS_VISIBLE, 310,6,59,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " Resent", WS_CHILD | WS_VISIBLE, 370,6,59,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " Acked", WS_CHILD | WS_VISIBLE, 430,6,59,20, TNC->hDlg, NULL, hInstance, NULL); CreateWindowEx(WS_EX_STATICEDGE, "STATIC", " Dirn", WS_CHILD | WS_VISIBLE, 490,6,49,20, TNC->hDlg, NULL, hInstance, NULL); for (i = 0; i <MAXARQ; i++) { STREAM = &TNC->Streams[i]; STREAM->xIDC_MYCALL = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 5, 26 + i*20, 79, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_DESTCALL = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 85, 26 + i*20, 79, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_STATUS = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 165, 26 + i*20, 84, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_SEND = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 250, 26 + i*20, 59, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_RXED = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 310, 26 + i*20, 59, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_RESENT = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 370, 26 + i*20, 59, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_ACKED = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 430, 26 + i*20, 59, 20, TNC->hDlg, NULL, hInstance, NULL); STREAM->xIDC_DIRN = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC", "", WS_CHILD | WS_VISIBLE, 490, 26 + i*20, 49, 20, TNC->hDlg, NULL, hInstance, NULL); } TNC->ClientHeight = 360; TNC->ClientWidth = 560; MoveWindows(TNC); #endif i=sprintf(Msg,"UIARQ\n"); WritetoConsole(Msg); return ((int) ExtProc); }
BOOL CreateConsole(int Stream) { WNDCLASS wc; HBRUSH bgBrush; HMENU hMenu; struct ConsoleInfo * Cinfo = &CINFO; if (Cinfo->hConsole) { ShowWindow(Cinfo->hConsole, SW_SHOWNORMAL); SetForegroundWindow(Cinfo->hConsole); return FALSE; // Alreaqy open } Cinfo->BPQStream = Stream; /* Vallen=80; RegQueryValueEx(hKey,"ConsoleSize",0, (ULONG *)&Type,(UCHAR *)&Size,(ULONG *)&Vallen); Vallen=4; RegQueryValueEx(hKey,"Bells",0, (ULONG *)&Type,(UCHAR *)&Bells,(ULONG *)&Vallen); Vallen=4; RegQueryValueEx(hKey,"StripLF",0, (ULONG *)&Type,(UCHAR *)&StripLF,(ULONG *)&Vallen); Vallen=4; RegQueryValueEx(hKey,"CloseWindowOnBye",0, (ULONG *)&Type,(UCHAR *)&CloseWindowOnBye,(ULONG *)&Vallen); Vallen=4; RegQueryValueEx(hKey,"WarnWrap",0, (ULONG *)&Type,(UCHAR *)&WarnWrap,(ULONG *)&Vallen); Vallen=4; RegQueryValueEx(hKey,"WrapInput",0, (ULONG *)&Type,(UCHAR *)&WrapInput,(ULONG *)&Vallen); Vallen=4; RegQueryValueEx(hKey,"FlashOnConnect",0, (ULONG *)&Type,(UCHAR *)&FlashOnConnect,(ULONG *)&Vallen); */ bgBrush = CreateSolidBrush(BGCOLOUR); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = ConsWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = DLGWINDOWEXTRA; wc.hInstance = hInst; wc.hIcon = LoadIcon( hInst, MAKEINTRESOURCE(IDI_BPQMailChat) ); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = bgBrush; wc.lpszMenuName = NULL; wc.lpszClassName = ClassName; RegisterClass(&wc); Cinfo->hConsole=CreateDialog(hInst,ClassName,0,NULL); if (!Cinfo->hConsole) return (FALSE); hMenu=GetMenu(Cinfo->hConsole); Cinfo->hMenu = hMenu; CheckMenuItem(hMenu,BPQBELLS, (Cinfo->Bells) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,BPQStripLF, (Cinfo->StripLF) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,IDM_WARNINPUT, (Cinfo->WarnWrap) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,IDM_WRAPTEXT, (Cinfo->WrapInput) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,IDM_Flash, (Cinfo->FlashOnConnect) ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(hMenu,IDM_CLOSEWINDOW, (Cinfo->CloseWindowOnBye) ? MF_CHECKED : MF_UNCHECKED); DrawMenuBar(hWnd); // Retrieve the handlse to the edit controls. Cinfo->hwndInput = GetDlgItem(Cinfo->hConsole, 118); Cinfo->hwndOutput = GetDlgItem(Cinfo->hConsole, 117); // Set our own WndProcs for the controls. Cinfo->wpOrigInputProc = (WNDPROC) SetWindowLong(Cinfo->hwndInput, GWL_WNDPROC, (LONG) InputProc); Cinfo->wpOrigOutputProc = (WNDPROC)SetWindowLong(Cinfo->hwndOutput, GWL_WNDPROC, (LONG)OutputProc); if (cfgMinToTray) AddTrayMenuItem(Cinfo->hConsole, "Mail/Chat Console"); ShowWindow(Cinfo->hConsole, SW_SHOWNORMAL); if (Cinfo->ConsoleRect.right < 100 || Cinfo->ConsoleRect.bottom < 100) { GetWindowRect(Cinfo->hConsole, &Cinfo->ConsoleRect); } MoveWindow(Cinfo->hConsole,Cinfo->ConsoleRect.left,Cinfo->ConsoleRect.top, Cinfo->ConsoleRect.right-Cinfo->ConsoleRect.left, Cinfo->ConsoleRect.bottom-Cinfo->ConsoleRect.top, TRUE); MoveWindows(Cinfo); Cinfo->Console = zalloc(sizeof(CIRCUIT)); Cinfo->Console->Active = TRUE; Cinfo->Console->BPQStream = Stream; strcpy(Cinfo->Console->Callsign, SYSOPCall); user = LookupCall(SYSOPCall); if (user == NULL) { user = AllocateUserRecord(SYSOPCall); if (user == NULL) return 0; // Cant happen?? } time(&user->TimeLastCOnnected); Cinfo->Console->UserPointer = user; Cinfo->Console->lastmsg = user->lastmsg; Cinfo->Console->paclen=236; Cinfo->Console->sysop = TRUE; Cinfo->Console->PageLen = user->PageLen; Cinfo->Console->Paging = (user->PageLen > 0); nodeprintf(Cinfo->Console, BBSSID, Ver[0], Ver[1], Ver[2], Ver[3], ALLOWCOMPRESSED ? "B" : "", "", "", "F"); if (user->Name[0] == 0) { Cinfo->Console->Flags |= GETTINGUSER; SendUnbuffered(-1, NewUserPrompt, strlen(NewUserPrompt)); } else SendWelcomeMsg(-1, Cinfo->Console, user); return TRUE; }
G_MODULE_EXPORT void Games_released() // Popup game menu { MoveWindows(); CreateMenu("scripts/Installers/GameList", 0); }
G_MODULE_EXPORT void Tools_released() // Popup tool menu { MoveWindows(); CreateMenu("scripts/Installers/ToolList", 1); }
G_MODULE_EXPORT void Applications_released() // Popup app menu { MoveWindows(); CreateMenu("scripts/Installers/AppList", 2); }