Files
gui/windows/res/app.rc
T
Claude e6a3f4ad89 Add Copy, Capture and Print to the Windows terminals
The terminal control keeps a selection: drag with the left button,
double-click a word, Shift with the mouse when the remote takes it.
Copy (Ctrl+Insert), Paste to Host (Shift+Insert) and Select All are in
a new Edit menu and on the right button's menu, as HyperTerminal has
them.

capture.cpp adds Capture Text (the line's bytes to a file), Capture to
Printer (its text printed when you stop), each with Pause, and
Modem > Print (the screen or the selection). What the remote sends to
its printer port (CSI 5 i) now goes to the printer; before, the app
discarded it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRekyRUhR43KbmGNXK
2026-11-20 22:14:14 +00:00

247 lines
11 KiB
Plaintext

/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (C) 2026 D-Modem Authors
*
* app.rc - the Windows app's icon, menu and dialogs (MS Shell Dlg: MS
* Sans Serif on Windows 9x, Tahoma or Segoe UI later)
*/
#include <windows.h>
#include "../src/resource.h"
IDI_APP ICON "dmodem.ico"
/* visual styles from Windows XP on (Windows 9x ignores it) */
1 24 "app.manifest"
IDR_MENU MENU
BEGIN
POPUP "&Modem"
BEGIN
MENUITEM "&Start or Stop", IDM_START
MENUITEM "&Line Settings...", IDM_LINE
MENUITEM SEPARATOR
MENUITEM "&Print...", IDM_FPRINT
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Copy\tCtrl+Insert", IDM_EDCOPY
MENUITEM "&Paste to Host\tShift+Insert", IDM_EDPASTE
MENUITEM SEPARATOR
MENUITEM "Select &All", IDM_SELALL
END
POPUP "&Transfer"
BEGIN
MENUITEM "&Send File...", IDM_SEND
MENUITEM "&Receive File...", IDM_RECEIVE
MENUITEM SEPARATOR
MENUITEM "&Automatic Receive (ZMODEM, Kermit)", IDM_AUTORECV
MENUITEM SEPARATOR
MENUITEM "&Cancel Transfer", IDM_XCANCEL
MENUITEM SEPARATOR
MENUITEM "Capture &Text...", IDM_CAPTURE
MENUITEM "Capture Text: Pa&use", IDM_CAPPAUSE
MENUITEM "Capture Text: St&op", IDM_CAPSTOP
MENUITEM SEPARATOR
MENUITEM "Capture to &Printer", IDM_CAPPRINT
MENUITEM "Capture to Printer: Pau&se", IDM_PRNPAUSE
END
POPUP "&Help"
BEGIN
MENUITEM "&About D-Modem", IDM_ABOUT
END
END
IDD_LINE DIALOG 0, 0, 300, 286
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Line Settings"
FONT 8, "MS Shell Dlg"
BEGIN
AUTORADIOBUTTON "Start &dmodemd on this computer (Windows 7 or later)", IDC_L_DMODEMD, 8, 8, 284, 10, WS_GROUP | WS_TABSTOP
LTEXT "SIP &user:", -1, 20, 24, 60, 8
EDITTEXT IDC_L_USER, 84, 22, 120, 12, ES_AUTOHSCROLL
AUTOCHECKBOX "&No account", IDC_L_ANONYMOUS, 210, 23, 82, 10, WS_TABSTOP
LTEXT "&Password:", -1, 20, 40, 60, 8
EDITTEXT IDC_L_PASSWORD, 84, 38, 120, 12, ES_AUTOHSCROLL | ES_PASSWORD
LTEXT "Ser&ver:", -1, 20, 56, 60, 8
EDITTEXT IDC_L_SERVER, 84, 54, 208, 12, ES_AUTOHSCROLL
AUTOCHECKBOX "Take &calls (register with the server)", IDC_L_LISTEN, 20, 72, 200, 10, WS_TABSTOP
AUTOCHECKBOX "Fax over &T.38", IDC_L_T38, 20, 84, 120, 10, WS_TABSTOP
AUTOCHECKBOX "Mark calls as modem data (V.15&2)", IDC_L_V152, 140, 84, 152, 10, WS_TABSTOP
AUTOCHECKBOX "Modem relay (V.15&0.1)", IDC_L_V150, 20, 96, 120, 10, WS_TABSTOP
LTEXT "C&ountry:", -1, 20, 112, 60, 8
EDITTEXT IDC_L_COUNTRY, 84, 110, 80, 12, ES_AUTOHSCROLL
LTEXT "(empty for the USA)", -1, 170, 112, 120, 8
LTEXT "USB &modem:", -1, 20, 128, 60, 8
EDITTEXT IDC_L_USB, 84, 126, 80, 12, ES_AUTOHSCROLL
LTEXT "(auto, or empty for SIP)", -1, 170, 128, 120, 8
LTEXT "dmodemd.e&xe:", -1, 20, 144, 60, 8
EDITTEXT IDC_L_PATH, 84, 142, 152, 12, ES_AUTOHSCROLL
PUSHBUTTON "&Browse...", IDC_L_BROWSE, 240, 141, 52, 14
AUTORADIOBUTTON "dmodemd on &another computer, or as a service (TCP)", IDC_L_TCP, 8, 164, 284, 10, WS_TABSTOP
LTEXT "&Address:", -1, 20, 180, 60, 8
EDITTEXT IDC_L_ADDRESS, 84, 178, 120, 12, ES_AUTOHSCROLL
AUTORADIOBUTTON "A modem on a &serial port", IDC_L_COM, 8, 198, 284, 10, WS_TABSTOP
LTEXT "P&ort:", -1, 20, 214, 60, 8
COMBOBOX IDC_L_PORT, 84, 212, 80, 120, CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
LTEXT "Commands when the modem &opens:", -1, 8, 236, 140, 8
EDITTEXT IDC_L_INIT, 8, 246, 284, 12, ES_AUTOHSCROLL
DEFPUSHBUTTON "OK", IDOK, 186, 266, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 242, 266, 50, 14
END
IDD_SETTING DIALOG 0, 0, 240, 110
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Change Setting"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "", IDC_S_LABEL, 8, 8, 224, 8
LTEXT "", IDC_S_HELP, 8, 20, 224, 20
COMBOBOX IDC_S_LIST, 8, 44, 224, 140, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_S_EDIT, 8, 44, 224, 12, ES_AUTOHSCROLL
LTEXT "", IDC_S_RANGE, 8, 62, 224, 8
LTEXT "", IDC_S_DEFAULT, 8, 74, 224, 8
DEFPUSHBUTTON "OK", IDOK, 126, 90, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 182, 90, 50, 14
END
/* the Remote page's SSH login: up to four questions, each answer shown
(IDC_A_E0 + i) or hidden (IDC_A_E0P + i) */
IDD_ASK DIALOG 0, 0, 260, 170
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Log In"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "", IDC_A_HEAD, 8, 8, 244, 10
LTEXT "", IDC_A_TEXT, 8, 20, 244, 24
LTEXT "", IDC_A_Q0, 8, 48, 90, 8
EDITTEXT IDC_A_E0, 100, 46, 152, 12, ES_AUTOHSCROLL
EDITTEXT IDC_A_E0P, 100, 46, 152, 12, ES_AUTOHSCROLL | ES_PASSWORD
LTEXT "", 964, 8, 66, 90, 8
EDITTEXT 968, 100, 64, 152, 12, ES_AUTOHSCROLL
EDITTEXT 972, 100, 64, 152, 12, ES_AUTOHSCROLL | ES_PASSWORD
LTEXT "", 965, 8, 84, 90, 8
EDITTEXT 969, 100, 82, 152, 12, ES_AUTOHSCROLL
EDITTEXT 973, 100, 82, 152, 12, ES_AUTOHSCROLL | ES_PASSWORD
LTEXT "", 966, 8, 102, 90, 8
EDITTEXT 970, 100, 100, 152, 12, ES_AUTOHSCROLL
EDITTEXT 974, 100, 100, 152, 12, ES_AUTOHSCROLL | ES_PASSWORD
DEFPUSHBUTTON "&Log In", IDOK, 146, 150, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 202, 150, 50, 14
END
/* the Remote page's SSH login: by OpenSSH's keys and the agent, the
agent alone, or a key file (and a PuTTY key's import) */
IDD_LOGIN DIALOG 0, 0, 260, 150
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "SSH Login"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Log in &with:", -1, 8, 10, 56, 8
COMBOBOX IDC_K_HOW, 66, 8, 186, 60, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "&Key file (OpenSSH's, PEM or PuTTY's .ppk):", -1, 8, 28, 244, 8
EDITTEXT IDC_K_KEY, 8, 40, 186, 12, ES_AUTOHSCROLL
PUSHBUTTON "&Browse...", IDC_K_BROWSE, 200, 39, 52, 14
PUSHBUTTON "&Import PuTTY Key...", IDC_K_IMPORT, 8, 58, 90, 14
LTEXT "&Agent (empty: Pageant, else OpenSSH's; or pageant, or a pipe):", -1, 8, 80, 244, 8
EDITTEXT IDC_K_AGENT, 8, 92, 244, 12, ES_AUTOHSCROLL
LTEXT "", IDC_K_STATE, 8, 108, 244, 8
DEFPUSHBUTTON "OK", IDOK, 146, 128, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 202, 128, 50, 14
END
/* the Transfer menu's Send File: the file (or files), the protocol, and
what to type at the remote first */
IDD_XSEND DIALOG 0, 0, 280, 132
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Send File"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Filename (ZMODEM, YMODEM, Kermit: more than one, with ; between):", -1, 8, 8, 264, 8
EDITTEXT IDC_F_FILE, 8, 20, 206, 12, ES_AUTOHSCROLL
PUSHBUTTON "&Browse...", IDC_F_BROWSE, 220, 19, 52, 14
LTEXT "&Protocol:", -1, 8, 42, 60, 8
COMBOBOX IDC_F_PROTO, 70, 40, 144, 140, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "&Type at the remote first:", -1, 8, 60, 90, 8
EDITTEXT IDC_F_COMMAND, 100, 58, 172, 12, ES_AUTOHSCROLL
LTEXT "", IDC_F_HINT, 8, 76, 264, 32
DEFPUSHBUTTON "&Send", IDOK, 166, 112, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 222, 112, 50, 14
END
/* the Transfer menu's Receive File: the folder, the protocol, a name for
the protocols that send none, and what to type at the remote first */
IDD_XRECV DIALOG 0, 0, 280, 150
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Receive File"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "&Place received files in this folder:", -1, 8, 8, 264, 8
EDITTEXT IDC_F_FILE, 8, 20, 206, 12, ES_AUTOHSCROLL
PUSHBUTTON "&Browse...", IDC_F_BROWSE, 220, 19, 52, 14
LTEXT "&Use receiving protocol:", -1, 8, 42, 90, 8
COMBOBOX IDC_F_PROTO, 100, 40, 114, 140, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "File &name:", IDC_F_NAMELABEL, 8, 60, 90, 8
EDITTEXT IDC_F_NAME, 100, 58, 172, 12, ES_AUTOHSCROLL
LTEXT "&Type at the remote first:", -1, 8, 78, 90, 8
EDITTEXT IDC_F_COMMAND, 100, 76, 172, 12, ES_AUTOHSCROLL
LTEXT "", IDC_F_HINT, 8, 94, 264, 32
DEFPUSHBUTTON "&Receive", IDOK, 166, 130, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 222, 130, 50, 14
END
/* a transfer as it goes (modeless) */
IDD_XFER DIALOG 0, 0, 260, 146
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "File Transfer"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Sending:", IDC_X_VERB, 8, 8, 46, 8
LTEXT "", IDC_X_FILE, 56, 8, 196, 8, SS_NOPREFIX
LTEXT "Folder:", -1, 8, 20, 46, 8
LTEXT "", IDC_X_WHERE, 56, 20, 196, 8, SS_NOPREFIX
LTEXT "Protocol:", -1, 8, 34, 46, 8
LTEXT "", IDC_X_PROTO, 56, 34, 70, 8
LTEXT "Files:", -1, 132, 34, 46, 8
LTEXT "", IDC_X_FILES, 180, 34, 72, 8
LTEXT "Retries:", -1, 8, 46, 46, 8
LTEXT "", IDC_X_ERRORS, 56, 46, 70, 8
LTEXT "Throughput:", -1, 132, 46, 46, 8
LTEXT "", IDC_X_RATE, 180, 46, 72, 8
LTEXT "Elapsed:", -1, 8, 58, 46, 8
LTEXT "", IDC_X_ELAPSED, 56, 58, 70, 8
LTEXT "Remaining:", -1, 132, 58, 46, 8
LTEXT "", IDC_X_LEFT, 180, 58, 72, 8
LTEXT "", IDC_X_BAR, 8, 74, 244, 12
LTEXT "", IDC_X_BYTES, 8, 90, 244, 8
LTEXT "", IDC_X_RESULT, 8, 104, 244, 16, SS_NOPREFIX
PUSHBUTTON "c&ps/bps", IDC_X_UNITS, 146, 126, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 202, 126, 50, 14
END
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEOS 0x4
FILETYPE 0x1
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "D-Modem\0"
VALUE "FileDescription", "D-Modem\0"
VALUE "FileVersion", "1.0.0\0"
VALUE "LegalCopyright", "Copyright (C) 2026 D-Modem Authors. AGPL-3.0-only.\0"
VALUE "ProductName", "D-Modem\0"
VALUE "ProductVersion", "1.0.0\0"
VALUE "OriginalFilename", "dmodem.exe\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END