获得窗口的缩略图 电脑中打开多个文件夹、应用软件等,现在我想获得这些窗口的缩略图,制作一个任务栏(鼠标移动到任务栏中,则显示相应窗口缩略图),有方便可以获得窗口的缩略图????? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /**************************************************************** * toClipboard * Inputs: * CWnd * wnd: Window whose contents are to be sent * to the clipboard * BOOL FullWnd: TRUE for entire window, * FALSE for client area * Result: void * * Effect: * Copies the contents of the client area or the window * to the clipboard in CF_BITMAP format. *****************************************************************/ void WndToClipboard(CWnd * wnd, BOOL FullWnd) { CDC dc; if(FullWnd) { /* full window */ HDC hdc = ::GetWindowDC(wnd->m_hWnd); dc.Attach(hdc); } /* full window */ else { /* client area only */ HDC hdc = ::GetDC(wnd->m_hWnd); dc.Attach(hdc); } /* client area only */ CDC memDC; memDC.CreateCompatibleDC(&dc); CBitmap bm; CRect r; if(FullWnd) wnd->GetWindowRect(&r); else wnd->GetClientRect(&r); CString s; wnd->GetWindowText(s); CSize sz(r.Width(), r.Height()); bm.CreateCompatibleBitmap(&dc, sz.cx, sz.cy); CBitmap * oldbm = memDC.SelectObject(&bm); memDC.BitBlt(0, 0, sz.cx, sz.cy, &dc, 0, 0, SRCCOPY); wnd->GetParent()->OpenClipboard(); ::EmptyClipboard(); ::SetClipboardData(CF_BITMAP, bm.m_hObject); CloseClipboard(); memDC.SelectObject(oldbm); bm.Detach(); // make sure bitmap not deleted with CBitmap object } 补充问题!马上给分 请问一个VC资料哪里有下载的。。。。 关于二维数组的问题? 请教用于UDP连接的socket编程问题,不是很难??? 一个小问题!(在线等待) 急!急!MFC 扩展DLL 导出类在应用程序中该怎么用? createservice函数是怎么回事啊,和createfile之间是什么关系? vc中把int类型转换为自符型的函数是什么??????例如把123-->"123" 高分请教,一个VC的常见问题,up有分 关于默认菜单的问题,请帮助 单步调试无法进入函数内部,请高手指点 关于DirectX9.0里旋转物体,拜谢各路高手
/****************************************************************
* toClipboard
* Inputs:
* CWnd * wnd: Window whose contents are to be sent
* to the clipboard
* BOOL FullWnd: TRUE for entire window,
* FALSE for client area
* Result: void
*
* Effect:
* Copies the contents of the client area or the window
* to the clipboard in CF_BITMAP format.
*****************************************************************/
void WndToClipboard(CWnd * wnd, BOOL FullWnd)
{
CDC dc;
if(FullWnd)
{ /* full window */
HDC hdc = ::GetWindowDC(wnd->m_hWnd);
dc.Attach(hdc);
} /* full window */
else
{ /* client area only */
HDC hdc = ::GetDC(wnd->m_hWnd);
dc.Attach(hdc);
} /* client area only */ CDC memDC;
memDC.CreateCompatibleDC(&dc); CBitmap bm;
CRect r;
if(FullWnd)
wnd->GetWindowRect(&r);
else
wnd->GetClientRect(&r); CString s;
wnd->GetWindowText(s);
CSize sz(r.Width(), r.Height());
bm.CreateCompatibleBitmap(&dc, sz.cx, sz.cy);
CBitmap * oldbm = memDC.SelectObject(&bm);
memDC.BitBlt(0, 0, sz.cx, sz.cy, &dc, 0, 0, SRCCOPY); wnd->GetParent()->OpenClipboard();
::EmptyClipboard();
::SetClipboardData(CF_BITMAP, bm.m_hObject);
CloseClipboard(); memDC.SelectObject(oldbm);
bm.Detach(); // make sure bitmap not deleted with CBitmap object }