[PATCH] [WinHelp]: implemented ExecFile macro (fix for #23054)
Eric Pouech
eric.pouech at orange.fr
Wed Jun 9 14:22:22 CDT 2010
A+
---
programs/winhlp32/macro.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c
index 0e48ca8..25a067d 100644
--- a/programs/winhlp32/macro.c
+++ b/programs/winhlp32/macro.c
@@ -25,6 +25,7 @@
#include "windows.h"
#include "commdlg.h"
+#include "shellapi.h"
#include "winhelp.h"
#include "wine/debug.h"
@@ -64,6 +65,9 @@ static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR na
return b;
}
+/******* some forward declarations *******/
+static void CALLBACK MACRO_JumpID(LPCSTR lpszPathWindow, LPCSTR topic_id);
+
/******* real macro implementation *******/
void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
@@ -352,9 +356,19 @@ static void CALLBACK MACRO_EndMPrint(void)
WINE_FIXME("()\n");
}
-static void CALLBACK MACRO_ExecFile(LPCSTR str1, LPCSTR str2, LONG u, LPCSTR str3)
+static void CALLBACK MACRO_ExecFile(LPCSTR pgm, LPCSTR args, LONG cmd_show, LPCSTR topic)
{
- WINE_FIXME("(\"%s\", \"%s\", %u, \"%s\")\n", str1, str2, u, str3);
+ HINSTANCE ret = 0;
+
+ WINE_TRACE("(\"%s\", \"%s\", %u, \"%s\")\n", pgm, args, cmd_show, topic);
+
+ ret = ShellExecuteA(Globals.active_win ? Globals.active_win->hMainWnd : NULL, "open",
+ pgm, args, ".", cmd_show);
+ if ((DWORD_PTR)ret < 32)
+ {
+ WINE_WARN("Failed with %p\n", ret);
+ if (topic) MACRO_JumpID(NULL, topic);
+ }
}
static void CALLBACK MACRO_ExecProgram(LPCSTR str, LONG u)
More information about the wine-patches
mailing list