Jump to content

Closing external files?


Recommended Posts

I want to close external file while user xlose my autoit exe. actually i have 2 autoit exe. i want to close both if user exit one of them. tell me how can i do this. i have tried everything like, close file, if than but i dont work ^_^

Link to comment
Share on other sites

  • Developers

I want to close external file while user xlose my autoit exe. actually i have 2 autoit exe. i want to close both if user exit one of them. tell me how can i do this. i have tried everything like, close file, if than but i dont work ^_^

Maybe you can explain what it is you exactly want to do because this doesn't make too much sense to me.

You talk about closing an external file and about 2 autoit3 programs.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This is an example hot to do that. You said you have 2 autoit exe.

The funtion CloseAll is called every time when you script is close.

;~ THIS IS FIRST SCRIPT ("program1.exe")
Opt("OnExitFunc", "CloseAll")
While 1
    Sleep(10)
WEnd

Func CloseAll()
    ProcessClose("program2.exe")
    Exit
EndFunc

;~ THIS IS SECOND SCRIPT ("program2.exe")
Opt("OnExitFunc", "CloseAll")
While 1
    Sleep(10)
WEnd

Func CloseAll()
    ProcessClose("program1.exe")
    Exit
EndFunc

When the words fail... music speaks.

Link to comment
Share on other sites

well i have two autoit files. I manage to open fle perl wen someone opens File "deny"

by using

if ProcessExists("deny.exe")Then

ShellExecute("perl.exe")

But i want to close file "perl" wen someone Closes my file "deny"

Link to comment
Share on other sites

  • Developers

well i have two autoit files. I manage to open fle perl wen someone opens File "deny"

by using

if ProcessExists("deny.exe")Then

ShellExecute("perl.exe")

But i want to close file "perl" wen someone Closes my file "deny"

How would you Deny.exe be closed and why would anybody do that?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...