Jump to content

wpQueryLockupBackground

From EDM2

This method is specific to Version 4, or higher, of the OS/2 operating system.

This instance method returns the current values for the lockup background.

Syntax

wpQueryLockupBackground(somSelf, ppszImageFileName, pulImageMode, pulScaleFactor, pulBackgroundType, plBackgroundColor)

Parameters

somSelf (WPDesktop *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPDesktop.
ppszImageFileName (PSZ *) - in/out
Pointer to the name of the background image file (or **NULL** if none is defined).
pulImageMode (ULONG *) - in/out
Pointer to one of the following image modes:
  • BACKGROUND_NORMAL_IMAGE Normal image.
  • BACKGROUND_TILED_IMAGE Tiled image.
  • BACKGROUND_SCALED_IMAGE Scaled image.
pulScaleFactor (ULONG *) - in/out
Pointer to the scaling factor if the image mode is SCALED_IMAGE.
pulBackgroundType (ULONG *) - in/out
Pointer to one of the following background types:
  • BACKGROUND_COLOR_ONLY Color only, no image.
  • BACKGROUND_IMAGE Type of image (see image modes).
plBackgroundColor (LONG *) - in/out
Pointer to the background color as an encoded RGB value.
The RGB value is presented as a 6-digit hex value in the format **0xRRGGBB** where **RR**, **GG**, and **BB** are the red, green, and blue values ranging between 0x00 and 0xFF (0-255).

Returns

rc (none) - returns
The values are returned in the areas pointed to by the individual parameters.

How to Override

This method is generally not overridden.

Usage

This method can be called at any time in order to determine the lockup background for the current desktop.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPDesktop *somSelf; /* Pointer to the object on which the method is being invoked. */

PSZ pszImageFileName;
ULONG ulImageMode;
ULONG ulScaleFactor;
ULONG ulBackgroundType;
LONG lBackgroundColor;

wpQueryLockupBackground(somSelf,
          &pszImageFileName,
          &ulImageMode,
          &ulScaleFactor,
          &ulBackgroundType,
          &lBackgroundColor);
/* pszImageFileName contains the pointer to the name of the image file
 * ulImageMode is BACKGROUND_NORMAL_IMAGE,
 * BACKGROUND_TILED_IMAGE,
 * or BACKGROUND_SCALED_IMAGE
 * ulScaleFactor is a number between 1 and 20
 * ulBackgroundType is BACKGROUND_COLOR_ONLY or BACKGROUND_IMAGE
 * lBackgroundColor is an encoded RGB color value
 */

/* Example code provided in the source: */
  WPDesktop *Desktop;
  PSZ pszImageFile;
  ULONG ulImageMode;
  ULONG ulScaleFactor;
  ULONG ulBackgroundType;
  LONG lBackgroundColor;

  Desktop = _wpclsQueryObjectFromPath("<WP_DESKTOP>");
  _wpQueryLockupBackground(Desktop,
                           &pszImageFileName,
                           &ulImageMode,
                           &ulScaleFactor,
                           &ulBackgroundType,
                           &lBackgroundColor);
  /* pszImageFileName contains the pointer to the name of the image file
   * ulImageMode is BACKGROUND_NORMAL_IMAGE,
   * BACKGROUND_TILED_IMAGE,
   * or BACKGROUND_SCALED_IMAGE
   * ulScaleFactor is a number between 1 and 20
   * ulBackgroundType is BACKGROUND_COLOR_ONLY or BACKGROUND_IMAGE
   * lBackgroundColor is an encoded RGB color value
   */

Related Methods