The clipboard owner is any application window connected to the clipboard data. Following are situations in which an application would call WinSetClipbrdOwner to become the clipboard owner:
The window specified in the call to the WinSetClipbrdOwner function responds to the following messages:
┌────────────────────┬────────────────────────────────────────┐│Message │Description │ ├────────────────────┼────────────────────────────────────────┤ │WM_RENDERFMT │Sent by the system to the clipboard │ │ │owner when a particular format with │ │ │delayed rendering must be rendered. The│ │ │receiver must render the data in the │ │ │specified format and pass it to the │ │ │clipboard by calling the │ │ │WinSetClipbrdData function. │ ├────────────────────┼────────────────────────────────────────┤ │WM_RENDERALLFMTS │Sent by the system to the clipboard │ │ │owner just before the owner application │ │ │terminates. The receiver must render │ │ │the clipboard data in all formats on the│ │ │clipboard with delayed rendering. It │ │ │must pass the data for each format to │ │ │the clipboard by calling the │ │ │WinSetClipbrdData function. │ ├────────────────────┼────────────────────────────────────────┤ │WM_DESTROYCLIPBOARD │Sent by the system to the clipboard │ │ │owner when the clipboard is cleared by │ │ │another application calling the │ │ │WinEmptyClipbrd function. The receiver │ │ │must free the memory occupied by any │ │ │clipboard formats using the │ │ │CFI_OWNERFREE attribute. │ ├────────────────────┼────────────────────────────────────────┤ │WM_SIZECLIPBOARD │Sent by the clipboard viewer to the │ │ │clipboard owner when the clipboard │ │ │contains the data handle with the │ │ │CFI_OWNERDISPLAY attribute and when the │ │ │clipboard-viewer changes size. When the│ │ │clipboard viewer is being destroyed or │ │ │reduced to an icon, this message is sent│ │ │with the coordinates of the opposite │ │ │corners set to (0,0), which permits the │ │ │owner to free its display resources. │ ├────────────────────┼────────────────────────────────────────┤ │WM_VSCROLLCLIPBOARD │Sent by the clipboard viewer to the │ │ │clipboard owner when the clipboard │ │ │contains data with the CFI_OWNERDISPLAY │ │ │attribute and when an event occurs in │ │ │the clipboard-viewer scroll bars. The │ │ │receiver must respond to this message by│ │ │scrolling the image, invalidating the │ │ │appropriate area of the clipboard │ │ │viewer, and updating the slider │ │ │position. │ ├────────────────────┼────────────────────────────────────────┤ │WM_HSCROLLCLIPBOARD │Sent by the clipboard viewer to the │ │ │clipboard owner when the clipboard │ │ │contains data with the CFI_OWNERDISPLAY │ │ │attribute and when an event occurs in │ │ │the scroll bars of the clipboard viewer.│ │ │The receiver must respond to this │ │ │message by scrolling the image, │ │ │invalidating the appropriate area of the│ │ │clipboard viewer, and updating the │ │ │slider position. │ ├────────────────────┼────────────────────────────────────────┤ │WM_PAINTCLIPBOARD │Sent by the clipboard viewer to the │ │ │clipboard owner when the clipboard │ │ │contains data with the CFI_OWNERDISPLAY │ │ │attribute and when the clipboard-viewer │ │ │client area needs repainting. The │ │ │receiver must respond to this message by│ │ │painting the requested format (by │ │ │calling WinGetPS for the window handle │ │ │of the clipboard viewer). │ └────────────────────┴────────────────────────────────────────┘
An application automatically loses ownership of the clipboard when the clipboard data is cleared by the WinEmptyClipbrd function. Ownership is necessary only when data is present on the clipboard. Typically, an application loses ownership when another application places data on the clipboard.