Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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?

Posted

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.

Posted

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]
Posted

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.

Posted

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.

Posted

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.

Posted

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 ?

Posted

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.

Posted

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)

Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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