SetProp

2.x

  BOOL SetProp(hwnd, lpsz, hData)    
  HWND hwnd; /* handle of window, */  
  LPCSTR 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.

Parameters

hwnd

Identifies the window whose property list receives the new entry.

lpsz

Points to a null-terminated string or 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 16-bit value useful to the application.

Return Value

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

Comments

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.

See Also

GetProp, GlobalAddAtom, RemoveProp