SetProp

Syntax

BOOL SetProp(hWnd,lpString,hData)

This function adds a new entry or changes an existing entry in the property list of the specified window. The SetProp function adds a new entry to the list if the character string specified by the lpString parameter does not already exist in the list. The new entry contains the string and the handle. Otherwise, the function replaces the string's current handle with the one specified by the hData parameter.

The hData parameter can contain any 16-bit value useful to the application.

Parameter Type/Description  

hWnd HWND Identifies the window whose property list is to receive the new entry.  
lpString LPSTR Points to a null-terminated character string or an atom that identifies a string. If an atom is given, it must have been previously created by using the AddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpString; the high-order word must be zero.  
hData HANDLE Identifies a data handle to be copied to the property list.  

Return Value

The return value specifies the outcome of the function. It is nonzero if the data handle and string are added to the property list. Otherwise, it is zero.

Comments

The application is responsible for removing all entries it has added to the property list before destroying the window (that is, before the application processes the WM_DESTROY message). The RemoveProp function must be used to remove entries from a property list.