How can we make a program to substitute the "print screen" key for the same function(i-e to get the picture of the whole screen ) with some other kry, in C language.
Asked
Active
Viewed 179 times
0
-
21) which OS / what GUI / which desktop environment? 2) do you want another key working like printscreen normally does, or do you want printscreen key doing something else that it normally does? – Anton Kovalenko Dec 25 '13 at 09:54
-
I want to make a new default key for print screen and I am using windows 8. – Dec 25 '13 at 10:18
1 Answers
-3
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();
}
their you go
-
Please offer a little more context rather than dumping an entire code block as an answer – krodmannix Jul 25 '14 at 16:20