Release 960114
[wine/gsoc-2012-control.git] / misc / exec.c
blob1235661019373c7f75eff5cbe82dc6a648f620b5
1 /*
2 * Windows Exec & Help
4 */
6 #include <stdlib.h>
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include "neexe.h"
11 #include "dlls.h"
12 #include "windows.h"
13 #include "callback.h"
14 #include "stddebug.h"
15 #include "debug.h"
17 #define HELP_CONTEXT 0x0001
18 #define HELP_QUIT 0x0002
19 #define HELP_INDEX 0x0003
20 #define HELP_CONTENTS 0x0003
21 #define HELP_HELPONHELP 0x0004
22 #define HELP_SETINDEX 0x0005
23 #define HELP_SETCONTENTS 0x0005
24 #define HELP_CONTEXTPOPUP 0x0008
25 #define HELP_FORCEFILE 0x0009
26 #define HELP_KEY 0x0101
27 #define HELP_COMMAND 0x0102
28 #define HELP_PARTIALKEY 0x0105
29 #define HELP_MULTIKEY 0x0201
30 #define HELP_SETWINPOS 0x0203
33 /**********************************************************************
34 * ExitWindows [USER.7]
36 BOOL ExitWindows(DWORD dwReturnCode, WORD wReserved)
38 api_assert("ExitWindows", wReserved == 0);
39 api_assert("ExitWindows", HIWORD(dwReturnCode) == 0);
41 dprintf_exec( stdnimp,"PARTIAL STUB ExitWindows(%08lX, %04X)\n",
42 dwReturnCode, wReserved);
44 exit( LOWORD(dwReturnCode) );
48 /**********************************************************************
49 * WinHelp [USER.171]
51 BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
53 char str[256];
54 dprintf_exec(stddeb,"WinHelp(%s, %u, %lu)\n",
55 lpHelpFile, wCommand, dwData);
56 switch(wCommand) {
57 case 0:
58 case HELP_HELPONHELP:
59 GetWindowsDirectory(str, sizeof(str));
60 strcat(str, "\\winhelp.exe winhelp.hlp");
61 dprintf_exec(stddeb,"'%s'\n", str);
62 break;
63 case HELP_INDEX:
64 GetWindowsDirectory(str, sizeof(str));
65 strcat(str, "\\winhelp.exe ");
66 strcat(str, lpHelpFile);
67 dprintf_exec(stddeb,"'%s'\n", str);
68 break;
69 default:
70 return FALSE;
72 WinExec(str, SW_SHOWNORMAL);
73 return(TRUE);