12 #define HELP_CONTEXT 0x0001
13 #define HELP_QUIT 0x0002
14 #define HELP_INDEX 0x0003
15 #define HELP_CONTENTS 0x0003
16 #define HELP_HELPONHELP 0x0004
17 #define HELP_SETINDEX 0x0005
18 #define HELP_SETCONTENTS 0x0005
19 #define HELP_CONTEXTPOPUP 0x0008
20 #define HELP_FORCEFILE 0x0009
21 #define HELP_KEY 0x0101
22 #define HELP_COMMAND 0x0102
23 #define HELP_PARTIALKEY 0x0105
24 #define HELP_MULTIKEY 0x0201
25 #define HELP_SETWINPOS 0x0203
28 WORD
WinExec(LPSTR lpCmdLine
, WORD nCmdShow
)
32 printf("WinExec('%s', %04X)\n", lpCmdLine
, nCmdShow
);
35 for (X
= X2
= 0; X
< strlen(lpCmdLine
) + 1; X
++) {
36 if ((lpCmdLine
[X
] == ' ') || (lpCmdLine
[X
] == '\0')) {
37 ArgV
[C
] = (char *)malloc(X
- X2
+ 1);
38 strncpy(ArgV
[C
], &lpCmdLine
[X2
], X
- X2
);
39 ArgV
[C
][X
- X2
] = '\0';
45 if (ArgV
[C
] == NULL
) break;
46 printf("--> '%s' \n", ArgV
[C
]);
50 printf("Can't 'fork' process !\n");
53 printf("New process started !\n");
54 execvp(ArgV
[0], ArgV
);
55 printf("Child process died !\n");
59 printf("Main process stay alive !\n");
63 if (ArgV
[C
] == NULL
) break;
70 BOOL
WinHelp(HWND hWnd
, LPSTR lpHelpFile
, WORD wCommand
, DWORD dwData
)
73 printf("WinHelp(%s, %u, %lu)\n", lpHelpFile
, wCommand
, dwData
);
77 GetWindowsDirectory(str
, sizeof(str
));
78 strcat(str
, "\\winhelp.exe");
79 printf("'%s'\n", str
);
82 GetWindowsDirectory(str
, sizeof(str
));
83 strcat(str
, "\\winhelp.exe");
84 printf("'%s'\n", str
);
89 WinExec(str
, SW_SHOWNORMAL
);