home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
wp
/
ezhelp.zip
/
SPAWNHLP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-31
|
3KB
|
85 lines
/* ======================================================================== */
/* FILE: SPAWNHLP.C */
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* ======================================================================== */
/* FUNCTION: SpawnHelp
*
* This function can be linked into C programs and called to
* spawn the EZhelp Reference system.
*
* Parameters: iMenu - Menu to start EZhelp. If NULL is passed,
* Menu 1 will be shown.
* iHelp - Topic to jump directly into. If NULL is
* passed, the menu will be shown.
* fDispErr - Pass TRUE if errors should be displayed,
* FALSE otherwise.
* fLoc - Help window anchor (1 - 9). If NULL
* is passed, the default of 5 (center)
* will be used.
* fOverLap - If TRUE is passed, the window displays
* will overlap. If FALSE is passed, the
* original screen will restored between
* text window displays.
*
* Returns: The result of the spawnv() call.
*
* Notes: If the EZhelp command line parameter -T is to be used,
* format it directly into the *args[] parameter below.
* None of the other *args[] parameters need to be
* modified, as the SpawnHelp() parameters will format
* them.
*
*/
int
SpawnHelp(int iMenu, int iHelp, int fDispErr,
int fLoc, int fOverLap) {
int iSize;
char *pArg;
char *path = "EZHELP.EXE";
char *args[] = { "EZHELP.EXE",
"EZSETUP.TXT", /* use your reference name here */
"-M ",
"-J ",
"-E0 ",
"-L5 ",
"-O0 ",
"-TEZsetup_utility", /* startup menu string */
0 };
pArg = args[2];
pArg += 2;
iSize = iMenu < 10 ? 1 : 2;
sprintf(pArg,"%*d", iSize, iMenu); /* menu number */
pArg = args[3];
pArg += 2;
iSize = iHelp < 10 ? 1 : 2;
sprintf(pArg,"%*d", iSize, iHelp); /* jump to a topic? */
pArg = args[4];
pArg += 2;
sprintf(pArg,"%d", fDispErr); /* display errors? */
if(fLoc) {
pArg = args[5];
pArg += 2;
sprintf(pArg,"%d", fLoc); /* menu anchor */
}
pArg = args[6];
pArg += 2;
sprintf(pArg,"%d", fOverLap); /* overlap windows? */
return(spawnvp(P_WAIT, path, args));
}