窗体被另一个窗体覆盖,如何才能抓取该窗体截图?
我的代码,只能截取最上层的窗体。
[code=C/C++][/code]
Graphics::TBitmap *scrBitmap = new Graphics::TBitmap();
scrBitmap->Width = frmMain->Width;
scrBitmap->Height = frmMain->Height;
HDC hdc=GetWindowDC(0);
BitBlt(scrBitmap->Canvas->Handle,0,0,scrBitmap->Width,scrBitmap->Height,hdc,frmMain->Left,frmMain->Top,SRCCOPY);
scrBitmap->SaveToFile("D:\\1.bmp");
delete scrBitmap;
[解决办法]
SendMessage(Form2->Handle,WM_PAINT,(WPARAM)Canvas->Handle,0);
[解决办法]