|
-
March 26th, 2009, 06:33 AM
#1
Problem with the clipboard
hello , sorry for my bad english ....
i have a problem with the clipbaord
i try to get a image from a picture control and to put it in the clipboard ...
I used something like that :
void SendToClipboard(void)
{
HBITMAP hBitmap = NULL;
hBitmap = (HBITMAP)SendMessage(GetDlgItem(hWnd,IDC_STATIC),STM_GETIMAGE,(WPARAM) IMAGE_BITMAP,(LPARAM) 0);
OpenClipboard(hWnd);
EmptyClipboard();
if (hBitmap)
{
SetClipboardData(CF_BITMAP, hBitmap);
CloseClipboard();
}
}
This function is called from a button ...
The first time , no problem, when i press the button , i have a correct bitmap in the clipboard ( verify with paint) but if i press the button a second time , i have an incorrect bitmap in the clipboard ... when i try to paste the bitmap in paint , i have an error message ( "erreur d'obtention des données du presse-papiers" in french)
do you have any idea ?
Thanks.
Dooug
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|