1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 04:52:47 -05:00

Integrate PuTTY and its help file. Now that's what I call a good

lunchtime's work :-)

[originally from svn r1458]
This commit is contained in:
Simon Tatham
2001-12-06 13:28:02 +00:00
parent 431ffb478e
commit 2b99a70743
6 changed files with 559 additions and 10 deletions

View File

@ -42,10 +42,11 @@
#define IDM_TEL_SUSP 0x0110
#define IDM_TEL_EOR 0x0120
#define IDM_TEL_EOF 0x0130
#define IDM_ABOUT 0x0140
#define IDM_SAVEDSESS 0x0150
#define IDM_COPYALL 0x0160
#define IDM_FULLSCREEN 0x0170
#define IDM_HELP 0x0140
#define IDM_ABOUT 0x0150
#define IDM_SAVEDSESS 0x0160
#define IDM_COPYALL 0x0170
#define IDM_FULLSCREEN 0x0180
#define IDM_SESSLGP 0x0250 /* log type printable */
#define IDM_SESSLGA 0x0260 /* log type all chars */
@ -190,6 +191,32 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
}
}
/*
* See if we can find our Help file.
*/
{
char b[2048], *p, *q, *r;
FILE *fp;
GetModuleFileName(NULL, b, sizeof(b) - 1);
r = b;
p = strrchr(b, '\\');
if (p && p >= r) r = p+1;
q = strrchr(b, ':');
if (q && q >= r) r = q+1;
strcpy(r, "putty.hlp");
if ( (fp = fopen(b, "r")) != NULL) {
help_path = dupstr(b);
fclose(fp);
} else
help_path = NULL;
strcpy(r, "putty.cnt");
if ( (fp = fopen(b, "r")) != NULL) {
help_has_contents = TRUE;
fclose(fp);
} else
help_has_contents = FALSE;
}
/*
* Process the command line.
*/
@ -586,6 +613,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
AppendMenu(m, (cfg.resize_action == RESIZE_DISABLED) ?
MF_GRAYED : MF_ENABLED, IDM_FULLSCREEN, "&Full Screen");
AppendMenu(m, MF_SEPARATOR, 0, 0);
if (help_path)
AppendMenu(m, MF_ENABLED, IDM_HELP, "&Help");
AppendMenu(m, MF_ENABLED, IDM_ABOUT, "&About PuTTY");
}
@ -1755,6 +1784,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
case IDM_ABOUT:
showabout(hwnd);
break;
case IDM_HELP:
WinHelp(hwnd, help_path,
help_has_contents ? HELP_FINDER : HELP_CONTENTS, 0);
break;
case SC_MOUSEMENU:
/*
* We get this if the System menu has been activated