Sign in to follow this  
Followers 0
pjreagan

AccountEdge not responding properly?

3 posts in this topic

I'm new to AutoIt. It looks very promising for my simple task but I'm getting unexpected results when trying to interact with AccountEdge Pro 2012 using Win7 64. Probably I'm doing something wrong. From my user's perspective I want the script to activate the AccountEdge file and trigger an import.

Problem 1: there seems to be no way for AutoIt to restore AccountEdge if the user has manually minimized that window. WinGetState() claims the window is visible but it is not. All attempts to correct this with WinSetState() function fail. (That function actually deactivates the window - which is confusing.) What else can I try?

Problem 2: if not manually minimized, AutoIt reports that the AccountEdge window is active but the menus are greyed out and the Send() function has no effect. This even though it returns a successful "1". I've tried referencing the window class name but that doesn't seem to help. The script fails to find the window entirely if the MYOBChildClass is referenced. Is there some other way to reference the window that I could try?

It seems like AutoIt "sort of" interacts with AccountEdge but not in any useful way. Does AccountEdge just not play nice with AutoIt? Thanks in advance for any suggestions.

Here's my test code...

Opt ("WinTitleMatchMode", 2)

$handle = WinGetHandle ("AccountEdge", ""); ...

;~ Opt ("WinTitleMatchMode", 4)

;~ $handle = "classname=MYOBFrameClass"

;~ $handle = "classname=MYOBChildClass"

$result = WinGetState ($handle)

MsgBox(64, "Starting State...", " " & $result, 2)

If Not BitAND ($result, 8) Then

; ACTIVATE window...

$result = WinActivate($handle)

$result = WinGetState ($handle)

MsgBox(64, "State after Activate...", " " & $result, 2)

EndIf

If Not BitAND ($result, 32) Then

; AccountEdge MANUALLY MINIMIZED BY USER

; ATTEMPT TO MAKE WINDOW VISIBLE...

$result = WinSetState ($handle, "", @SW_MAXIMIZE)

;~ $result = WinSetState ($handle, "", @SW_RESTORE)

;~ $result = WinSetState ($handle, "", @SW_SHOW)

;~ $result = WinSetState ($handle, "", @SW_SHOWNORMAL)

;~ $result = WinSetState ($handle, "", @SW_SHOWDEFAULT)

;~ $result = WinSetState ($handle, "", @SW_SHOWMAXIMIZED)

;~ $result = WinSetState ($handle, "", @SW_SHOWMINNOACTIVE)

;~ $result = WinSetState ($handle, "", @SW_SHOWNA)

;~ $result = WinSetState ($handle, "", @SW_SHOWNOACTIVATE)

;~ $result = WinSetState ($handle, "", @SW_SHOWNORMAL)

$result = WinGetState ($handle)

MsgBox(64, "Is it visible?", " " & $result, 2)

EndIf

; TRY A SIMPLE INTERACTION WITH AccountEdge MENUS...

$result = Send ("{ALTDOWN}f{ALTUP}p")

;~ Local $result = WinMenuSelectItem ($handle "&File", "&Print")

;~ Local $result = Send ("!fp")

MsgBox(64, "Send Result:", " " & $result, 2)

Share this post


Link to post
Share on other sites



Hmm... no ideas yet.

So nobody has run into a situation where an application doesn't respond to AutoIt?

Share this post


Link to post
Share on other sites

It turns out to be a privilege issue! Thanks to dieweb and tms at...

http://www.ownedcore.com/forums/star-wars-old-republic/swtor-bots-programs/339152-autoit-can-not-click-swtor-window.html

...for the lead.

After compiling the script, it can be run as administrator on this Win7 machine. It comes up with a warning but now the AutoIt functions seem to work.

Also: Turning of the Win7 UAC now seems to keep the warning from coming up and the compiled exe does not need to be run as administrator.

So far so good!

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  
Followers 0