INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Delphi Berlin 10.1 Update 1 / Screen Scraping

Delphi Berlin 10.1 Update 1 / Screen Scraping

(OP)
Has anyone done any development in regard to screen scraping?

For example, let's say a form on the screen (not Delphi, but a Java applet) has several checkboxes. I would need to verify which are checked or not and update user data accordingly.

Thank you for your response in advance.


// ResonantEcho

RE: Delphi Berlin 10.1 Update 1 / Screen Scraping

How far along are you? My first suggestion would be this: Are you able to locate the form in question within the system itself? That's the first step.

RE: Delphi Berlin 10.1 Update 1 / Screen Scraping

(OP)
Hi Glenn,

Yes. The application does identify forms by caption and enters information on said forms (emulating keyboard input). I've created classes for each form that I'm currently working with. Each class contains properties for that form (what data can be entered on that form). Also, methods to launch the form via hot keys (CTRL-S, CTRL-E, etc.). Likewise, methods to enter data on the form.

Since some of the properties and methods are similar, I have created a TDialog class which I inherit. It has properties such as IsActive, Caption, Description, etc.






// ResonantEcho

RE: Delphi Berlin 10.1 Update 1 / Screen Scraping

That really wasn't what I asked. More or less, controls are sub-windows of forms. So the task becomes finding the window handle of the form in the system you're interested in, then looking at the sub-windows to locate check boxes, and then sending messages to query their state.

It sounds like you should be able to handle this well, given what you already claim is being done.

RE: Delphi Berlin 10.1 Update 1 / Screen Scraping

(OP)
Hi Glenn,

You asked how far along was I and if I was able to locate the form in question. I did answer both of those questions....I thought. :D With additional detail.

While I am able to load a form via a HOTKEY, verify it indeed exists (via caption), grab its window handle, make sure it has focus and is in the foreground, I am not identifying each individual control on the form. Up until now I didn't have a need to do that.

Because I know what is on the forms I'm currently working with, I simply enter data in the first control, tab to the next control, enter data in it, etc. Very simple. However, now I'm wanting to go a step further and analyze check boxes on a form to verify if they are checked/unchecked. Or grab text that is in a control to determine what step needs to be taken next. That's where I need help.

Thanks for responding.


// ResonantEcho

RE: Delphi Berlin 10.1 Update 1 / Screen Scraping

(OP)
Never mind. I figured it out. You got me to thinking, Glenn. ;)

Since I already have the handle for the window, I then can use "EnumChildWindows" to get the handle to the checkbox. Then do:

CODE -->

if SendMessage(hWndForCheckBoxControl, BM_GETCHECK, 0, 0) = BST_CHECKED then
begin
  ShowMessage('Checkbox is checked.');
  
  // do checked process here
end
else
begin
  ShowMessage('Checkbox is not checked.');

  // do not checked process here
end; 

There may be a better way, but I'll look into that tomorrow.


// ResonantEcho

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close