wpIsCurrentDesktop
This instance method allows the desktop to specify whether it is the active Desktop folder on the system.
Syntax
_wpIsCurrentDesktop(somSelf)
Parameters
- somSelf (WPDesktop *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPDesktop.
Returns
- rc (BOOL) - returns
- Active desktop indicator.
- TRUE This object is the active Desktop.
- FALSE This object is not the active Desktop and should behave as a normal folder.
How to Override
This method is generally not overridden.
Usage
This method is called at the beginning of every overridden method. If the return is false, the override method should call its parent without doing any override processing. If the return is true, override processing can be done.
Example Code
#define INCL_WINWORKPLACE #include <os2.h> WPDesktop *somSelf; /* Pointer to the object on which the method is being invoked. */ BOOL rc; /* Active desktop indicator. */ rc = _wpIsCurrentDesktop(somSelf);
Remarks
The active desktop is set by the system every time the Workplace Shell is initialized, or any time the user profile is reset by a call to **PrfReset**. Because there can be only one active desktop and objects cannot change their class, desktop objects and descendants must call **wpIsCurrentDesktop** to determine if it is the current desktop. Desktop folders which are not active take on the behavior of standard folder objects. For more information about PrfReset, see the *Presentation Manager Programming Reference*.
Example Code
TheObject *pObjtoChange;
/* Make sure we are not manipulating the Desktop! */
if (_wpIsCurrentDesktop(pObjtoChange)) {
WinMessageBox(HWND_DESKTOP,
HWND_DESKTOP,
"Changing your Desktop is not supported!",
0,
MB_CANCEL | MB_WARNING | MB_SYSTEMMODAL );
} else {
/* manipulate the object here */
} /* endif */