home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / wcat21.zip / cleanwps.c < prev    next >
C/C++ Source or Header  |  1995-05-16  |  3KB  |  89 lines

  1. /*******************************************************************************
  2. *                                                                              *
  3. * You may modify and compile this file to deinstall                            *
  4. *    - the desktop class                                                       *
  5. *    - the shutdown folder class                                               *
  6. *    - delete the shutdown folder                                              *
  7. *    - delete the WPS WatchCat object                                          *
  8. *    - unregister the WPS WatchCat class                                       *
  9. *                                                                              *
  10. *******************************************************************************/
  11.  
  12. #define INCL_WINWORKPLACE
  13. #define INCL_WINSHELLDATA
  14. #define INCL_DOS
  15. #include <os2.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <conio.h>
  19.  
  20. void main()
  21.   {
  22.   HOBJECT object;
  23.  
  24.   setbuf(stdout, 0);
  25.   printf("CleanWPS - uninstall WatchCat\'s WPS objects\n");
  26.   printf("Use this program to: \n");
  27.   printf("   - delete the shutdown folder\n");
  28.   printf("   - deregister the shutdown Folder class\n");
  29.   printf("   - unreplace the WatchCat desktop\n");
  30.   printf("   - deregister WatchCat Desktop class\n");
  31.   printf("   - delete the WatchCat icon from the WPS\n");
  32.   printf("   - deregister the WatchCat class\n");
  33.   printf("Note: You may run this program more than one time.\n\n");
  34.   printf("Do you want to continue? ");
  35.  
  36.   if (tolower(getch())!='y')
  37.      exit(1);
  38.  
  39.   printf("\nDeleting the Shutdown-Folder..........");
  40.   object=WinQueryObject("<WP_SHUTDOWN>");
  41.   if (!object)
  42.      printf("folder not found\n");
  43.   else
  44.      {
  45.      if (WinDestroyObject(object))
  46.         printf("ok\n");
  47.      else
  48.         printf("Cannot delete object\n");
  49.      }
  50.  
  51.   printf("Deregistering Shutdown class .........");
  52.   if (WinDeregisterObjectClass("SDFolder"))
  53.      printf("ok\n");
  54.   else
  55.      printf("error\n");
  56.  
  57.   printf("Unreplacing the Desktop ..............");
  58.   if (WinReplaceObjectClass("WPDesktop", "WCDesk", FALSE))
  59.      printf("ok\n");
  60.   else
  61.      printf("error\n");
  62.  
  63.   printf("Unregistering the extended desktop ...");
  64.   if (WinDeregisterObjectClass("WCDesk"))
  65.      printf("ok\n");
  66.   else
  67.      printf("error\n");
  68.  
  69.   printf("\nDeleting the WatchCat object .........");
  70.   object=WinQueryObject("<WP_CAT>");
  71.   if (!object)
  72.      printf("object not found\n");
  73.   else
  74.      {
  75.      if (WinDestroyObject(object))
  76.         printf("ok\n");
  77.      else
  78.         printf("Cannot delete object\n");
  79.      }
  80.  
  81.   printf("Deregistering the WatchCat class .....");
  82.   if (WinDeregisterObjectClass("WPCat"))
  83.      printf("ok\n");
  84.   else
  85.      printf("error\n");
  86.  
  87.   printf("\n\nDeinstallation completed.\n");
  88.   }
  89.