-
December 16th, 2008, 10:36 AM
#1
screengrap of desktop
Hi
I use a java applet which displays live stockmarket information, and I want to be able to analyse those prices in a C++ program.
Rather than trying to decompile that applet I think that an easier solution will be to make screen grabs of the desktop and perform a really simple optical character recognition on the resulting bitmap.
My problem is that I do not know how to perform the screen grabs. After some googling it seems that I need to use the function GetDesktopWindow() and the data type HBITMAP, but I'm non the wiser on how to put this together. If I do manage to make a succsessful screen grap to a HBITMAP I will then need to know how HBITMAP stores the image so that I can access the pixels and perform my OCR.
If it is possible I just want to write a consol application as this is all I'm familiar with, I have virtually no experience with visual programs.
Thanks in advance for your help
Paul
-
December 16th, 2008, 03:38 PM
#2
Re: screengrap of desktop
On Windows XP and later OS, you can use PrintWindow().
For previous operating systems you have to get the desktop window handle, get it's device context, create a compatible DC, create a compatible bitmap, copy from the original DC to the memory DC.
-
December 16th, 2008, 05:08 PM
#3
Re: screengrap of desktop
I'm using XP, so I guess PrintWindow() would fit the bill
Few of questions
1) What headers do I need to include to use it?
2) Can it be used from a nonvisual / console application
3) What data type does it return or take as arguments
If you have a reference to an example where it is used, that would be great.
Cheers
-
December 17th, 2008, 11:02 AM
#4
Re: screengrap of desktop
-
December 17th, 2008, 11:24 AM
#5
Re: screengrap of desktop
I think that an easier solution will be to make screen grabs of the desktop and perform a really simple optical character recognition
I think it's much easier to locate the window that contains the applet and copy it's text.
-
December 17th, 2008, 12:18 PM
#6
Re: screengrap of desktop
Originally Posted by pernest
I'm using XP, so I guess PrintWindow() would fit the bill
Few of questions
1) What headers do I need to include to use it?
2) Can it be used from a nonvisual / console application
3) What data type does it return or take as arguments
If you have a reference to an example where it is used, that would be great.
Cheers
MSND? http://msdn.microsoft.com/en-us/library/ms535695.aspx
-
December 17th, 2008, 04:20 PM
#7
Re: screengrap of desktop
Originally Posted by pernest
Hi
I use a java applet which displays live stockmarket information, and I want to be able to analyse those prices in a C++ program.
Rather than trying to decompile that applet I think that an easier solution will be to make screen grabs of the desktop and perform a really simple optical character recognition on the resulting bitmap.
My problem is that I do not know how to perform the screen grabs. After some googling it seems that I need to use the function GetDesktopWindow() and the data type HBITMAP, but I'm non the wiser on how to put this together. If I do manage to make a succsessful screen grap to a HBITMAP I will then need to know how HBITMAP stores the image so that I can access the pixels and perform my OCR.
If it is possible I just want to write a consol application as this is all I'm familiar with, I have virtually no experience with visual programs.
Thanks in advance for your help
Paul
This article might help.
Before using OCR did you try Microsoft Accessibly? You can check with AccExploer.exe to see if it sees the text.
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|