home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / bubpd103.zip / Source / LPReplace.cpp < prev    next >
C/C++ Source or Header  |  1998-11-15  |  2KB  |  75 lines

  1. /*
  2.  * LPReplace - Utility to replace the WPLaunchPad-class
  3.  * with WPLnchCW.
  4.  *
  5.  * (c) 1998 Chris Wohlgemuth
  6.  *
  7.  * christopher.wohlgemuth@bch.siemens.de
  8.  *
  9.  * V1.00 13.11.1998
  10.  *
  11.  */
  12. /*
  13.  * This program is free software; you can redistribute it and/or modify
  14.  * it under the terms of the GNU General Public License as published by
  15.  * the Free Software Foundation; either version 2, or (at your option)
  16.  * any later version.
  17.  *
  18.  * This program is distributed in the hope that it will be useful,
  19.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21.  * GNU General Public License for more details.
  22.  *
  23.  * You should have received a copy of the GNU General Public License
  24.  * along with this program; see the file COPYING.  If not, write to
  25.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  */
  27.  
  28. #define INCL_WINWORKPLACE
  29. #include <os2.h>
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32.  
  33. void usage(char *argv[])
  34. {
  35.     printf("\n%s - Replaces WPLaunchPad with new class 'WPLnchCW'\n",argv[0]);
  36.     printf("WPLnchCW must already be registered or the replacement fails.\n\n");
  37.     printf("Usage:\n\n %s 1 - replace WPLaunchPad\n",argv[0]);
  38.     printf(" %s 0 - unreplace WPLaunchPad\n\n",argv[0]);
  39. }
  40.  
  41. int main(int argc, char *argv[])
  42. {
  43.     APIRET rc;
  44.  
  45.     if(argc<2)
  46.     {
  47.         usage(argv);
  48.         exit(10);
  49.     }
  50.     if(*argv[1]=='1') {
  51.         if(WinReplaceObjectClass("WPLaunchPad","WPLnchCW",TRUE)){
  52.             printf("WPLaunchPad succesful replaced.\n");
  53.             printf("You have to restart your WPS to see the effect.\n");
  54.             DosBeep(1000,100);
  55.             exit(0);
  56.         }
  57.         printf("Can't replace WPLaunchPad!\n");
  58.         DosBeep(100,300);
  59.         exit(20);
  60.     }
  61.     if(*argv[1]=='0') {
  62.         if(WinReplaceObjectClass("WPLaunchPad","WPLnchCW",FALSE)) {
  63.             printf("WPLaunchPad unreplaced.\n");
  64.             printf("You have to restart your WPS to see the effect.\n");
  65.             DosBeep(1000,100);
  66.             exit(0);
  67.         }
  68.         printf("Can't unreplace WPLaunchPad!\n");
  69.         DosBeep(100,300);
  70.         exit(20);    
  71.     }
  72.     usage(argv);
  73.     exit(20);
  74. }
  75.