Jump to content

wpSearchFolder

From EDM2
Revision as of 04:09, 25 November 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpSearchFolder}} Searches a folder for the name specified. ==Syntax== _wpSearchFolder(somSelf, pszName, ulSearchType, ulLen, pInfo, ResultFolder) ==Parameters== ;''somSelf'' (WPFolder *) - input :Pointer to the object on which the method is being invoked. :Points to an object of class WPFolder. ;''pszName'' (PSZ) - input :Descriptive name of what is being searched. :If *ulSearchType* is **SEARCH_ALL_FOLDERS** then *pszName*...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Searches a folder for the name specified.

Syntax

_wpSearchFolder(somSelf, pszName, ulSearchType,
                ulLen, pInfo, ResultFolder)

Parameters

somSelf (WPFolder *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPFolder.
pszName (PSZ) - input
Descriptive name of what is being searched.
If *ulSearchType* is **SEARCH_ALL_FOLDERS** then *pszName* must contain just a descriptive name without path information. Otherwise *pszName* must be a fully-qualified descriptive name starting with a drive letter (for example, `C:\Folder1\Folder2`).
ulSearchType (ULONG) - input
Type of search being conducted.
  • **SEARCH_ALL_FOLDERS** (1)
  • **SEARCH_THIS_FOLDER** (2)
  • **SEARCH_THIS_TREE** (3)
ulLen (ULONG) - input
The number of **SEARCH_INFO** structures passed in.
pInfo (PSEARCH_INFO) - input
Pointer to the **SEARCH_INFO** structures. Contains information on what classes of objects to search for.
ResultFolder (WPFolder *) - input
The folder to contain the links to the matched items.

Returns

rc (BOOL) - returns
Success indicator.
  • TRUE Search was successful and something was found.
  • FALSE Search was cancelled, nothing was found, or an error occurred.

How to Override

This method should not be overridden.

Usage

This method can be called at any time.

Remarks

If *ulSearchType* is **SEARCH_ALL_FOLDERS** then *pszName* is used to build up a new name of the form *\:\pszName*. Each valid drive letter is then substituted in for the *, and the search is performed as described below.

Beginning at the root directory, search for folder matches at the name level. For the example `C:\Folder1\Folder2\*`, search the **C:** folder for all occurrences of Folder objects with the descriptive name **Folder1**. Then search those for all Folder objects of descriptive name **Folder2**.

Then within **Folder2** search for all objects that are descended from the classes listed in the *pInfo* structures passed in and see if the descriptive name matches. If a match is found, consult the *pInfo* structure again to determine if the **fSkipExtendedSearchCriteria** flag is set. If the flag is not set, add the object to the result folder. If the flag is set, do an extended criteria match. If it matches, add the object to the results folder. If there are subfolders to be searched, recurse down into the subfolders to continue the search.

All matches are placed in the result folder as a link to the matched item.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPFolder *somSelf; /* Pointer to the object on which the method is being invoked. */
PSZ pszName; /* Descriptive name of what is being searched. */
ULONG ulSearchType; /* Type of search being conducted. */
ULONG ulLen; /* The number of SEARCH_INFO structures passed in. */
PSEARCH_INFO pInfo; /* Pointer to the SEARCH_INFO structures. */
WPFolder *ResultFolder; /* The folder to contain the links to the matched items. */
BOOL rc; /* Success indicator */

rc = _wpSearchFolder(somSelf, pszName, ulSearchType,
            ulLen, pInfo, ResultFolder);

Related Methods

This method is not covered in the provided text.