compact21 Posted August 30, 2014 Share Posted August 30, 2014 Hello, i tryed to make a pop-up message appear when closing an autoit app with task manager, the following wont work: OnAutoItExitRegister("msg") while 1 sleep(100) WEnd Func msg() MsgBox(Default, Default, "Are you sure you want to close this application?") EndFunc Is there a way to solve this? Thanks Link to comment Share on other sites More sharing options...
mikell Posted August 30, 2014 Share Posted August 30, 2014 (edited) No, because doing this you don't exit the process, you kill it Edited August 30, 2014 by mikell Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 31, 2014 Moderators Share Posted August 31, 2014 compact21 can you please explain more about what you're trying to accomplish? As mikell explains, by killing the process you are never going to process the OnAutoItExitRegister command. Are you simply looking to be notified if your script stops unexpectedly? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
compact21 Posted August 31, 2014 Author Share Posted August 31, 2014 Hei guys, well i have been working on my backup app and i need to prevent the killing/closing in any way possible of my app(except unpluging the power source of course). so beeing aware that i can't hide my process or stop task manager to kill it, i was trying to bring up a warning message. i hope i made myself clear...so is there a way to get this done? Link to comment Share on other sites More sharing options...
mikell Posted August 31, 2014 Share Posted August 31, 2014 The only way I can think of is the use of a 2nd process to check the existence of the 1st one compact21 1 Link to comment Share on other sites More sharing options...
jchd Posted August 31, 2014 Share Posted August 31, 2014 Reinforce education of users attempting to kill the backup process by tasing them hard? 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 hereRegExp tutorial: enough to get startedPCRE 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 More sharing options...
compact21 Posted August 31, 2014 Author Share Posted August 31, 2014 jchd a warning message is not such a bad thing isn't it? The only way I can think of is the use of a 2nd process to check the existence of the 1st one thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted August 31, 2014 Developers Share Posted August 31, 2014 jchd a warning message is not such a bad thing isn't it? I think when people willingly/consciously kill processes, they can't complain things aren't working any more. Simple fix could also be to have a scheduler task to start the program each x minutes and have the check in the program to actually run only one time. 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 More sharing options...
compact21 Posted August 31, 2014 Author Share Posted August 31, 2014 I think when people willingly/consciously kill processes, they can't complain things aren't working any more. Simple fix could also be to have a scheduler task to start the program each x minutes and have the check in the program to actually run only one time. Jos That's a good solution Jos, can you help me with the scheduler task, point me on the right direction please?( i'm not the only one using my computer so just in case...that's why i need this) Link to comment Share on other sites More sharing options...
Developers Jos Posted August 31, 2014 Developers Share Posted August 31, 2014 (edited) That's a good solution Jos, can you help me with the scheduler task, point me on the right direction please?( i'm not the only one using my computer so just in case...that's why i need this) Let me be Honest with you: I am not really buying your backup story yet and somehow have the feeling you have other intentions for the simply fact that doing this for backup purposes would be something trivial to do for all users. So, when this is your computer and others have access to this too, then don't give them Admin rights and simple run the script under credentials they can't touch. Jos Edited August 31, 2014 by 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 More sharing options...
compact21 Posted August 31, 2014 Author Share Posted August 31, 2014 Yeah the truth is that i am trying to create the most destructive autoit version of stuxnet viruse and i'm asking for help on this forum because i have no ideea how to get a pice of code working proprely. You got me man. I'll figure it out by myself. Thanks anyway. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 31, 2014 Developers Share Posted August 31, 2014 Yeah the truth is that i am trying to create the most destructive autoit version of stuxnet viruse and i'm asking for help on this forum because i have no ideea how to get a pice of code working proprely. You got me man. I'll figure it out by myself. Thanks anyway. Glad you are as honest as I am ... good luck with your endeavours. 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 More sharing options...
Recommended Posts