Sign in to follow this  
Followers 0
zxcvbnm

close atuoit application

31 posts in this topic

I have an autoit application (.exe) resident on a pc (local), this application is called by a program. at the and of the program I need to close this autoit application.

So I hooked two autoit application, one at the beginnig and one at the and of the program.

I've no problem to launch autoit application at the beginning, but no positive responce about closing application

I try with

WinClose("Count Down")

cause the autoit application contains a timer and in this way I'am sure to kill it

Count Down is the name of the GUI of the first autoit application

It seems that local pc doesn't find it, if I exec ("Count Down") with double click it runs ok.

Any ideas?

Thanks

Share this post


Link to post
Share on other sites



At the end the program closes itself automatically.

If it doesnt close then it most likely doesnt finish or get in an infinite loop whithout exit.

Share this post


Link to post
Share on other sites

The program and the autoit application are indipendent.

Program launch autoit app but doesn't know autoit app.

Can I close autoit app looking in win32process?

Share this post


Link to post
Share on other sites

I try with this code posted from AdnyS01

Local $hWnd, $title = $sCurrentTitle ; ($sCurrentTitle is defined elsewhere)  IF (WinActivate($title, "") <> 0) Then    $hWnd = WinGetHandle($title, "")    IF (IsHWnd($hWnd)) Then      IF (NOT WinClose($hWnd)) Then WinKill($hWnd)            IF (WinActivate($title, "") <> 0) Then        MsgBox(0, "ERROR", "Cannot kill window")      Else        MsgBox(0, "INFO", "Killed other window")      EndIF    Else      MsgBox(0, "ERROR", "Cannot get win handle")    EndIF  EndIF

It seems that we can recognise the first autoit application.

Share this post


Link to post
Share on other sites

You dont get it. The auotoit app will close automatically when it finishes.

You dont need to close it.

Share this post


Link to post
Share on other sites

Hello zxcvbnm,

If you use Run() to run the app it returns the PID. You could use the PID to run a ProcessClose().

Regards,

Hannes

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

I need to close it because it countinues to go! It's a timer connected to the program that calls it.

So when the program ends I need to close it.

Share this post


Link to post
Share on other sites

Find it in the taskmanager and do for example "Notepad" :

ProcessClose("notepad.exe")

Share this post


Link to post
Share on other sites

Thanks Hannes, I don't use Run()

Can I introduse it in my timer?

Share this post


Link to post
Share on other sites

You have 2 programs right ? Lets call them "Main.exe" and "timer.exe" .

So you want at the end of main.exe to close timer.exe , right?

Just put :

ProcessClose("timer.exe")

At the end of Main.exe and recompile it and that is all.

Share this post


Link to post
Share on other sites

I have one program (auoit indipendent), and two autoit application (first and second)

first is a timer, second must be close it

I can hook first at the beginning of the program, and it runs ok

I need to close timer and the and of the program so I need to exec second autoit app at the and of the program

but I can't close first autoit app with the second also using ProcessClose, I don't know why!

ProcessClose("timer.exe") runs ok if I use double click on .exe, but called by a programs it doesn't run ok.

Share this post


Link to post
Share on other sites

Then it has to be something by the way the master program call it.

What is the master program and how do you call the autoit exe files ?

Share this post


Link to post
Share on other sites

master program is a telephone client that open a pop up to manage phone calls

it exec without problems the launch of the timer at the beginning of the calls,

but at the end it has to close the timer.

I named ProcessClose("timer.exe") : close.exe

It seems that don't recognise the name of the process.

Share this post


Link to post
Share on other sites

When you have the timer running and open Task manager and go to processes , do you find "timer.exe" somewhere under the "image name" column?

(This is for XP for Vista and 7 it may vary a bit)

Share this post


Link to post
Share on other sites

yes I find it! (image column)

infact if use .exe app to close timer with double click it runs ok.

Share this post


Link to post
Share on other sites

timer.exe is perhaps running under another account which is inherited from the telephone application. A possible method to handle timer.exe to exit by itself is to have it look for a flag i.e. an existence of a certain filename or a registry value that when timer.exe sees it, then it will close itself.

Share this post


Link to post
Share on other sites

I'mlooking for any possible solution, but what can I do in this way? Which flag?

Share this post


Link to post
Share on other sites

In the Task manager it would also say which user account it runs on.

Check it. Also if there are multiple instances of timer.exe running.

Processclose will only close one instance.

Share this post


Link to post
Share on other sites
only one istance, local user

Share this post


Link to post
Share on other sites

What OS do you have? Is the Phone application running on local user too ?

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