BOOL SetProp(hwnd, lpsz, hData) | |||||
HWND hwnd; | /* handle of window | */ | |||
LPCTSTR lpsz; | /* atom or address of string | */ | |||
HANDLE hData; | /* handle of data | */ |
The SetProp function adds a new entry or changes an existing entry in the property list of the given window. The function adds a new entry to the list if the given character string does not exist already in the list. The new entry contains the string and the handle. Otherwise, the function replaces the string's current handle with the given handle.
hwnd
Identifies the window whose property list receives the new entry.
lpsz
Points to a null-terminated string or is an atom that identifies a string. If this parameter is an atom, it must be a global atom created by a previous call to the GlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpsz; the high-order word must be zero.
hData
Identifies data to be copied to the property list. The data handle can identify any value useful to the application.
The return value is TRUE if the data handle and string are added to the property list. Otherwise, it is FALSE.
Before destroying a window (that is, before processing the WM_DESTROY message), an application must remove all entries it has added to the property list. The RemoveProp function must be used to remove entries from a property list.
The SetProp function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).
EnumProps, GetProp, GlobalAddAtom, RemoveProp