关于拦截打印DC并显示在窗口的问题
shada 2007-04-12 10:50:16 我已通过api Hook了打印函数EndPage并取得了基HDC,并生成了一个兼容pdc
但是通过StretchBlt并没有显示在自己进程的窗口上.
void CPreViewDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
int x=pdc->GetDeviceCaps(HORZRES);//x返回值为4000多
int y=pdc->GetDeviceCaps(VERTRES);//y值也是好几k
if(pdc!=NULL)dc.StretchBlt(0,0,200,200,pdc,0,0,x,y,SRCCOPY);
CString s;
s.Format("%d:%d",x,y);
dc.TextOut(0,0,s);
// Do not call CDialog::OnPaint() for painting messages
}