home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwphescr.zip / XWPH0208.ZIP / include / helpers / apps.h < prev    next >
C/C++ Source or Header  |  2002-08-11  |  5KB  |  134 lines

  1.  
  2. /*
  3.  *@@sourcefile apps.h:
  4.  *      header file for apps.c. See remarks there.
  5.  *
  6.  *      Note: Version numbering in this file relates to XWorkplace version
  7.  *            numbering.
  8.  *
  9.  *@@include #define INCL_WINPROGRAMLIST
  10.  *@@include #include <os2.h>
  11.  *@@include #include "helpers\apps.h"
  12.  */
  13.  
  14. /*      This file Copyright (C) 1997-2001 Ulrich Möller.
  15.  *      This file is part of the "XWorkplace helpers" source package.
  16.  *      This is free software; you can redistribute it and/or modify
  17.  *      it under the terms of the GNU General Public License as published
  18.  *      by the Free Software Foundation, in version 2 as it comes in the
  19.  *      "COPYING" file of the XWorkplace main distribution.
  20.  *      This program is distributed in the hope that it will be useful,
  21.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  22.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23.  *      GNU General Public License for more details.
  24.  */
  25.  
  26. #if __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #ifndef APPS_HEADER_INCLUDED
  31.     #define APPS_HEADER_INCLUDED
  32.  
  33.     /* ******************************************************************
  34.      *
  35.      *   Environment helpers
  36.      *
  37.      ********************************************************************/
  38.  
  39.     ULONG appQueryEnvironmentLen(PCSZ pcszEnvironment);
  40.  
  41.     /*
  42.      *@@ DOSENVIRONMENT:
  43.      *      structure holding an array of environment
  44.      *      variables (papszVars). This is initialized
  45.      *      appGetEnvironment,
  46.      *
  47.      *@@added V0.9.4 (2000-07-19) [umoeller]
  48.      */
  49.  
  50.     typedef struct _DOSENVIRONMENT
  51.     {
  52.         ULONG       cVars;              // count of vars in papzVars
  53.         PSZ         *papszVars;         // array of PSZ's to environment strings (VAR=VALUE)
  54.     } DOSENVIRONMENT, *PDOSENVIRONMENT;
  55.  
  56.     APIRET appParseEnvironment(const char *pcszEnv,
  57.                                 PDOSENVIRONMENT pEnv);
  58.  
  59.     APIRET appGetEnvironment(PDOSENVIRONMENT pEnv);
  60.  
  61.     PSZ* appFindEnvironmentVar(PDOSENVIRONMENT pEnv,
  62.                                 PSZ pszVarName);
  63.  
  64.     APIRET appSetEnvironmentVar(PDOSENVIRONMENT pEnv,
  65.                                  PSZ pszNewEnv,
  66.                                  BOOL fAddFirst);
  67.  
  68.     APIRET appConvertEnvironment(PDOSENVIRONMENT pEnv,
  69.                                   PSZ *ppszEnv,
  70.                                   PULONG pulSize);
  71.  
  72.     APIRET appFreeEnvironment(PDOSENVIRONMENT pEnv);
  73.  
  74.     #ifdef INCL_WINPROGRAMLIST
  75.         // additional PROG_* flags for appQueryAppType
  76.         // #define PROG_XWP_DLL            998      // dynamic link library
  77.                     // removed, PROG_DLL exists already
  78.                     // V0.9.16 (2001-10-06)
  79.  
  80.         #define PROG_WIN32              990     // added V0.9.16 (2001-12-08) [umoeller]
  81.  
  82.         APIRET appQueryAppType(const char *pcszExecutable,
  83.                                 PULONG pulDosAppType,
  84.                                 PULONG pulWinAppType);
  85.  
  86.         PCSZ appDescribeAppType(PROGCATEGORY progc);
  87.  
  88.         ULONG appIsWindowsApp(ULONG ulProgCategory);
  89.  
  90.     /* ******************************************************************
  91.      *
  92.      *   Application start
  93.      *
  94.      ********************************************************************/
  95.  
  96.         APIRET appQueryDefaultWin31Environment(PSZ *ppsz);
  97.  
  98.         #define APP_RUN_FULLSCREEN      0x0001
  99.         #define APP_RUN_ENHANCED        0x0002
  100.         #define APP_RUN_STANDARD        0x0004
  101.         #define APP_RUN_SEPARATE        0x0008
  102.  
  103.         APIRET appBuildProgDetails(PPROGDETAILS *ppDetails,
  104.                                    const PROGDETAILS *pcProgDetails,
  105.                                    ULONG ulFlags);
  106.  
  107.         APIRET XWPENTRY appStartApp(HWND hwndNotify,
  108.                                     const PROGDETAILS *pcProgDetails,
  109.                                     ULONG ulFlags,
  110.                                     HAPP *phapp,
  111.                                     ULONG cbFailingName,
  112.                                     PSZ pszFailingName);
  113.  
  114.         BOOL XWPENTRY appWaitForApp(HWND hwndNotify,
  115.                                     HAPP happ,
  116.                                     PULONG pulExitCode);
  117.  
  118.         HAPP appQuickStartApp(const char *pcszFile,
  119.                               ULONG ulProgType,
  120.                               const char *pcszArgs,
  121.                               const char *pcszWorkingDir,
  122.                               PULONG pulExitCode);
  123.  
  124.         BOOL appOpenURL(PCSZ pcszURL);
  125.  
  126.     #endif
  127.  
  128. #endif
  129.  
  130. #if __cplusplus
  131. }
  132. #endif
  133.  
  134.