8 #define HELP_CONTEXT 0x0001
9 #define HELP_QUIT 0x0002
10 #define HELP_INDEX 0x0003
11 #define HELP_CONTENTS 0x0003
12 #define HELP_HELPONHELP 0x0004
13 #define HELP_SETINDEX 0x0005
14 #define HELP_SETCONTENTS 0x0005
15 #define HELP_CONTEXTPOPUP 0x0008
16 #define HELP_FORCEFILE 0x0009
17 #define HELP_KEY 0x0101
18 #define HELP_COMMAND 0x0102
19 #define HELP_PARTIALKEY 0x0105
20 #define HELP_MULTIKEY 0x0201
21 #define HELP_SETWINPOS 0x0203
24 WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow)
28 printf("WinExec(%s, %u)\n", lpCmdLine, nCmdShow);
29 for (X = X2 = C = 0; X < strlen(lpCmdLine) + 1; X++) {
30 if ((lpCmdLine[X] == ' ') || (lpCmdLine[X] == '\0')) {
31 ArgV[C] = (char *)malloc(X - X2 + 1);
32 strncpy(ArgV[C], &lpCmdLine[X2], X - X2);
33 ArgV[C][X - X2] = '\0';
39 if (ArgV[C] == NULL) break;
40 printf("--> '%s' \n", ArgV[C]);
44 printf("Can't 'fork' process !\n");
47 printf("New process started !\n");
48 execvp(ArgV[0], ArgV);
49 printf("Child process died !\n");
53 printf("Main process stay alive !\n");
57 if (ArgV[C] == NULL) break;
64 BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
68 printf("WinHelp(%s, %u, %lu)\n", lpHelpFile, wCommand, dwData);
71 printf("Can't 'fork' process !\n");
74 printf("New process started !\n");
76 ArgV[1] = "/C:/windows/winhelp.exe";
82 sprintf(str, "%lu", dwData);
88 if (wCommand == HELP_HELPONHELP) ArgV[2] = NULL;
92 execvp(ArgV[0], ArgV);
93 printf("Child process died !\n");
97 printf("Main process stay alive !\n");