case IDM_PASTEDIB:
if (OpenClipboard (hWnd)) {
if (h = GetClipboardData (CF_DIB)) {
/* Delete current DIB and get CF_DIB and
* CF_PALETTE format data from the clipboard
*/
hpal = GetClipboardData (CF_PALETTE); FreeDib();
hdibCurrent = CopyHandle (h);
if (hdibCurrent) {
bLegitDraw = TRUE;
lstrcpy(achFileName,"<Clipboard>");
hbiCurrent = hdibCurrent; /* If there is a CF_PALETTE object in the
* clipboard, this is the palette to assume
* the DIB should be realized against, otherwise
* create a palette for it.
*/
if (hpal)
hpalCurrent = CopyPalette (hpal);
else
hpalCurrent = CreateDibPalette (hdibCurrent); SizeWindow(hWnd);
}
else {
bLegitDraw = FALSE;
LoadString(hInst, IDS_NOMEM, lpBuffer, sizeof(lpBuffer));
ErrMsg(lpBuffer);
}
}
CloseClipboard();
}
break;
if (OpenClipboard (hWnd)) {
if (h = GetClipboardData (CF_DIB)) {
/* Delete current DIB and get CF_DIB and
* CF_PALETTE format data from the clipboard
*/
hpal = GetClipboardData (CF_PALETTE); FreeDib();
hdibCurrent = CopyHandle (h);
if (hdibCurrent) {
bLegitDraw = TRUE;
lstrcpy(achFileName,"<Clipboard>");
hbiCurrent = hdibCurrent; /* If there is a CF_PALETTE object in the
* clipboard, this is the palette to assume
* the DIB should be realized against, otherwise
* create a palette for it.
*/
if (hpal)
hpalCurrent = CopyPalette (hpal);
else
hpalCurrent = CreateDibPalette (hdibCurrent); SizeWindow(hWnd);
}
else {
bLegitDraw = FALSE;
LoadString(hInst, IDS_NOMEM, lpBuffer, sizeof(lpBuffer));
ErrMsg(lpBuffer);
}
}
CloseClipboard();
}
break;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货