home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / BLACKH.ZIP / blackhol.cmd < prev    next >
OS/2 REXX Batch file  |  1992-11-19  |  2KB  |  38 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.      If rc <> 1                 /* registered OK ?                */
  13.         Then Do;
  14.           Say  "DMan could not de-register its object class, rc="rc".";
  15.           End;
  16.  
  17.      Address CMD '@COPY '__rexx_dir'BlackHol.DLL 'system_dll;
  18.      If rc <> 0                 /* registered OK ?                */
  19.         Then Do;
  20.           Say  "BlackHole: could not replace the DLL, rc="rc".";
  21.           Say  "BlackHole: delete the object and the DLL from \OS2\DLL directory.";
  22.           Exit;
  23.           End;
  24.      rc=SysRegisterObjectClass('BlackHole',system_dll||'\BLACKHOL.DLL');
  25.      If rc <> 1                 /* registered OK ?                */
  26.         Then Do;
  27.           Say  "BlackHole: could not register its object class, rc="rc".";
  28.           Exit;
  29.           End;
  30.      rc=SysCreateObject('BlackHole','Black Hole','<WP_DESKTOP>', ,
  31.                         'ICONFILE='__rexx_dir'BLACKHOL.ICO;OBJECTID=<BLACKHOLE>;',,
  32.                         'ReplaceIfExists');
  33.      If rc <> 1                 /* registered OK ?                */
  34.         Then Do;
  35.           Say  "BlackHole: could not create its object, rc="rc".";
  36.           End;
  37. Exit;
  38.