Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Coder's Corner Lounge (http://www.programmingforums.org/forum11.html)
-   -   Where does print screen keep the picture? (http://www.programmingforums.org/showthread.php?t=5708)

Sane Sep 2nd, 2005 3:05 PM

Where does print screen keep the picture?
 
If I call print screen with the win32api, where can I find the picture file? Somewhere in the temp folder or the clipboard, how can I access the clipboard? If it's not stored as a picture is there a way I can do so instantly?

DaWei Sep 2nd, 2005 3:54 PM

The Windows clipboard. Investigating that will fix you right up. Some applications will store data there in more than one format. An example would be an image in bitmap OR vector graphic format. Another would be text in Word or pure text format. I don't know if you are looking to deal with this programmatically, or just usefully. I presume programmatically, because of the mention of the Win API. From a strictly useful viewpoint, I can, for instance, use ALT-PrtScrn to copy the window with the focus to the clip board, hop into Paintshop Pro, or similar, and paste it as a new image. I hope this helps. If not, post back.

B3TA_SCR1PT3R Sep 2nd, 2005 4:00 PM

Quote:

Originally Posted by Sane
If I call print screen with the win32api, where can I find the picture file? Somewhere in the temp folder or the clipboard, how can I access the clipboard? If it's not stored as a picture is there a way I can do so instantly?

C:\WINDOWS\clipbrd.exe

Sane Sep 2nd, 2005 4:00 PM

Yep, I'm aware of the ability to paste back the previously printed screen, but as you assumed, I wish to do this programmatically. So is this clipboard a defined place? Or is it just unaccessable RAM?

EDIT: Beta_scripter, it says my computer doesn't have that file... :rolleyes:

big_k105 Sep 2nd, 2005 4:12 PM

I know VB has a way to paste items that have been copied so Im sure that it is quite possible. What language are you using?

Cerulean Sep 2nd, 2005 5:05 PM

I don't think the language matters as it's a straight WinAPI question.

big_k105 Sep 2nd, 2005 7:03 PM

yeah I know but I thought i would ask and see if it was Vb cause if so then its really easy. If not then I dont know how to get it but Im pretty sure it is just a winapi tho so just look it up on google and im sure it will pop up right away. and there is always the MSDN liberary :)

arod199113 Sep 2nd, 2005 10:21 PM

Quote:

Originally Posted by B3TA_SCR1PT3R
C:\WINDOWS\clipbrd.exe

C:\WINDOWS\system32\clipbrd.exe

Sane Sep 2nd, 2005 10:34 PM

Well it's Python with the win32api import. But I don't know what to search for in the win32api docs to save from clipboard to image. :confused:

Pasting with the win32api is easy though, you just use keybd_event.

lostcauz Sep 3rd, 2005 12:18 AM

Check out OpenClipboard, SetClipboardData and GetClipboardData along with the clipboard format CF_BITMAP.

For example, in masm

invoke OpenClipboard,hWnd
invoke SetClipboardData,CF_BITMAP,hBmp1

The clipboard now contains the pic hBmp1.


All times are GMT -5. The time now is 5:35 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC