Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 2nd, 2005, 3:05 PM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
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?
Sane is offline   Reply With Quote
Old Sep 2nd, 2005, 3:54 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Sep 2nd, 2005, 4:00 PM   #3
B3TA_SCR1PT3R
Hobbyist Programmer
 
B3TA_SCR1PT3R's Avatar
 
Join Date: Jul 2005
Location: Dallas, Texas
Posts: 101
Rep Power: 0 B3TA_SCR1PT3R is an unknown quantity at this point
Send a message via AIM to B3TA_SCR1PT3R
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
__________________
Hoes telling me to calm down but I'm like fuck that shit!
B3TA_SCR1PT3R is offline   Reply With Quote
Old Sep 2nd, 2005, 4:00 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
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...
Sane is offline   Reply With Quote
Old Sep 2nd, 2005, 4:12 PM   #5
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,623
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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?
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Sep 2nd, 2005, 5:05 PM   #6
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
I don't think the language matters as it's a straight WinAPI question.
Cerulean is offline   Reply With Quote
Old Sep 2nd, 2005, 7:03 PM   #7
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,623
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Sep 2nd, 2005, 10:21 PM   #8
arod199113
Programmer
 
arod199113's Avatar
 
Join Date: Feb 2005
Posts: 86
Rep Power: 0 arod199113 is an unknown quantity at this point
Quote:
Originally Posted by B3TA_SCR1PT3R
C:\WINDOWS\clipbrd.exe
C:\WINDOWS\system32\clipbrd.exe
arod199113 is offline   Reply With Quote
Old Sep 2nd, 2005, 10:34 PM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
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.

Pasting with the win32api is easy though, you just use keybd_event.
Sane is offline   Reply With Quote
Old Sep 3rd, 2005, 12:18 AM   #10
lostcauz
Hobbyist Programmer
 
Join Date: Nov 2004
Location: 1691 miles East of L.A.
Posts: 159
Rep Power: 4 lostcauz is on a distinguished road
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.
__________________
-- lostcauz

Stepped in what?...
Behind whose barn?...
I didn't even know they had a cow!
lostcauz is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:47 PM.

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