Release 960225
[wine.git] / misc / exec.c
blob6cc85b3ae6eb21261f430127b38b5f34ecbb4317
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 "shell.h"
13 #include "windows.h"
14 #include "callback.h"
15 #include "stddebug.h"
16 #include "debug.h"
18 #define HELP_CONTEXT 0x0001
19 #define HELP_QUIT 0x0002
20 #define HELP_INDEX 0x0003
21 #define HELP_CONTENTS 0x0003
22 #define HELP_HELPONHELP 0x0004
23 #define HELP_SETINDEX 0x0005
24 #define HELP_SETCONTENTS 0x0005
25 #define HELP_CONTEXTPOPUP 0x0008
26 #define HELP_FORCEFILE 0x0009
27 #define HELP_KEY 0x0101
28 #define HELP_COMMAND 0x0102
29 #define HELP_PARTIALKEY 0x0105
30 #define HELP_MULTIKEY 0x0201
31 #define HELP_SETWINPOS 0x0203
34 /**********************************************************************
35 * ExitWindows [USER.7]
37 BOOL ExitWindows(DWORD dwReturnCode, WORD wReserved)
39 api_assert("ExitWindows", wReserved == 0);
40 api_assert("ExitWindows", HIWORD(dwReturnCode) == 0);
42 dprintf_exec( stdnimp,"PARTIAL STUB ExitWindows(%08lX, %04X)\n",
43 dwReturnCode, wReserved);
45 /* Do the clean-up stuff */
47 WriteOutProfiles();
48 SHELL_SaveRegistry();
50 exit( LOWORD(dwReturnCode) );
54 /**********************************************************************
55 * WinHelp [USER.171]
57 BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
59 char str[256];
60 dprintf_exec(stddeb,"WinHelp(%s, %u, %lu)\n",
61 lpHelpFile, wCommand, dwData);
62 switch(wCommand) {
63 case 0:
64 case HELP_HELPONHELP:
65 GetWindowsDirectory(str, sizeof(str));
66 strcat(str, "\\winhelp.exe winhelp.hlp");
67 dprintf_exec(stddeb,"'%s'\n", str);
68 break;
69 case HELP_INDEX:
70 GetWindowsDirectory(str, sizeof(str));
71 strcat(str, "\\winhelp.exe ");
72 strcat(str, lpHelpFile);
73 dprintf_exec(stddeb,"'%s'\n", str);
74 break;
75 case HELP_QUIT:
76 return TRUE;
77 default:
78 return FALSE;
80 WinExec(str, SW_SHOWNORMAL);
81 return(TRUE);