X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/1e5eefb6f2677a50fdb158e25e59f075ec034d23..533c7491240f2fd71d026e91f0a940f4729992fd:/windows/windlg.c diff --git a/windows/windlg.c b/windows/windlg.c index 019f6155..db1ef2f3 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -1,3 +1,7 @@ +/* + * windlg.c - dialogs for PuTTY(tel), including the configuration dialog. + */ + #include #include #include @@ -376,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); @@ -385,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))); /* @@ -582,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; @@ -618,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) @@ -649,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); + win_setup_config_box(ctrlbox, &dp.hwnd, has_help(), FALSE, 0); dp_init(&dp); winctrl_init(&ctrls_base); winctrl_init(&ctrls_panel); @@ -681,7 +672,8 @@ 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); winctrl_init(&ctrls_panel);