Compartir a través de


SetProp

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function adds a new entry or changes an existing entry in the property list of a specified window.

Syntax

BOOL SetProp(
  HWND hWnd,
  LPCTSTR lpString,
  HANDLE hData
);

Parameters

  • hWnd
    [in] Handle to the window for which you want to add or change an entry in the property list.
  • lpString
    [in] Pointer to a null-terminated character string that identifies the property that you want to add or change, or a global atom that identifies the string. If this parameter is a global atom, the application must create the atom by previously calling the GlobalAddAtom function. The application must place the atom, a 16-bit value, in the low-order word of the lpString parameter; the high-order word of lpString must then be zero.
  • hData
    [in] Handle to the data that you want to copy to the property list. The data handle can identify any value useful to the application.

Return Value

A nonzero value indicates that the data handle and string were successfully added to the property list. 0 indicates failure. To get extended error information, call GetLastError.

Remarks

SetProp adds a new entry to the list if the specified character string does not exist already in the list. The new entry contains the string and the handle. If the list already contains the specified character string, SetProp replaces the current handle associated with the string with the specified handle.

Before an application returns from processing a WM_DESTROY message and destroys a window, an application should remove all entries that the application added to the property list for the window by calling RemoveProp for each entry.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

GlobalAddAtom
RemoveProp
WM_DESTROY