Autor Beitrag
SAiBOT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Fr 05.10.07 15:17 
hi @ll,

Wie baut man es auf?
Ist es eine Befehlskette von "SetClipboardData", wird die Clipboard-Data nicht überschrieben bzw gelöscht wenn ein weiterer "SetClipboardData" Befehl folgt?

MSDN sagt nur wenig aus:

MSDN hat folgendes geschrieben:
Multiple Clipboard Formats
A window can place more than one clipboard object on the clipboard, each representing the same information in a different clipboard format. When placing information on the clipboard, the window should provide data in as many formats as possible. To find out how many formats are currently used on the clipboard, call the CountClipboardFormats function.

Clipboard formats that contain the most information should be placed on the clipboard first, followed by less descriptive formats. A window pasting information from the clipboard typically retrieves a clipboard object in the first format it recognizes. Because clipboard formats are enumerated in the order they are placed on the clipboard, the first recognized format is also the most descriptive.

For example, suppose a user copies styled text from a word-processing document. The window containing the document might first place data on the clipboard in a registered format, such as RTF. Subsequently, the window would place data on the clipboard in a less descriptive format, such as text (CF_TEXT).

When the content of the clipboard is pasted into another window, the window retrieves data in the most descriptive format it recognizes. If the window recognizes RTF, the corresponding data is pasted into the document. Otherwise, the text data is pasted into the document and the formatting information is lost.


Moderiert von user profile iconNarses: Code- durch Quote-Tags ersetzt.
Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Fr 05.10.2007 um 15:26
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 06.10.07 13:20 
Hallo,

um auf die Zwischenablage zugreifen zu können musst du sie erst mal mit Suche im MSDN OPENCLIPBOARD öffnen. Wenn du dann Daten ablegen willst musst sie mit Suche im MSDN EMPTYCLIPBOARD leeren und kannst dann mit Suche im MSDN SETCLIPBOARDDATA deine Daten in die Zwischenablage legen. Falls die Daten in mehreren Formaten zur Verfügung stehen kannst du SetClipboardData für jedes Format einmal aufrufen. Es gibt einige vordefinierte Formate (siehe SDK), eigene Formate kannst du mit Suche im MSDN REGISTERCLIPBOARDFORMAT registrieren.

Ich hab dir ein kleines Programm angehängt, das alle in der Zwischenablage vorhandenen Formate und deren Inhalt anzeigt. Das hab ich mal geschrieben als ich selbst mit der Zwischenablage arbeiten musste. Ich hab dir auch den Code angehängt, allerdings nur die pas-Datei und nicht das ganze Projekt, da auch eine externe Komponente benötigt wird, aber vielleicht verstehst du das ganze durch den Code ein bisschen besser.

Gruß, Motzi

Edit: vergessen zu erwähnen - das ClipboardViewer-Programm aktualisiert sich automatisch wenn sich die Zwischenablage ändert.
Einloggen, um Attachments anzusehen!
_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!