Jump to content
Sign in to follow this  
anybastard

Inactive windows

Recommended Posts

anybastard

Hi Guys ,

this is a my first post on this forum .

I need your help about a little problem with autoit script :

My question is this

I want run a program without user interactions , all work fine is my windows program is active but if my windows program is inactive my script doesn't work

Below my last script

$program = "C:\Program Files\my_program.exe"

run ($program)

Sleep (5000)

if WinExists ("[CLASS:TForm3]") then

ControlSend ("[CLASS:TForm3]","","",("!f"))

ControlSend ("[CLASS:TForm3]","","","{DOWN} {DOWN} {DOWN} {ENTER}")

EndIf

Sleep (5000)

if WinExists ("[CLASS:TFormSeekTest]") then

ControlSend ("[CLASS:TFormSeekTest]","","","{TAB}{DOWN} {DOWN} ")

ControlSend ("[CLASS:TFormSeekTest]","","","{TAB}")

EndIf

What are my mistake ??

Please , could you help me ???

Thank a lot

AnyB

Share this post


Link to post
Share on other sites
omikron48

Do a WinActivate before you do ControlSend(s). In some cases, applications don't respond well unless they are the active window.

Share this post


Link to post
Share on other sites
anybastard

Hi ,

first , thank for your prompt answer

Yes , now all works fine !!!

Thanks again

Best Regards

AnyB.

Share this post


Link to post
Share on other sites
anybastard

AnyB.

Edited by anybastard

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  

×