Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Automatic Screenshot And Clipboard Reader
kvarnerexpress
post Jan 25 2006, 10:57 PM
Post #1


Super Member
*********

Group: Members
Posts: 407
Joined: 13-December 04
Member No.: 2,696



I am having a problem with a windows console application on an NMR imaging instrument. The software is a console that takes control of the user’s screen. The problem is that the saving of the data we need causes crashes commonly. The program is not open source and specific to the scanner. I cannot replace the computer or change the operating system – it is an instrument used by others too who do not use the same imaging technique that I do. What works is taking screenshots every so many seconds and processing them, although this is a horrible time consuming method. I already have written a converter that reads the part of a BMP which contains data and convert to a workable format and store it in a separate file.

What I think will work is the following:

Automatically make a screenshot just as if the key has been pressed every so many seconds
Access the image in the clipboard (.BMP I suppose, hence the data is accessible easily)
Append to file (I already have the code that will do this)

However, I do not use windows so much and have no idea how to make screenshots from software and access the clipboard other than pressing ctrl-v in the paint program. Can anyone help me out here?
Go to the top of the page
 
+Quote Post
switch
post Jan 29 2006, 05:44 AM
Post #2


Premium Member
********

Group: Members
Posts: 178
Joined: 13-October 04
From: NSW, Australia
Member No.: 1,713



Firstly, it always helps to search the MSDN documentation for stuff like this. You would need to use Windows-specific commands (probably) to access the clipboard and take screenshots.

The way I'd do it is:
1) simulate a PrintScreen keypress (I'm pretty sure you could do this with the SendMessage() Function; send the WM_KEYDOWN Message with VK_SNAPSHOT as a parameter).
If you wanted to find other Key Codes for any other steps, the MSDN library has an article titled 'Virtual-Key Codes' which has every code listed.

2) Use the Clipboard Win32 function/message set (MSDN article here: http://msdn.microsoft.com/library/default....e/clipboard.asp) to retrieve the data.

The MSDN library has info on it all. You can easily find the articles in step 1 by simply searching for furthur reference.

Good Luck mate! biggrin.gif
Go to the top of the page
 
+Quote Post
sharpz
post Feb 17 2006, 05:24 AM
Post #3


Member [Level 1]
****

Group: Members
Posts: 67
Joined: 16-November 05
Member No.: 14,373



There is an API i think in order to get a screenshot of the screen. Check MSDN (http://msdn.microsoft.com) for the specific API and its usage. I wrote something like this a while ago to capture screenshots while playing a game and save them into a file in a directory. It will be a lot easier to create a new file or overwrite the old file instead of appending to it, because you would have to increase the size of the image.
Go to the top of the page
 
+Quote Post
iGuest
post Apr 23 2008, 03:00 PM
Post #4


Trap Double Mocha Member
***************

Group: Members
Posts: 2,360
Joined: 21-September 07
Member No.: 50,369



Replying to kvarnerexpress

I'm not sure if this is exactly what you need, but I've had great success with [url=http://www.16software.Com/autoscreen]AutoScreen[/url]. It allows for saving of the screenshot in many different image formats (including BMP, which you wanted).

I don't think simulating a PrintScreen keypress would be a good idea, because that would cause any data in the clipboard to be lost; this could of course be fixed by saving the data before you send the keypress, and then restoring it, but this could be inefficient, and there's always the possibility of a race condition (user tries to paste something they copied to the clipboard at the exact moment the clipboard data was temporarily replaced with a screenshot after simulating a PrintScreen keypress).

-reply by jjnak
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Anyone Have An Old Copy Of Reader Rabbit?(5)
  2. Making A Rss Reader(8)
  3. Speed Up Acrobat Reader Loading(21)
  4. Security Issue With Ctrl+c/copy On Clipboard(35)
  5. Google Reader(9)
  6. Free Clipboard Manager(2)
  7. Automatic Login(5)
  8. php header() function help needed(4)
  9. One Click Copy And Paste To Clipboard(5)
  10. How To Backup Windows Xp Automatic Update.(4)
  11. How Do You Take A Screenshot?(18)
  12. Foxit Pdf Reader For Windows(9)
  13. World Of Warcraft Question(2)
  14. Google Reader Beta(7)
  15. Adobe Acrobat Reader Issue(7)
  1. Automatic Login Using Curl(1)
  2. My Cd Reader Will Not Read My Cd's(4)
  3. End Of The Internet(14)
  4. Help: Windows Clipboard Extension Needed(3)
  5. Line Rider(23)
  6. Halo 3 Commercial & Screenshot... Also New Maps(8)
  7. Adobe Reader 8.0.0 / 7.0.9 Final(3)
  8. Clipboard Managers(1)
  9. What Is Your Os, And Your Desktop Screenshot Please...?(6)
  10. Lament About Windows' Automatic Updates(1)
  11. An Automatic Smf Forum Creator(5)
  12. Pdf Reader(11)
  13. Pdf Reader?!(5)


 



- Lo-Fi Version Time is now: 26th July 2008 - 08:10 AM