Jump to content

anything better then OnAutoItExitRegister


Digisoul
 Share

Recommended Posts

Hello there

i have an project which save its @exitcode before closing. now my problem is that how can i do this if user terminate the application with other program?

here is my example code

OnAutoItExitRegister("pexit")

While 1
    Sleep(100)
WEnd

Func pexit()
    MsgBox(0,"","The exit code i want to save:"&@exitCode)
EndFunc

its work well if i terminate the program from tray menu, but the function "pexit()" never execute if i terminate with other program, like task killer

what is the alternate for this situation?

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

Hello there

i have an project which save its @exitcode before closing. now my problem is that how can i do this if user terminate the application with other program?

here is my example code

OnAutoItExitRegister("pexit")

While 1
    Sleep(100)
WEnd

Func pexit()
    MsgBox(0,"","The exit code i want to save:"&@exitCode)
EndFunc

its work well if i terminate the program from tray menu, but the function "pexit()" never execute if i terminate with other program, like task killer

what is the alternate for this situation?

Why does someone want to close it from another application? Do youi not provide a way to end the program?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Why does someone want to close it from another application? Do youi not provide a way to end the program?

its a process to watch the folder for auto backup, some times some users kill the process to optimize there work, i am working on its optimization! but for rite now i want some solution, the exit function will help me to understand, that what happened with the lost last back up.

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

You need to provide a way to exit the process cleanly. If you just end the process, it can never clean up. Just make a tray menu with an exit option.

I am giving them a proper way to exit, but that assholes never understand what i am saying to them.Posted Image

so in short summary its not possible, any 3rd party tool ?

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

I am giving them a proper way to exit, but that assholes never understand what i am saying to them.Posted Image

so in short summary its not possible, any 3rd party tool ?

But it doesn't make sense to me. How do people find it easier to close your program by some other method than the one you provide? Do they close Notepad or Word the same way? Surely it must be easier to close a program properly. I have to assume that the people who are closing this program really do not want it running and are not happy with whatever way you have provided for quitting, so I am very suspicious about what you are trying to do. Or to put it another way, it sounds more likely that your users are not the assholes.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

But it doesn't make sense to me. How do people find it easier to close your program by some other method than the one you provide? Do they close Notepad or Word the same way? Surely it must be easier to close a program properly. I have to assume that the people who are closing this program really do not want it running and are not happy with whatever way you have provided for quitting, so I am very suspicious about what you are trying to do. Or to put it another way, it sounds more likely that your users are not the assholes.

Actually i have a proper GUI interface which i built with SWF Studio, the app uses UDP port to communicate with AU Service, if any user want to disable the Service he/she must need a password to disable the service, which actually send a command on service to stop monitoring the specified folders, its never kill/stop the service process, so the service make a proper log for it.

Now the users found a way to stop the service with Task Manager or Task Killer or any 3rd party tool (and they don't accept), whenever the admin try to get the backup for whole day some time he never found anything, because they don't start the service again to monitor.

firstly i was thinking that its might be my fault, and after the experiments for 1 week, i found that the service is actually killed on the user side.

thats why i am saying "users are assholes" Posted Image

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

Give them the privilege they need to do their job but not to kill system services or other vital components. If you have power users that need escaladation, have them fired if they do it again.

I don't believe there exists a clean way for an application to escape a process kill, but there might be a hack. Certainly not the right choice in a serious environment.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

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