Jump to content

WinRemovePresParam

From EDM2
Revision as of 02:59, 9 April 2025 by Martini (talk | contribs) (Created page with "This function ''removes a presentation parameter associated with a window''. ==Syntax== WinRemovePresParam(hwnd, idAttrType) ==Parameters== ;hwnd (HWND) - Input : Window handle whose presentation is to be changed. ;idAttrType (ULONG) - Input : Type of presentation parameter attribute to be removed. : This parameter can be set to one of the following system-defined presentation parameter attribute types or an application-defined type: :;PP_FOREGROUNDCOLOR :: Fo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function removes a presentation parameter associated with a window.

Syntax

WinRemovePresParam(hwnd, idAttrType)

Parameters

hwnd (HWND) - Input
Window handle whose presentation is to be changed.
idAttrType (ULONG) - Input
Type of presentation parameter attribute to be removed.
This parameter can be set to one of the following system-defined presentation parameter attribute types or an application-defined type:
PP_FOREGROUNDCOLOR
Foreground color (in RGB) attribute.
PP_BACKGROUNDCOLOR
Background color (in RGB) attribute.
PP_FOREGROUNDCOLORINDEX
Foreground color index attribute.
PP_BACKGROUNDCOLORINDEX
Background color index attribute.
PP_HILITEFOREGROUNDCOLOR
Highlighted foreground color (in RGB) attribute, for example for selected menu items.
PP_HILITEBACKGROUNDCOLOR
Highlighted background color (in RGB) attribute.
PP_HILITEFOREGROUNDCOLORINDEX
Highlighted foreground color index attribute.
PP_HILITEBACKGROUNDCOLORINDEX
Highlighted background color index attribute.
PP_DISABLEDFOREGROUNDCOLOR
Disabled foreground color (in RGB) attribute.
PP_DISABLEDBACKGROUNDCOLOR
Disabled background color (in RGB) attribute.
PP_DISABLEDFOREGROUNDCOLORINDEX
Disabled foreground color index attribute.
PP_DISABLEDBACKGROUNDCOLORINDEX
Disabled background color index attribute.
PP_BORDERCOLOR
Border color (in RGB) attribute.
PP_BORDERCOLORINDEX
Border color index attribute.
PP_FONTNAMESIZE
Font name and size attribute.
PP_ACTIVECOLOR
Active color value of data type RGB.
PP_ACTIVECOLORINDEX
Active color index value of data type LONG.
PP_INACTIVECOLOR
Inactive color value of data type RGB.
PP_INACTIVECOLORINDEX
Inactive color index value of data type LONG.
PP_ACTIVETEXTFGNDCOLOR
Active text foreground color value of data type RGB.
PP_ACTIVETEXTFGNDCOLORINDEX
Active text foreground color index value of data type LONG.
PP_ACTIVETEXTBGNDCOLOR
Active text background color value of data type RGB.
PP_ACTIVETEXTBGNDCOLORINDEX
Active text background color index value of data type LONG.
PP_INACTIVETEXTFGNDCOLOR
Inactive text foreground color value of data type RGB.
PP_INACTIVETEXTFGNDCOLORINDEX
Inactive text foreground color index value of data type LONG.
PP_INACTIVETEXTBGNDCOLOR
Inactive text background color value of data type RGB.
PP_INACTIVETEXTBGNDCOLORINDEX
Inactive text background color index value of data type LONG.
PP_SHADOW
Changes the color used for drop shadows on certain controls.
PP_USER
This is a user-defined presentation parameter.

Returns

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

When a presentation parameter is removed, a WM_PRESPARAMCHANGED message is sent to all windows owned by the window calling the WinSetPresParam function. (See also WinSetPresParam and WinQueryPresParam.)

Errors

Possible returns from WinGetLastError:

PMERR_INVALID_HWND (0x1001)
An invalid window handle was specified.

Example Code

#define INCL_WINSYS /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HWND     hwnd;        /*  Window handle whose presentation is to be change. */
ULONG    idAttrType;  /*  Type of presentation parameter attribute to be removed. */
BOOL     rc;          /*  Success indicator. */

rc = WinRemovePresParam(hwnd, idAttrType);

This example removes the disable-foreground attribute after querying to ensure that the referenced window has this attribute defined.

#define INCL_WINSYS            /* System values           */
#include <os2.h>

HWND  hwnd;                       /* window handle            */
ULONG AttrFound;                  /* attributes found         */
ULONG AttrValue[32];    /* attribute value          */
ULONG cbRetLen;                   /* length of returned value */

WinRemovePresParam(hwnd, PP_DISABLEDFOREGROUNDCOLORINDEX);


Related Functions