11 #define MAX_CMDLINE_SIZE 256
13 /* FIXME should use WinExec from -lwine */
15 HANDLE
ProgmanWinExec( LPSTR lpCmdLine
, WORD nCmdShow
)
17 char wine
[MAX_CMDLINE_SIZE
];
18 char filename
[MAX_CMDLINE_SIZE
], *p
;
19 char cmdline
[MAX_CMDLINE_SIZE
];
20 const char *argv
[10], **argptr
;
21 const char *unixfilename
;
24 if (fork()) return(INVALID_HANDLE_VALUE
);
26 strncpy( filename
, lpCmdLine
, MAX_CMDLINE_SIZE
);
27 filename
[MAX_CMDLINE_SIZE
-1] = '\0';
28 for (p
= filename
; *p
&& (*p
!= ' ') && (*p
!= '\t'); p
++)
29 if ((*p
== ':') || (*p
== ':') || (*p
== '/')) simplename
= 0;
32 strncpy( cmdline
, p
+ 1, 128 );
35 else cmdline
[0] = '\0';
38 if (simplename
) unixfilename
= filename
;
39 else unixfilename
= DOSFS_GetUnixFileName(filename
, 0);
42 *argptr
++ = unixfilename
;
43 if (nCmdShow
== SW_SHOWMINIMIZED
) *argptr
++ = "-iconic";
44 if (cmdline
[0]) *argptr
++ = cmdline
;
46 execvp(argv
[0], (char**)argv
);
48 PROFILE_GetWineIniString("progman", "wine", "wine",
52 *argptr
++ = "-language";
53 *argptr
++ = Globals
.lpszLanguage
;
54 if (nCmdShow
== SW_SHOWMINIMIZED
) *argptr
++ = "-iconic";
55 *argptr
++ = lpCmdLine
;
57 execvp(argv
[0] , (char**)argv
);
59 printf("Cannot exec `%s %s %s%s %s'\n",
60 wine
, "-language", Globals
.lpszLanguage
,
61 nCmdShow
== SW_SHOWMINIMIZED
? " -iconic" : "",
66 BOOL
ProgmanWinHelp(HWND hWnd
, LPSTR lpHelpFile
, WORD wCommand
, DWORD dwData
)
69 dprintf_exec(stddeb
,"WinHelp(%s, %u, %lu)\n",
70 lpHelpFile
, wCommand
, dwData
);
74 GetWindowsDirectory(str
, sizeof(str
));
75 strcat(str
, "\\winhelp.exe winhelp.hlp");
76 dprintf_exec(stddeb
,"'%s'\n", str
);
79 GetWindowsDirectory(str
, sizeof(str
));
80 strcat(str
, "\\winhelp.exe ");
81 strcat(str
, lpHelpFile
);
82 dprintf_exec(stddeb
,"'%s'\n", str
);
87 WinExec(str
, SW_SHOWNORMAL
);