C 我自己的打印屏幕键
我们如何用C语言编写一个程序,用其他kry替换“print screen”键来实现相同的功能(即获取整个屏幕的图片)C 我自己的打印屏幕键,c,printscreen,C,Printscreen,我们如何用C语言编写一个程序,用其他kry替换“print screen”键来实现相同的功能(即获取整个屏幕的图片) void dump_buffer() { IDirect3DSurface9* pRenderTarget=NULL; IDirect3DSurface9* pDestTarget=NULL; const char file[] = "Pickture.bmp"; // sanity checks. if (Device == NULL)
void dump_buffer()
{
IDirect3DSurface9* pRenderTarget=NULL;
IDirect3DSurface9* pDestTarget=NULL;
const char file[] = "Pickture.bmp";
// sanity checks.
if (Device == NULL)
return;
// get the render target surface.
HRESULT hr = Device->GetRenderTarget(0, &pRenderTarget);
// get the current adapter display mode.
//hr = pDirect3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&d3ddisplaymode);
// create a destination surface.
hr = Device->CreateOffscreenPlainSurface(DisplayMde.Width,
DisplayMde.Height,
DisplayMde.Format,
D3DPOOL_SYSTEMMEM,
&pDestTarget,
NULL);
//copy the render target to the destination surface.
hr = Device->GetRenderTargetData(pRenderTarget, pDestTarget);
//save its contents to a bitmap file.
hr = D3DXSaveSurfaceToFile(file,
D3DXIFF_BMP,
pDestTarget,
NULL,
NULL);
// clean up.
pRenderTarget->Release();
pDestTarget->Release();
}
他们的you go1)哪个操作系统/哪个GUI/哪个桌面环境?2) 您希望另一个键像printscreen正常工作一样工作,还是希望printscreen键执行它正常工作的其他操作?我想为printscreen创建一个新的默认键,我正在使用windows 8。请提供多一点上下文,而不是转储整个代码块作为答案