home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / BLACKHOL.ZIP / BLACKHOL.CMD < prev    next >
OS/2 REXX Batch file  |  1992-12-19  |  2KB  |  34 lines

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