   screenshot grabbing
  ive done the obligatory googles but just a confusing series of sites cant quite find what i am looking for.what I want to be able to do is to write a background program that grabs the screen and saves it to a file.perhaps it is possible to make the computer think you''ve pressed PrtScr button and then do something with the clipboard?I hope and of you have a suggestion. 
  Creating a screenshot is usually done by using GetDesktopWindow() to acquire a handle to the desktop. Then you snag the desktop''s device context and create a compatible device context (usually via a memory bitmap) and BitBlt() to the new device context with SRCCOPY. Once you have the device context filled with the screen data, you can use any number of image saving tutorials to write it to a file. ;  thanks- will this work with games? both opengl and directx?the purpose of all this is a little odd.its a hack that isnt a hack - Theres a game i play (wwii online)- in the top left corner is coordinate information I wish to graphically grab the screen - OCR the coordinates and then send the processed cords to the server.already there is a program that does it - but I just want to reinvent the wheel. ;  go to msdn and look it up!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;  maybe he doesn''t know what to look up.. ;  Well, well. Look who''s calling RTFM... Someone closeness_to_ban++ this clown.OP: isn''t it disrespectful to the people here, willing to help others by taking their time to answer questions, to ask something that has been answered MULTIPLE times already? How about searching this board, instead of treating it as your personal helpdesk? Or taking 60 seconds to come up with a decent google search?Signal to noise ratio on this board is sinking fast - a pity. *sigh* Oh, and I can''t wait for the first smartass to point out that this is OT.</mini rant>--I haven''t tried it, but I imagine the easiest way is as you describe. Use keybd_event or SendInput to fake the keypress. ;  Just a point, a lot of ppl say this sites search doesnt work... but there is no excuse for not using google (though i have been guilty of not using it once or twice...  )and a side note... would you (or I ) REALLY want to use the GDI to get the screen? in a realtime application? im sure theres some other way, theres gotta be (well not really...  boo if theres not)   [edited by - Ademan555 on February 13, 2004 2:22:39 PM];  crikey a fair level of wankerness in this thread i see already!why bother having forums at all? when we''ve got the all-knowing google?and yes, forums such as these can be at times our own personal help desk and discussion area. If you dont like it - then stick to google - dont come here. thank you. ;  People, please don''t be that rude. At least he is not asking for a source code.kindfluffysteve, fortunately, Windows comes with a built-in screen-grabber functionality. Just press PrintScreen, you don''t need any fancy application running in background. Once you press PrintScreen, the screen will be copied to the clipboard. Run MSPaint or other graphic editor programs and paste there. You are done.Press Alt+PrintScreen to capture the active window. ;  Considering google indexes a lot of forums where answers to questions may in actual fact be found I believe that googling is actually dependent on forums to a great extent. Not only because answers are discussed on them but links to pages with the answers are shared around a lot. 