mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 20:12:48 -05:00
Initial support for HTML Help. All the ad-hoc help-file finding code
and various calls to WinHelp() have been centralised into a new file winhelp.c, which in turn has been modified to detect a .CHM file as well as .HLP and select between them as appropriate. It explicitly tries to load HHCTRL.OCX and use GetProcAddress, meaning that it _should_ still work correctly on pre-HTML-Help platforms, falling gracefully back to WinHelp, but although I tested this by temporarily renaming my own HHCTRL.OCX I haven't yet been able to test it on a real HTML-Help-free platform. Also in this checkin: a new .but file and docs makefile changes to make it convenient to build the sources for a .CHM. As yet, owing to limitations of Halibut's CHM support, I'm not able to write a .CHM directly, more's the pity. [originally from svn r7000]
This commit is contained in:
@ -380,7 +380,7 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
create_controls(hwnd, ""); /* Open and Cancel buttons etc */
|
||||
SetWindowText(hwnd, dp.wintitle);
|
||||
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
|
||||
if (help_path)
|
||||
if (has_help())
|
||||
SetWindowLongPtr(hwnd, GWL_EXSTYLE,
|
||||
GetWindowLongPtr(hwnd, GWL_EXSTYLE) |
|
||||
WS_EX_CONTEXTHELP);
|
||||
@ -389,7 +389,6 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
if (item)
|
||||
DestroyWindow(item);
|
||||
}
|
||||
requested_help = FALSE;
|
||||
SendMessage(hwnd, WM_SETICON, (WPARAM) ICON_BIG,
|
||||
(LPARAM) LoadIcon(hinst, MAKEINTRESOURCE(IDI_CFGICON)));
|
||||
/*
|
||||
@ -586,19 +585,12 @@ static int CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg,
|
||||
ret = 0;
|
||||
return ret;
|
||||
case WM_HELP:
|
||||
if (help_path) {
|
||||
if (winctrl_context_help(&dp, hwnd,
|
||||
((LPHELPINFO)lParam)->iCtrlId))
|
||||
requested_help = TRUE;
|
||||
else
|
||||
MessageBeep(0);
|
||||
}
|
||||
if (!winctrl_context_help(&dp, hwnd,
|
||||
((LPHELPINFO)lParam)->iCtrlId))
|
||||
MessageBeep(0);
|
||||
break;
|
||||
case WM_CLOSE:
|
||||
if (requested_help) {
|
||||
WinHelp(hwnd, help_path, HELP_QUIT, 0);
|
||||
requested_help = FALSE;
|
||||
}
|
||||
quit_help(hwnd);
|
||||
SaneEndDialog(hwnd, 0);
|
||||
return 0;
|
||||
|
||||
@ -622,12 +614,7 @@ void modal_about_box(HWND hwnd)
|
||||
|
||||
void show_help(HWND hwnd)
|
||||
{
|
||||
if (help_path) {
|
||||
WinHelp(hwnd, help_path,
|
||||
help_has_contents ? HELP_FINDER : HELP_CONTENTS,
|
||||
0);
|
||||
requested_help = TRUE;
|
||||
}
|
||||
launch_help(hwnd, NULL);
|
||||
}
|
||||
|
||||
void defuse_showwindow(void)
|
||||
@ -653,7 +640,7 @@ int do_config(void)
|
||||
|
||||
ctrlbox = ctrl_new_box();
|
||||
setup_config_box(ctrlbox, FALSE, 0, 0);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), FALSE, 0);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), FALSE, 0);
|
||||
dp_init(&dp);
|
||||
winctrl_init(&ctrls_base);
|
||||
winctrl_init(&ctrls_panel);
|
||||
@ -685,7 +672,7 @@ int do_reconfig(HWND hwnd, int protcfginfo)
|
||||
|
||||
ctrlbox = ctrl_new_box();
|
||||
setup_config_box(ctrlbox, TRUE, cfg.protocol, protcfginfo);
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, (help_path != NULL), TRUE,
|
||||
win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), TRUE,
|
||||
cfg.protocol);
|
||||
dp_init(&dp);
|
||||
winctrl_init(&ctrls_base);
|
||||
|
Reference in New Issue
Block a user