TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Gautam Lad
from: Phil Crown
date: 1996-05-26 01:17:50
subject: launching programs

-=> Quoting Gautam Lad to **Anybody** <=-

 GL> Hi,
 GL> How can I lauch PM programs, from a PM program using EMX/GCC?
 GL> I tried system("E test.fil");, but the editor doesn't show up.  I
 GL> tried  system("TEDIT test.fil");, but it causes a sys 3184 error (I
 GL> think). I know system("..."); is not right, but I don't know of any
 GL> other way!
 GL> THANKS!

Just pass the name of the editor and a filename to edit.  pEditor can be
a PM, VIO, or a DOS (I think..., you may have to call COMMAND.COM /c)
program.

// --------------------------------------------------------------------
MRESULT EXPENTRY  RunEditor(PCHAR pEditor, PCHAR pfname)
{
  STARTDATA   StartData;
  CHAR        ObjBuf[100];
  CHAR        Args[CCHMAXPATH];
  PCHAR       Title, fname, ext;
  PID         pid;
  ULONG       SessID;

  Title = (PCHAR) malloc(CCHMAXPATH);
  fname = (PCHAR) malloc(CCHMAXPATH);
  ext   = (PCHAR) malloc(CCHMAXPATH);

  _splitpath(pfname, NULL, NULL, fname, ext);
  sprintf(Title, "%s - %s%s", pEditor, fname, ext);

  sprintf(Args, "%s", pfname);
  StartData.Length      = sizeof(STARTDATA);
  StartData.Related     = SSF_RELATED_CHILD;
  StartData.FgBg        = SSF_FGBG_FORE;//BACK;
  StartData.TraceOpt    = SSF_TRACEOPT_NONE;
  StartData.PgmTitle    = Title;
  StartData.PgmName     = pEditor;
  StartData.PgmInputs   = (PBYTE) Args;
  StartData.TermQ       = 0;
  StartData.Environment = 0;
  StartData.InheritOpt  = SSF_INHERTOPT_PARENT;
  StartData.SessionType = SSF_TYPE_DEFAULT;//SSF_TYPE_FULLSCREEN;
  StartData.IconFile    = 0;
  StartData.PgmHandle   = 0;
  StartData.PgmControl  = SSF_CONTROL_VISIBLE | SSF_CONTROL_SETPOS;//MAXIMIZE;
  StartData.InitXPos    = 0;
  StartData.InitYPos    = 0;
  StartData.InitXSize   = 0;
  StartData.InitYSize   = 0;
  StartData.Reserved    = 0;
  StartData.ObjectBuffer= ObjBuf;
  StartData.ObjectBuffLen = 100;
  DosStartSession(&StartData, &SessID, &pid);
  free(Title);
  free(fname);
  free(ext);
  return (MRESULT) 0;
}

Phil - Fido:  1:124/8014.0 | Internet:  phil.crown{at}bluecafe.com

--- Blue Wave/OS2 v2.30
* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 214-250-4479 * (1:124/1208)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1
@PATH: 124/1208 1 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.