Opera Shutdown Source Code delete lock Revision 346534376137 (Sun Mar 21 2010 at 10:23) - Diff Link to this snippet: https://friendpaste.com/1hleOupaSVNrFQILQVbYUD Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071; Opera Shutdown 0.13; Shutdowns/Hibernates computer when Opera completes transfers; http://my.opera.com/Tamil/blog/show.dml/2094333#NoTrayIcon#SingleInstance Force#NoEnvSoundBeepStringTrimRight, ScriptFullPathWithoutExt, A_ScriptFullPath, 4PrefsFile = %ScriptFullPathWithoutExt%.iniIfNotExist, %PrefsFile%{ FileInstall, OperaShutdown.ini, %PrefsFile%, 1 FileSetTime, , %PrefsFile%, C}IniRead, TriggerText, %PrefsFile%, Prefs, Trigger TextIniRead, CheckEvery, %PrefsFile%, Prefs, Check EveryIniRead, ConfirmationTimeout, %PrefsFile%, Prefs, Confirmation TimeoutIniRead, Hibernate, %PrefsFile%, Prefs, HibernateIniRead, Test, %PrefsFile%, Prefs, TestIniRead, ExitShortcut, %PrefsFile%, Prefs, Exit ShortcutIf ExitShortcut Hotkey, %ExitShortcut%, EXITPROGRAMSetTitleMatchMode, 1CheckEvery *= 60000KillTimeout := ConfirmationTimeout*30000ConfirmationTimeout *= 60Goto, CHECKLOOPCHECKLOOP:Sleep, %CheckEvery%IfWinExist, %TriggerText%{ MsgBox, 36, , Opera transfers completed.`n`nDo you want to close Opera and shutdown/hibernate computer?, %ConfirmationTimeout% IfMsgBox, No ExitApp If Test = 1 { Gosub, CLOSEOPERA MsgBox, 64, , The program is in test mode., %ConfirmationTimeout% ExitApp } Else { If Hibernate = 1 DllCall("PowrProf\SetSuspendState", "int", 1, "int", 0, "int", 0) Else { Gosub, CLOSEOPERA Shutdown, 8 } }}Else Goto, CHECKLOOPCLOSEOPERA:WinClose, %TriggerText%Sleep, %KillTimeout%IfWinExist, %TriggerText% WinKill, %TriggerText%ReturnEXITPROGRAM:SoundBeepExitAppReturn