wpclsQueryFolder
Appearance
This class method is called to get a pointer to a folder object that corresponds to a given file system location.
Syntax
_wpclsQueryFolder(somSelf, pLocation, fLock)
Parameters
- somSelf (M_WPObject *) - input
- Pointer to the WPObject class object.
- pLocation (PSZ) - input
- Folder location. This value can be in any of the following formats:
- Predefined object IDs of system folders:
- '<WP_NOWHERE>' The hidden folder.
- '<LOCATION_DESKTOP>' The currently active desktop.
- '<WP_OS2SYS>' The System folder.
- '<WP_TEMPS>' The Templates folder.
- '<WP_CONFIG>' The System Setup folder.
- '<WP_START>' The Startup folder.
- '<WP_INFO>' The Information folder.
- '<WP_DRIVES>' The Drives folder.
- Real name specified as a fully qualified path name.
- fLock (BOOL) - input
- Lock object flag. If this flag is false, the newly created object will be made dormant whenever the object and the folder containing the object are closed. If this flag is true, the new flag will remain active until the caller issues the wpUnlockObject method on it.
- Success (WPFolder *) - returns
- Success indicator. NULL Error occurred. Other Pointer to a folder object.
Returns
- Success (WPFolder *) - returns
- Success indicator. NULL Error occurred. Other Pointer to a folder object.
Remarks
To obtain a real name from an object pointer, the wpQueryRealName method should be called.
How to Override
This method is generally not overridden.
Usage
This method can be called at any time in order to determine the object pointer for a folder.
Example Code
Declaration:
#define INCL_WINWORKPLACE #include <os2.h> M_WPObject *somSelf; /* Pointer to the WPObject class object. */ PSZ pLocation; /* Folder location. */ BOOL fLock; /* Lock object flag. */ WPFolder *Success; /* Success indicator. */ Success = _wpclsQueryFolder(somSelf, pLocation, fLock);
This example gets the object pointer of the desktop folder and creates a shadow of it.
#define INCL_WINWORKPLACE #include <os2.h> SOMAny *objDesktop; SOMAny *objSysShadow; /* Get the object pointer of the desktop folder */ objDesktop = _wpclsQueryFolder( _WPFolder, '<WP_DESKTOP>', TRUE); /* Keep active */ /* Create a shadow of the desktop */ objSysShadow = _wpCreateShadowObject( self, objDesktop, FALSE); /* Make dormant when folder closes */