home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / quot210s.zip / src / pmspawn.c < prev    next >
C/C++ Source or Header  |  1998-06-07  |  1KB  |  47 lines

  1. /*
  2.  * pmspawn.c
  3.  *
  4.  * Routines for spawning programs.
  5.  *
  6.  *      Created: 4th December, 1997
  7.  * Version 2.00: 4th December, 1997
  8.  *
  9.  * (C) 1997 Nicholas Paul Sheppard
  10.  *
  11.  * This file is distributed under the GNU General Public License. See the
  12.  * file copying.txt for details.
  13.  */
  14.  
  15. #define INCL_WIN
  16. #include <os2.h>
  17. #include <string.h>
  18. #include "pmutil.h"
  19.  
  20.  
  21. HAPP SpawnPM(HWND hwndNotify, char *pszApplication, char *pszCmdLine)
  22. /*
  23.  * Spawn a PM application.
  24.  *
  25.  * HWND hwndNotify    - handle of the window to notify when the application terminates
  26.  * char *pszApplication    - the name of the application to spawn
  27.  * char *pszCmdLine    - the command line to pass to the application
  28.  *
  29.  * Returns:         - handle to the editor application on success
  30.  *              NULLHANDLE on failure
  31.  */
  32. {
  33.     PROGDETAILS    pd;
  34.  
  35.     /* set up application details */
  36.     memset(&pd, 0, sizeof(PROGDETAILS));
  37.     pd.Length = sizeof(PROGDETAILS);
  38.     pd.progt.progc = PROG_PM;
  39.     pd.progt.fbVisible = SHE_VISIBLE;
  40.     pd.pszExecutable = pszApplication;
  41.     pd.pszParameters = pszCmdLine;
  42.     pd.pszStartupDir = ".";
  43.  
  44.     /* go */
  45.     return (WinStartApp(hwndNotify, &pd, pszCmdLine, NULL, 0));
  46. }
  47.