A
Al Koch
Hello,
I am trying to obtain information about data that is placed on the clipboard. For my testing I am using Visio Office Pro 2003 SP1
to copy a symbol from to place data on the clipboard and my examples here are based on that.
I have tried to see what sort of data might be made available (at least by Visio) by code such as:
COleDataObject dataClipboard;
dataClipboard.AttachClipboard();
if (ClipboardEnhMetafileEnabled() && dataClipboard.IsDataAvailable(CF_ENHMETAFILE)) {
STGMEDIUM stgMetafile;
if (dataClipboard.GetData(CF_ENHMETAFILE, &stgMetafile)) {
ENHMETAHEADER EnhMetaHeader;
::GetEnhMetaFileHeader((HENHMETAFILE)stgMetafile.hEnhMetaFile,sizeof(EnhMetaHeader),&EnhMetaHeader);
TCHAR szDesc[16384];
::GetEnhMetaFileDescription((HENHMETAFILE)stgMetafile.hEnhMetaFile,16384,szDesc);
}
}
I first copy a Visio symbol to the clipboard so this places a Metafile on the clipboard. Then the above code is called when my test
app does a Paste. The Paste calls the above code but szDesc which is loaded by ::GetEnhMetaFileDescription() is always empty and I
can't see any useful info in the EnhMetaHeader which is loaded by ::GetEnhMetaFileHeader().
From the above, I would just conclude that Visio simply doesn't supply any "descriptive" info to the clipboard about the Metafile
being placed there except that if I use the Windows Clipboard Viewer app and save the clipboard contents as a *.CLP file I can
examine that file with a hex editor and I see "descriptive" strings such as "Visio 11.0".
My more general question is how does the Clipboard Viewer obtain such data (i.e., "Visio 11.0") and my more specific question is how
can I get info (to allow identifucation of the Visio symbol copied to the clipboard) on Visio symbols placed on the clipboard?
Thank you
Al Koch
(e-mail address removed)
I am trying to obtain information about data that is placed on the clipboard. For my testing I am using Visio Office Pro 2003 SP1
to copy a symbol from to place data on the clipboard and my examples here are based on that.
I have tried to see what sort of data might be made available (at least by Visio) by code such as:
COleDataObject dataClipboard;
dataClipboard.AttachClipboard();
if (ClipboardEnhMetafileEnabled() && dataClipboard.IsDataAvailable(CF_ENHMETAFILE)) {
STGMEDIUM stgMetafile;
if (dataClipboard.GetData(CF_ENHMETAFILE, &stgMetafile)) {
ENHMETAHEADER EnhMetaHeader;
::GetEnhMetaFileHeader((HENHMETAFILE)stgMetafile.hEnhMetaFile,sizeof(EnhMetaHeader),&EnhMetaHeader);
TCHAR szDesc[16384];
::GetEnhMetaFileDescription((HENHMETAFILE)stgMetafile.hEnhMetaFile,16384,szDesc);
}
}
I first copy a Visio symbol to the clipboard so this places a Metafile on the clipboard. Then the above code is called when my test
app does a Paste. The Paste calls the above code but szDesc which is loaded by ::GetEnhMetaFileDescription() is always empty and I
can't see any useful info in the EnhMetaHeader which is loaded by ::GetEnhMetaFileHeader().
From the above, I would just conclude that Visio simply doesn't supply any "descriptive" info to the clipboard about the Metafile
being placed there except that if I use the Windows Clipboard Viewer app and save the clipboard contents as a *.CLP file I can
examine that file with a hex editor and I see "descriptive" strings such as "Visio 11.0".
My more general question is how does the Clipboard Viewer obtain such data (i.e., "Visio 11.0") and my more specific question is how
can I get info (to allow identifucation of the Visio symbol copied to the clipboard) on Visio symbols placed on the clipboard?
Thank you
Al Koch
(e-mail address removed)