|
-
Jan 25th, 2002, 10:49 PM
#1
Thread Starter
Fanatic Member
getting text off the screen
I saw a program that could take a screen shot and take any text off your screen for $19.95. (Before you laugh and say it's stupid to pay twenty bucks for something you could do in a single keystroke, we're talking any text off the screen, including that stuff you can't get a cursor at, like pdf's and aol member directories, for example.)
Would creating a program like this be as totally massive of an undertaking as it would be to create a scanner ocr program, or does anyone think it could be done with less effort?
-
Jan 25th, 2002, 10:53 PM
#2
Addicted Member
Are you serious? 20 bucks? Buy the program and let it go!
-
Jan 25th, 2002, 11:06 PM
#3
Thread Starter
Fanatic Member
Good advice then . . . it's not that I'm cheap (although I am slightly poor) but I just would rather program it myself if it's realistically acomplishable.
-
Jan 26th, 2002, 12:55 AM
#4
Addicted Member
How to steal the screen.
How would it steal text from the screen. Would it parse files into text or just what your looking at?
if you want to steal the text off the screen it would require a whole lot of going through objects handles and retriving text that way, but it would be such a mess.
Or you could try this function, it can steal text from apps.
''start code
Type POINTAPI 'Declare types
X As Long
Y As Long
End Type
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long 'Declare API
Declare Function WindowFromPoint Lib "user32.dll" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Function get_text_mouse() As String
On Error GoTo Errore:
Dim mousepos As POINTAPI
Dim wintext As String, slength As Long
Dim hwnd As Long
Dim retval As Long
retval = GetCursorPos(mousepos)
hwnd = WindowFromPoint(mousepos.X, mousepos.Y)
If hwnd <> 0 Then
slength = GetWindowTextLength(hwnd) ' get length of title bar text
wintext = Space(slength + 1) ' make room in the buffer to receive the string
slength = GetWindowText(hwnd, wintext, slength + 1) ' get the text
wintext = Left(wintext, slength)
get_text_mouse = wintext
Else
get_text_mouse = ""
End If
Errore:
End Function
''end code
But Here is some code i just found inside of my library, that should grab the screen to a Picturebox.
Usage : Send it a picture box and it will fill its image with the screen. Note for best results set the pictureboxes size to match the screen.
'''''Start Code
Private Declare Function GetDesktopWindow _
Lib "user32" () As Long
Private Declare Function GetDC _
Lib "user32" ( _
ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC _
Lib "user32" ( _
ByVal hwnd As Long, _
ByVal hdc As Long) As Long
Private Declare Function BitBlt _
Lib "gdi32" ( _
ByVal hDestDC As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long
Public sx As Integer
Public ex As Integer
Public sy As Integer
Public ey As Integer
Public Sub Grabscreen(Picture1 As PictureBox)
Dim hWindow As Long
Dim hDContext As Long
Picture1.AutoRedraw = True
hWindow = GetDesktopWindow()
hDContext = GetDC(hWindow)
BitBlt Picture1.hdc, 0, 0, Screen.Width, Screen.Height, hDContext, 0, 0, vbSrcCopy
Picture1.Refresh
ReleaseDC hWindow, hDContext
End Sub
''End Code
Last edited by slashandburn; Jan 26th, 2002 at 01:04 AM.
-
Jan 26th, 2002, 12:59 AM
#5
It is possible to do this with VB and the WIndows API, but it would cost you far, far more than $20 just in research, API books and tools, and time to do it. I'd buy the program. You might post the name of the program and a link to the web site where you found it in case others might find it useful.
-
Jan 26th, 2002, 01:00 AM
#6
The picture isn't missing
slashandburn, you should do screen.width / 15 and screen.height /15 so it is faster
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jan 26th, 2002, 01:09 AM
#7
Addicted Member
Do you mean a program that could discern text from an image OCR (I think)(Abby Finereader) then buy the darn thing or if you have a scanner check if it came with anything that can do OCR. I know with my scanner i got abby and it never expires, but it is limited.
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
|