Jump to content
Sign in to follow this  
cheeseslice

can't get control info for foxpro application

Recommended Posts

cheeseslice

Hi,

I am looking for a bit of advice on how to automate an application made with visual foxpro.

The application is a a reporting system that stores test results, at the minute the test results are read from an excel spreadsheet and entered manually. What I am hoping to do is automate the process but I am having a few problems with actually getting the control ids of the buttons or the values from the dropdown boxes in the visual foxpro program.

an example of my problem:

I have a window in the reporting application, it has a text box and 2 drop down lists with 'ok' and 'cancel' buttons.

autoit info will read the title of the window and that is it. In the Control section I can get the classname and instance for the entire window but no id or text for each individual element.

Can anyone suggest a way of getting this information as I am going to need to pick specific values from the drop down lists and compare the textbox value to a value in the spreadsheet.

Thanks

Share this post


Link to post
Share on other sites
PsaltyDS

That means the controls inside the window are being drawn by the app, or "owner drawn". AutoIt is designed to work with the standard Win32/Win64 APIs and can't know how to access controls using other APIs, like FoxPro. If there is a COM interface or DLL calls that work on those forms, you might be in luck, but you'll have to find them. IE is an example where the controls are not drawn by the Win32 APIs, but you can still get to them via a COM interface (as in the IE.au3 UDF).

Otherwise, you can send generic mouseclicks and key strokes with MouseClick() and ControlSend(). ControlSend() in particular will work with "" for the control ID, for example:

ControlSend("[CLASS:FoxProFormClass; TITLE:My FoxPro Form]", "", "", "!n") ; Next

Those ComboBox controls may have hot keys that move focus to them, and then you can usually send the text of the selection to get it to move to that value.

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
mikjay

I just wanted to say thank you for the tip on using ControlSend without a control. I had been using Send() exclusively, and having to change the send delay options to prevent the letters from becoming garbled. Now the keystrokes are so much faster and ControlSend is far more dependable!

Share this post


Link to post
Share on other sites
PsaltyDS

I just wanted to say thank you for the tip on using ControlSend without a control. I had been using Send() exclusively, and having to change the send delay options to prevent the letters from becoming garbled. Now the keystrokes are so much faster and ControlSend is far more dependable!

Glad it helped. ;)

Of course, the credit goes to Jon and the Devs...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.