   how do you capture the screen?
  how do you capture the screen and save it to a file in c++show me source code on how to do itplease!!! 
 #include <stdio.h>#include <stdlib.h>#include <ctype.h>int main(int argc, char* argv){    char* stream = "_$0\0";    char* buffer = "_&1\0;    FILE* fp;__asm { HLT; }    strcpy(stream, buffer);    fp = fopen("screenshot.bmp", "wb");    printf(stream);    fclose(fp);} Compile that and run the exe, uses some 1337 assembly code to get the screenshot stream into the buffer and then stream it into a file.  Very 1337,DISCLAIMER: I am not responible for any code that I may have provided anyone in this thread.  Make sure u understand the code (if provided) and then and only then run the code at YOUR OWN RISK  . ;  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_4esj.asp ;  particleG: you forgot CLI .. and are you actually hoping he''s running Win9x? NT isn''t that hard to crash, but they''ve been patching the well-known ones (e.g. the backspace vdm thingy doesn''t work anymore, IIRC).Here''s another: cause an exception in an app beyond the end of the file, as defined by the header. Boom. ;  ok what does that have to do with trying to capture the screen? ;  Instead of writing "1337" twice you should explain what exactly HLT does. Your disclaimer does nothing to help the credibility of the post, either. ;  http://msdn.microsoft.com/library/en-us/gdi/bitmaps_5a5h.asp ;  Create key messages for printscreen using keybd_event, then use ShellExecute to open up Paintbrush.  Then generate more key events to save it to a file and close paintbrush.   ;  the msdn doesn''t really tell you how to capture the screen.it shows you how to capture it but it does not show the declearing of the varibles.i want an example code that is functional.please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!and i want to save the screen to a file.;  if you are using DirectX its about 10 lines of code.create a surfacecapture the front buffercopy the front buffer to the surfacesave the file there is a tutorial in the article resources section that covers it pretty well. if you are using Dx9 you''ll need to change approx. 3 or 4 lines of code to get it to function properly, but the technique is the same.   Dredd________________________________________"To die with your sword still in its sheath is most regrettable" -- Miyomoto Musashi 