oledlg: Post OLEUI_MSG_HELP when the Help button is pressed and hide the Help button if the app doesn't want it.
diff --git a/dlls/oledlg/pastespl.c b/dlls/oledlg/pastespl.c
index c34a97c..23c9985 100644
--- a/dlls/oledlg/pastespl.c
+++ b/dlls/oledlg/pastespl.c
@@ -288,6 +288,11 @@
EnableWindow(GetDlgItem(hdlg, IDOK), 0);
}
+static void post_help_msg(HWND hdlg, ps_struct_t *ps_struct)
+{
+ PostMessageW(ps_struct->ps->hWndOwner, oleui_msg_help, (WPARAM)hdlg, IDD_PASTESPECIAL);
+}
+
static void send_end_dialog_msg(HWND hdlg, ps_struct_t *ps_struct, UINT id)
{
SendMessageW(hdlg, oleui_msg_enddialog, id, 0);
@@ -331,7 +336,13 @@
SetPropW(hdlg, prop_name, ps_struct);
- if(ps_struct->ps->lpszCaption)
+ if(!(ps_struct->ps->dwFlags & PSF_SHOWHELP))
+ {
+ ShowWindow(GetDlgItem(hdlg, IDC_OLEUIHELP), SW_HIDE);
+ EnableWindow(GetDlgItem(hdlg, IDC_OLEUIHELP), 0);
+ }
+
+ if(ps_struct->ps->lpszCaption)
SetWindowTextW(hdlg, ps_struct->ps->lpszCaption);
init_lists(hdlg, ps_struct);
@@ -341,6 +352,15 @@
case WM_COMMAND:
switch(LOWORD(wp))
{
+ case IDC_OLEUIHELP:
+ switch(HIWORD(wp))
+ {
+ case BN_CLICKED:
+ post_help_msg(hdlg, ps_struct);
+ return FALSE;
+ default:
+ return FALSE;
+ }
case IDOK:
case IDCANCEL:
send_end_dialog_msg(hdlg, ps_struct, LOWORD(wp));