Belini Posted May 20, 2023 Share Posted May 20, 2023 I need to compile a script that works in windows 98 with a function similar to OnAutoItExitRegister() to execute commands when windows is closed but I couldn't find the name of the function used in 2008, does anyone know what it was? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Andreik Posted May 20, 2023 Share Posted May 20, 2023 You mean when the operation system is about to shut down or what windows are you talking about? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
pixelsearch Posted May 20, 2023 Share Posted May 20, 2023 (edited) @Belini AutoIt 3.2.10.0, help file dated Dec 25, 2007 Func OnAutoItExit ()...EndFunc Defines a user-defined function that will be called when the script exit. Func OnAutoItExit ( ) ... EndFunc Parameters None. Remarks Inside the function, @ExitCode can be used to retrieve the code set by the exit statement. The mode of exit can be retrieved with @ExitMethod. 0 Natural closing. 1 close by Exit function. 2 close by clicking on exit of the systray. 3 close by user logoff. 4 close by Windows shutdown. Related Func OnAutoItStart (), OnExitFunc (Option) Example Opt("OnExitFunc", "endscript") MsgBox(0,"","first statement") Func endscript() MsgBox(0,"","after last statement " & @EXITMETHOD) EndFunc Edit: same syntax in Autoit 3.2.12.0 (May 16, 2008) Edited May 20, 2023 by pixelsearch Belini 1 Link to comment Share on other sites More sharing options...
Belini Posted May 21, 2023 Author Share Posted May 21, 2023 (edited) @Andreik yes i want to run a function when the operating system is about to shut down. @pixelsearch I found version 3.2.10.0 and version 3.2.12.0 to download, but I couldn't find Scite to download and OnAutoItExit() still doesn't work, does anyone know where I can download Scite from these versions? ERROR: OnAutoItExit(): undefined function. OnAutoItExit("Encerrar") Edited May 21, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 21, 2023 Developers Share Posted May 21, 2023 That part of the English language is unknown to me! 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...
pixelsearch Posted May 21, 2023 Share Posted May 21, 2023 Nicely written Jos, with tact Bing translates it like this : @Andreik : Yes, I want to perform a function when the operating system is about to shut down. @pixelsearch I found version 3.2.10.0 and version 3.2.12.0 to download, but I couldn't find Scite to download and OnAutoItExit() still doesn't work, does anyone know where I can download Scite from these versions? Link to comment Share on other sites More sharing options...
Belini Posted May 21, 2023 Author Share Posted May 21, 2023 @Jos and @pixelsearch I posted in English but my page translator switched to Portuguese when I posted and I didn't notice it. I got the scite from versions 3.2.10.0 and version 3.2.12.0 but the OnAutoItExit() function is still not recognized. ERROR: OnAutoItExit(): undefined function. OnAutoItExit("Encerrar") My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 21, 2023 Developers Share Posted May 21, 2023 (edited) SciTE plays no role here, so what exactly is the error you get ? Please simple share the full SciTE output pane information when you run the script! Edited May 21, 2023 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...
Belini Posted May 21, 2023 Author Share Posted May 21, 2023 Script and SciTE output pane My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 21, 2023 Developers Share Posted May 21, 2023 That isn't the SciTE output pane output but rather the au3check output. Likely you do not have the proper definition for au3check , so hence you get this error returned by it. Just disable the au3check and only run the script with autoit3. 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...
Belini Posted May 21, 2023 Author Share Posted May 21, 2023 (edited) The same error continues #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Run_AU3Check=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** OnAutoItExit("Encerrar") While 1 Sleep(1000) WEnd Func Encerrar() While 1 ProcessClose("advmenu.exe") Send("{enter down}") Sleep(50) Send("{enter up}") WEnd EndFunc ;==>Encerrar >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\Encerrar.au3" /autoit3dir "C:\Arquivos de programas\AutoIt3" /UserParams +>15:20:38 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0416 Keyboard:00000416 OS:WIN_2008/Service Pack 1 CPU:X64 ANSI) >Running:(3.2.10.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Encerrar.au3" D:\Encerrar.au3 (5) : ==> Unknown function name.: OnAutoItExit("Encerrar") ^ ERROR ->15:20:38 AutoIT3.exe ended.rc:1 +>15:20:39 AutoIt3Wrapper Finished >Exit code: 1 Time: 1.200 Version: 3.2.10.0 Edited May 21, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Developers Solution Jos Posted May 21, 2023 Developers Solution Share Posted May 21, 2023 Open the Helpfile that comes with the version and you will find that you have the syntax all wrong. It should be: Opt("OnExitFunc", "Encerrar") Belini 1 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...
Belini Posted May 21, 2023 Author Share Posted May 21, 2023 Now it worked, thanks @jos My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
argumentum Posted May 21, 2023 Share Posted May 21, 2023 ... I may be late but, Opt("OnExitFunc", "Encerrar") ; OnExitFunc Sets the name of the function called when AutoIt exits (default is OnAutoItExit). so maybe call the func OnAutoItExit() instead of Encerrar() 🤔 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Belini Posted May 22, 2023 Author Share Posted May 22, 2023 @argumentum it was the same as suggested to us and it really worked. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now