AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help with a script...[ destroy all open windows ]

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
h4xx0r n00bl37



Joined: 14 Mar 2008
Posts: 56

PostPosted: Tue Jun 17, 2008 6:31 pm    Post subject: Need help with a script...[ destroy all open windows ] Reply with quote

I'm trying to make something that will destroy all open windows. This is what I have right now.

Code:

loop,30
{
WinKill,,,1,,
}
ExitApp


Once it is finished I will burn it to a CD and act as a task manager incase I accidentaly screw myself over with a script.

[ Moderator!: Please use meaningful subject line in future ]
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Tue Jun 17, 2008 6:45 pm    Post subject: Reply with quote

you will cause more damage with this script than you can cause with another script.

Simply build a safety into all your other scripts (I use
Code:
~!esc::ExitApp
) Just hit Shift Escape to kill the scripts. that are watching for it. once a script is safe and tested, remoev this hotkey.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5890

PostPosted: Tue Jun 17, 2008 7:04 pm    Post subject: Re: Need help with a script...[ destroy all open windows ] Reply with quote

h4xx0r n00bl37 wrote:
incase I accidentaly screw myself over with a script.


You may use the following script which shall gracefully end all running AHK scripts ( including those compiled ) :

Code:
DetectHiddenWindows, On
WinGet, List, List, ahk_class AutoHotkey
Loop %List%
  {
    WinGet, PID, PID, % "ahk_id " List%A_Index%
    If ( PID <> DllCall("GetCurrentProcessId") )
         PostMessage,0x111,65405,0,, % "ahk_id " List%A_Index%
  }         


Smile
_________________
SKAN - Suresh Kumar A N
Back to top
View user's profile Send private message
andrei901(not yet logged)
Guest





PostPosted: Tue Jul 08, 2008 11:31 pm    Post subject: Reply with quote

could his script be used to kill all open windows without killing processes?

if, for example, i write a multi-part script, could i use his command as a failsafe between parts if the actual script doesn't close the window due to lag?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group