May 16, 2008

Automatic Screenshot And Clipboard Reader

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming

free web hosting

Automatic Screenshot And Clipboard Reader

kvarnerexpress
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?

 

 

 


Reply

switch
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

 

 

 


Reply

sharpz
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.

Reply

Trap FeedBacker
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. screenshot automatic - 12.24 hr back.
  2. screenshot c bmp code - 31.42 hr back.
  3. screenshot in clipboard - 36.66 hr back.
  4. automatic screenshots - 49.09 hr back.
  5. automate screenshot microsoft - 60.73 hr back.
  6. retrieve clipboard.asp - 62.68 hr back.
  7. msdn clipboard - 82.56 hr back.
Similar Topics

Keywords : automatic screenshot clipboard reader


    Looking for automatic, screenshot, clipboard, reader

Searching Video's for automatic, screenshot, clipboard, reader
advertisement



Automatic Screenshot And Clipboard Reader



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE