|
Last change
on this file since 7 was 2, checked in by stevenhl, 8 years ago |
|
Import sources from cwmm-full.zip dated 2005-03-21
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | #define INCL_DOSMISC /* DOS Miscellaneous values */
|
|---|
| 2 | #define INCL_DOSERRORS /* DOS Error values */
|
|---|
| 3 | #define INCL_DOSFILEMGR
|
|---|
| 4 | #define INCL_WINWORKPLACE
|
|---|
| 5 |
|
|---|
| 6 | #include <os2.h>
|
|---|
| 7 | #include <stdio.h>
|
|---|
| 8 |
|
|---|
| 9 | void usage(char *progName) {
|
|---|
| 10 | printf("Program to replace a WPS class.\n");
|
|---|
| 11 | printf("(c) Chris Wohlgemuth 2001\n");
|
|---|
| 12 | printf("http://www.geocities.com/SiliconValley/Sector/5785/\n\n");
|
|---|
| 13 |
|
|---|
| 14 | fprintf(stderr,"Usage:\n");
|
|---|
| 15 | fprintf(stderr,"%s <Class to replace> <Replacement class> [u]\n",progName);
|
|---|
| 16 | fprintf(stderr,"If 'u' is given the class will be unreplaced.\n\n");
|
|---|
| 17 |
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | int main(int argc, char* argv[]) {
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | APIRET rc = NO_ERROR; /* Return code */
|
|---|
| 24 | BOOL bReplace=TRUE;
|
|---|
| 25 |
|
|---|
| 26 | if(argc<3) {
|
|---|
| 27 | usage(argv[0]);
|
|---|
| 28 | exit(1);
|
|---|
| 29 | }
|
|---|
| 30 | if(argc==4)
|
|---|
| 31 | if(argv[3]=="u")
|
|---|
| 32 | bReplace=FALSE;
|
|---|
| 33 |
|
|---|
| 34 | if(WinReplaceObjectClass(argv[1] , argv[2], bReplace)){
|
|---|
| 35 | printf("Class replaced.\n");
|
|---|
| 36 | printf("You have to reboot so the change can take effect.\n");
|
|---|
| 37 | }
|
|---|
| 38 | else{
|
|---|
| 39 | printf("!! Couldn't replace the class !!.\n\n");
|
|---|
| 40 | DosBeep(100,200);
|
|---|
| 41 | return 1;
|
|---|
| 42 | }
|
|---|
| 43 | printf("Done.\n\n");
|
|---|
| 44 |
|
|---|
| 45 | return 0;
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.