home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / BLCKH3.ZIP / blackhol.cmd < prev    next >
OS/2 REXX Batch file  |  1993-01-18  |  2KB  |  37 lines

  1. /* rexx - BlackHol: install BlackHole's DLL and create its object */
  2. /* by Greg Czaja January  18, 1993      version 3                 */
  3. /* Attention ! REXX20 fix or Service Pack or OS/2 2.1 are required*/
  4. /*             to run this CMD. SOMFIX or SP or 2.1 are required  */
  5. /*             for BlackHole to work properly !                   */
  6.  
  7. Parse source . . __rexx_name;
  8. __rexx_dir = Filespec('D',__rexx_name)||Filespec('P',__rexx_name)
  9.  
  10. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  11. Call SysLoadFuncs;           
  12.  
  13.      system_dll=FileSpec('Drive',Value('SYSTEM_INI',,'OS2ENVIRONMENT'))||'\OS2\DLL';
  14.      rc=SysDeregisterObjectClass('BlackHole');
  15.      Address CMD '@ERASE 'system_dll'\BLACKHOL.DLL 2>NUL';
  16.      Address CMD '@COPY '__rexx_dir'BlackHol.DLL 'system_dll;
  17.      If rc <> 0                 /* registered OK ?                */
  18.         Then Do;
  19.           Say  "BlackHole: could not replace the DLL, rc="rc".";
  20.           Say  "BlackHole: delete the object and the DLL from \OS2\DLL directory.";
  21.           Exit;
  22.           End;
  23.      rc=SysRegisterObjectClass('BlackHole',system_dll||'\BLACKHOL.DLL');
  24.      If rc <> 1                 /* registered OK ?                */
  25.         Then Do;
  26.           Say  "BlackHole: could not register its object class, rc="rc".";
  27.           Exit;
  28.           End;
  29.      rc=SysCreateObject('BlackHole','Black Hole','<WP_DESKTOP>', ,
  30.                         'ICONFILE='__rexx_dir'BLACKHOL.ICO;OBJECTID=<BLACKHOLE>;',,
  31.                         'ReplaceIfExists');
  32.      If rc <> 1                 /* registered OK ?                */
  33.         Then Do;
  34.           Say  "BlackHole: could not create its object, rc="rc".";
  35.           End;
  36. Exit;
  37.