This is not just Xbase problem, but I want know, if is possible read info from screen ?
I have some utility (i mean in C,C++) ,that have user window, and on this is some info. Utility do not generate any report.
I need use this info for my application.
Reading info pixel by pixel wil be very complicated, also do not know, where will be windows positioning.
Good way will be run this utility but redirect output not to screen, but to file, where will be easyer analyze it.
Scan info from screen
Re: Scan info from screen
Code: Select all
oWindow := AppDeskTop()
oScreenDump := GraSaveScreen( oWindow, {0,0}, o:Window:currentSize() )
oScreenDump:saveFile( 'screendump.jpg', XBPBMP_FORMAT_JPG )
The eXpress train is coming - and it has more cars.
Re: Scan info from screen
Thank you Roger !
I must try it. So analyzing image will be more complicated because screen resolution...
if no other option I must work on it.
I must try it. So analyzing image will be more complicated because screen resolution...
if no other option I must work on it.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Scan info from screen
I use a similar technique in my program, using the code from the 1.9 documents. You it to print out the current window, not necessarily the application window, to a printer. I could just as easy save to a file. It does not require any special considerations for screen resolution. I did not compare my code to Roger's example, but it looks similar.
Re: Scan info from screen
depends on Windows Control / Part if you get Result with WM_GETTEXTVictorio wrote:This is not just Xbase problem, but I want know, if is possible read info from screen ?
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
first you need Handle of Windows , next Handle of Control inside ( e.g. "edit" = SLE )
Code: Select all
LOCAL nTextLen:=512
LOCAL Buffer:=Space(nTextLen)+Chr(0)
LOCAL nWin
LOCAL nHandle
LOCAL nDLL := DllLoad("User32.dll")
// API "FindWindowA" ( Dialog - Titlebar )
nWin:= DllCall(nDLL, DLL_STDCALL, "FindWindowA", "#32770"+ Chr(0), "FRITZ!fax - send by Xbase++" + Chr(0))
// API "FindWindowExA" ( Edit-Control inside )
nHandle := DllCall(nDLL, DLL_STDCALL, "FindWindowExA", nWin, 0,"edit"+Chr(0),nil)
// "read" from Edit-Control
DllCall(nDll,DLL_STDCALL,"SendMessageA", nHandle, WM_GETTEXT, nTextLen, @Buffer)
// "write" to Edit Control
DllCall(nDll,DLL_STDCALL,"SendMessageA", nHandle, WM_SETTEXT, LEN(cFaxNo),cFaxNo )
http://www.dennisbabkin.com/winid/
greetings by OHR
Jimmy
Jimmy