home *** CD-ROM | disk | FTP | other *** search
- EXTPROC CEnvi
-
- #include <PMdll.lib>
-
- main(argc,argv)
- {
- if ( 2 < argc )
- return EXIT_FAILURE;
-
- CurDir = ( argc == 2 ) ? argv[1] : FullPath(".") ;
-
- if ( !strcmp(CurDir+1,":\\") )
- // already at root directory
- return EXIT_FAILURE;
-
- // go up one directory and open that folder
- LastBackslash = strrchr(CurDir,'\\');
- if ( NULL == LastBackslash )
- return EXIT_FAILURE;
-
- // if last backslash is only backslash then delete after it, bacause
- // then is root directory, else delete at the backslash
- if ( LastBackslash == strchr(CurDir,'\\') )
- LastBackslash[1] = '\0';
- else
- LastBackslash[0] = '\0';
-
- if ( !(Obj = WinQueryObject(CurDir)) )
- return EXIT_FAILURE;
-
- WinSetObjectData(Obj,"OPEN=DEFAULT;");
- }
-