Autor Beitrag
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 09.09.04 11:17 
Hallo!

Ich möchte ein eigenes Format für die Zwischenablage benutzen, das mein Programm benutzen kann. Das ist mir RegisterClipboardFormat auch kein Problem.
Nun sollen aber auch andere Programme die Daten benutzen können (die natürlich mein Format nicht kennen), weshalb ich die Daten auch im RTF- und Nur-Text-Format zur Verfügung stellen möchte.

Nur: Wie geht das? Meine Versuche haben entweder nicht funktioniert oder den Inhalt der Zwischenablage ersetzt. Es sollen aber die Daten in verschiedenen Formaten parallel vorliegen, wie es in der Zwischenablage vorgesehen sein soll, damit sich eine Anendung die Daten im jeweils unterstützten Format holen kann. (Steht in der Hilfe, leider ohne weitere Erklärung)

Kann mir jemand sagen wie das geht oder weiß jemand wo es ein entsprechendes Beispiel gibt?

Danke,
Sebastian
Gast
Gast
Erhaltene Danke: 1



BeitragVerfasst: Sa 02.10.04 16:35 
Das PSDK kennt alle Antworten:

Zitat:
Delayed Rendering
When placing a clipboard format on the clipboard, a window can delay rendering the data in that format until the data is needed. To do so, an application can specify NULL for the hData parameter of the SetClipboardData function. This is useful if the application supports several clipboard formats, some or all of which are time-consuming to render. By passing a NULL handle, a window renders complex clipboard formats only when and if they are needed.

If a window delays rendering a clipboard format, it must be prepared to render the format upon request for as long as it is the clipboard owner. The system sends the clipboard owner a WM_RENDERFORMAT message when a request is received for a specific format that has not been rendered. Upon receiving this message, the window should call the SetClipboardData function to place a global memory handle on the clipboard in the requested format.

If the clipboard owner is destroyed and has delayed rendering some or all clipboard formats, it receives the WM_RENDERALLFORMATS message. Upon receiving this message, the window should place valid memory handles on the clipboard for all clipboard formats that it provides. This ensures that these formats remain available after the clipboard owner is destroyed.

An application should not open the clipboard before calling SetClipboardData in response to the WM_RENDERFORMAT or WM_RENDERALLFORMATS message.

Any clipboard formats that are not rendered in response to the WM_RENDERALLFORMATS message cease to be available to other applications and are no longer enumerated by the clipboard functions.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 02.10.04 17:27 
Hi,


Schau dir mal die Suche im MSDN SETCLIPBOARDDATA an.
Damit kannst du mehrere Formate gleichzeitig in die Zwischenablage kopieren.

Habe mal ein Beispiel geschrieben, wie man zwei verschiedene Formate (Text und HTML)
in die Zwischenablage einfügen kann.

www.swissdelphicente...showcode.php?id=1391
jaenicke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 04.10.04 17:06 
@Assarbad: Das meinte ich nicht, ist aber auch sehr interessant. Wusste ich gar nicht, dass das geht. Thx ;-)

@toms: Prima! Genau das hatte ich gesucht. Danke!