Jump to content

What are my options when ControlGetText doesn't work?


Recommended Posts

That's a great idea :o

I read the help file, and took a look at the examples but can't quite figure out how I should use it, ControlGetPos. Any Ideas?

Clicks the Edit1 control 10 x's all at the same time, is that what your trying to achieve?

I just did it to be overdramatic to see if it would work. It didn't.

ACT! is a rather cumbersome database anyway (comparatively speaking)... why did you guys chose that platform rather than the others out there?

I have no freakin' idea! It sucks compared to other databases, and its not even SQL-based!

Thanks again for the help everyone. I am still trying to crack this case.

Link to comment
Share on other sites

I believe he was talking about _ControlGetHandleByPos() that LxP also wrote.

Doh! Sorry about that. Hmm.. another problem. I am getting this error when I try LXP's examples:

ERROR: _ControlGetHandleByPos(): undefined function.

$hControl = _ControlGetHandleByPos("Run", "", 54, 18)

I copied _ControlGetHandleByPos.au3 into these folders to see if it helped.

C:\Program Files\AutoIt3\Include

C:\Program Files\AutoIt3\beta\include

Sorry I don't know enough to answer these questions.

Link to comment
Share on other sites

Doh! Sorry about that. Hmm.. another problem. I am getting this error when I try LXP's examples:

I copied _ControlGetHandleByPos.au3 into these folders to see if it helped.

C:\Program Files\AutoIt3\Include

C:\Program Files\AutoIt3\beta\include

Sorry I don't know enough to answer these questions.

are you explicitly including the copied files that contain that function?

#include<whatever.au3>;at top of code
Link to comment
Share on other sites

  • Moderators

Doh! Sorry about that. Hmm.. another problem. I am getting this error when I try LXP's examples:

I copied _ControlGetHandleByPos.au3 into these folders to see if it helped.

C:\Program Files\AutoIt3\Include

C:\Program Files\AutoIt3\beta\include

Sorry I don't know enough to answer these questions.

Did you #include it?

Top of Script:

#include <_ControlGetHandleByPos.au3>

Edit

:o Sean beat me to it!!

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Did you #include it?

Top of Script:

#include <_ControlGetHandleByPos.au3>

Edit

:o Sean beat me to it!!

Wow that was dumb of me. Thanks

Here is my code/results

#include <_ControlGetHandleByPos.au3>
#include <Process.au3>
Local $hControl

WinActivate("ACT!")
WinWaitActive("ACT!","")
$hControl = _ControlGetHandleByPos("ACT!", "Fake Company", 300, 230)

If @error Then
    MsgBox(48, "_ControlGetHandleByPos() Example", "Something went wrong!")
Else
    ControlSetText("Run", "", $hControl, "This control was found by its position.")
EndIf

I got "Something went wrong!". :geek:

Any ideas?

Link to comment
Share on other sites

  • Moderators

Try removing the 'Fake Company' and just use ""

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Ok, here's the solution....

Uninstall ACT!, and force them to buy a real database :o

It's just hard to help you man... I mean we all want to, but we don't have the tools necessary to recreate what your going through.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Ok, here's the solution....

Uninstall ACT!, and force them to buy a real database :o

It's just hard to help you man... I mean we all want to, but we don't have the tools necessary to recreate what your going through.

quitter. :geek: how sure are you of the coordinates you're passing to the function?
Link to comment
Share on other sites

  • Moderators

quitter. :geek: how sure are you of the coordinates you're passing to the function?

Quitter?... Errr... I'm not gonna go there, was gonna hit below the belt !! :o

But that is a good point: Checking maybe the Opt('MouseCoordMode', 'number in correspondence to autoinfo')

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Ok, here's the solution....

Uninstall ACT!, and force them to buy a real database :o

quitter. :geek: how sure are you of the coordinates you're passing to the function?

Ha! I think you are both correct! I wish we had a new database! How sure of the coordinates? Hmm, well I assume they are correct, in that, if I use:

MouseClick("left", 300, 230)

It clicks in the Company field, which is correct. Is it possible that MouseClick("left", 300, 230) and _ControlGetHandleByPos("ACT!", "", 300, 230) are not the same?

Link to comment
Share on other sites

How sure of the coordinates? Hmm, well I assume they are correct, in that, if I use:

MouseClick("left", 300, 230)

It clicks in the Company field, which is correct. Is it possible that MouseClick("left", 300, 230) and _ControlGetHandleByPos("ACT!", "", 300, 230) are not the same?

Quite possible. If my memory serves correctly, _ControlGetHandleByPos() requires that you pass the top-left position of the control. I wonder if this information is available via AutoIt Window Info?

If not, then it shouldn't be hard to write a small script to display the positions/sizes of all controls on a window.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...