home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 May / cica_0595_4.zip / cica_0595_4 / UTIL / XSPAWN10 / XEXECD.PAS < prev    next >
Pascal/Delphi Source File  |  1994-07-25  |  4KB  |  111 lines

  1. (******************************************************************************
  2. *                                   XExecD                                    *
  3. *                                                                             *
  4. * Interface unit to XEXEC.DLL.                                                *
  5. *                                                                             *
  6. * Written by Golan Yaniv (C) 1994                                             *
  7. *                                                                             *
  8. * This file is part of the XSpawn package.                                    *
  9. *                                                                             *
  10. ******************************************************************************)
  11. unit XExecD;
  12.  
  13. interface
  14.  
  15. uses WinTypes
  16.     ;
  17.  
  18. const
  19.     { options in WXSpawn's wOptions field. this values are also }
  20.     { returned by WXGetFileOS : }
  21.     WXO_OSTYPEMASK  = $000F;    { bits mask dedicated to os type }
  22.     WXO_AUTO        = $0000;    { auto-detect os type from file }
  23.     WXO_WIN         = $0001;    { force type = windows }
  24.     WXO_DOS         = $0002;    { force type = dos }
  25.     WXO_OS2         = $0003;    { force type = os2 }
  26.     WXO_NT          = $0004;    { force type = nt }
  27.     WXO_USESHELL    = $0010;    { use shell to execute }
  28.     WXO_USEPIF      = $0020;    { use pif file - only for dos }
  29.  
  30.     { error codes (in low word) }
  31.     { errors marked with * return additional info in high word }
  32.     WX_APPEXEC      = $0001;    { application exec error (*) }
  33.     WX_AGENTEXEC    = $0002;    { agent exec error (*) }
  34.     WX_OUTOFMEM     = $0003;    { not enough memory }
  35.     WX_AGENTCOMM    = $0004;    { unable to establish agent communication }
  36.     WX_PIFFILE      = $0005;    { unable to create PIF file (*) }
  37.     WX_NOAGENT      = $0006;    { agent not installed (*) }
  38.     WX_UNKNOWNOS    = $0007;    { unknown os type }
  39.     WX_BADVER       = $00F1;    { version mismatch (*) }
  40.     WX_AGENTKILLED  = $00F2;    { agent was killed while waiting }
  41.     WX_INVALIDHEXEC = $00F3;    { invalid hExec handle }
  42.  
  43.     { for WX_APPEXEC, high word contains WinExec error or : }
  44.     WX_NOTFOUND     = $0101;    { path or file not found }
  45.     WX_NOMEM        = $0102;    { not enough memory }
  46.     WX_ARGLIST      = $0103;    { args list too long }
  47.     WX_BADFORMAT    = $0104;    { bad exec format }
  48.     WX_UNKNOWN      = $010F;    { unknown error }
  49.  
  50.     { returned by WXGetHostOS() : }
  51.     WX_OS_WIN3X     = $0001;    { Windows 3.X }
  52.     WX_OS_WINNT     = $0002;    { Windows NT }
  53.     WX_OS_WINOS2    = $0003;    { Win-OS/2 }
  54.     WX_OS_UNKNOWN   = $FFFF;    { Unknown Host OS }
  55.  
  56. function    WXSpawn(lpszFileName : pchar;
  57.                     lpszArgs : pchar;
  58.                     lpszDirectory : pchar;
  59.                     nCmdShow : word;
  60.                     wOptions : word;
  61.                     var hExec : longint) : longint; 
  62.  
  63. function    WXIsDone(hExec: longint; 
  64.                      lpdwErrorCode : PLongint;
  65.                      lpdwExitCode : PLongint) : Bool; 
  66.  
  67. procedure   WXStopTracking(hExec: longint); 
  68.  
  69. procedure   WXSetDebugMode(bDebugFlag : Bool); 
  70.  
  71. function    WXGetVersion : word;
  72.  
  73. function    WXGetInstance(hExec : longint) : THandle; 
  74.  
  75. function    WXGetFileOs(lpszFileName : pchar) : word; 
  76.  
  77. procedure   WXGetError(dwErrorCode : longint; 
  78.                        var wError : word; 
  79.                        var wReason : word); 
  80.  
  81. function    WXGetHostOS : longint;
  82.  
  83. (******************************************************************************
  84. *                               IMPLEMENTATION                                *
  85. ******************************************************************************)
  86. IMPLEMENTATION
  87.     
  88.  
  89. function    WXSpawn;        external 'XEXEC' index 1;
  90.  
  91. function    WXIsDone;       external 'XEXEC' index 2;
  92.  
  93. procedure   WXStopTracking; external 'XEXEC' index 3;
  94.  
  95. procedure   WXSetDebugMode; external 'XEXEC' index 4;
  96.  
  97. function    WXGetVersion;   external 'XEXEC' index 5;
  98.  
  99. function    WXGetInstance;  external 'XEXEC' index 6;
  100.  
  101. function    WXGetFileOs;    external 'XEXEC' index 7;
  102.  
  103. procedure   WXGetError;     external 'XEXEC' index 8;
  104.  
  105. function    WXGetHostOS;    external 'XEXEC' index 9;
  106.  
  107.  
  108.  
  109.  
  110. end.
  111.