Y
yinjentam
Hi all,
Based on the following thread,
http://groups.google.com/groups?hl=...204171144.223f368%40posting.google.com&rnum=6
Ken Slovak gave us a very good example in Visual Basic how to save the
clipboard data and restore it later after the copy+paste button image.
However, I need a C++ example of how to do that, especially the
clipboard formats in C++ are different from those in the VB example.
This is what I have attempted thus far:
-----
// Check the number of different data formats currently on the
clipboard
if :CountClipboardFormats() == 0)
return;
HWND hwnd = ::GetClipboardOwner();
// Something wrong when opening the clipboard
if (! ::OpenClipboard(hwnd))
return;
// Start enumerating the data formats currently available on the
clipboard.
UINT uFormat = ::EnumClipboardFormats(0);
LPTSTR lpFormatName;
TCHAR szFormatName[256];
while (uFormat)
{
if :GetClipboardFormatName(uFormat, szFormatName,
sizeof(szFormatName)))
{
lpFormatName = szFormatName;
}
uFormat = ::EnumClipboardFormats(uFormat);
}
Unfortunately I don't really know how to go on from here. How do I
actually store the clipboard data and restore it later??
Thanks for all your help!!
Jenny
Based on the following thread,
http://groups.google.com/groups?hl=...204171144.223f368%40posting.google.com&rnum=6
Ken Slovak gave us a very good example in Visual Basic how to save the
clipboard data and restore it later after the copy+paste button image.
However, I need a C++ example of how to do that, especially the
clipboard formats in C++ are different from those in the VB example.
This is what I have attempted thus far:
-----
// Check the number of different data formats currently on the
clipboard
if :CountClipboardFormats() == 0)
return;
HWND hwnd = ::GetClipboardOwner();
// Something wrong when opening the clipboard
if (! ::OpenClipboard(hwnd))
return;
// Start enumerating the data formats currently available on the
clipboard.
UINT uFormat = ::EnumClipboardFormats(0);
LPTSTR lpFormatName;
TCHAR szFormatName[256];
while (uFormat)
{
if :GetClipboardFormatName(uFormat, szFormatName,
sizeof(szFormatName)))
{
lpFormatName = szFormatName;
}
uFormat = ::EnumClipboardFormats(uFormat);
}
Unfortunately I don't really know how to go on from here. How do I
actually store the clipboard data and restore it later??
Thanks for all your help!!
Jenny