there will be a button on your laptop keypad (prt sc)... if it is in a box press the function key(fn) and then press that key(prt sc).... then got to paint and paste it using ctrl+v..
dear Moschops there is problem in your code at GetDIBits(hdc,h,0,bmpInfo.bmiHeader.biHeight,pBuf, &bmpInfo, DIB_RGB_COLORS);
error is undefined GetDiBits@28. please help me to solve it.
You don't mention if you're targetting Windows or some other o/s
In the Windows case, it's harder work to save the data than capture it (that's just a case of getting hold of the desktop window, creating a compatible bitmap, and a BitBlt). Gdi+ provides much better facilities for format conversion, so I'd recommend it over regular GDI in this case (out of interest I once coded the same thing long hand in GDI and it's rather longer than the GDI equiv)
The following example code is from an application that captures an image of the entire desktop, scales it down to the current window size and then saves it to a file.
This sample saves the image as a bitmap (.bmp) file. But: