AutoHotkey Community

It is currently May 26th, 2012, 3:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ExitApp not working
PostPosted: April 11th, 2008, 3:27 pm 
Code:
#notrayicon
#singleinstance force
loop,
{
winkill,Data Execution Prevention - Microsoft Windows
}
Sleep, 30000
ExitApp


I have the above code added to my list of startup programs on my work laptop. I keep getting an annoying message because of an issue with my antivirus software. Eventually the problem will be fixed the right way, but for now I wrote the above script to kill the repeating window. This script consumes a lot of CPU power, so I want it to automatically close after 30 seconds. But it doesn't close after 30 seconds. What am I doing wrong?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2008, 3:33 pm 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
Code:
#notrayicon
#singleinstance force
Settimer,Exit,30000
loop,
{
winkill,Data Execution Prevention - Microsoft Windows
Sleep,100
}

Exit:
ExitApp

_________________
[Join IRC!]
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2008, 3:35 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Looks like you are in an endless loop so it never reaches the Sleep command. Try using SetTimer
http://www.autohotkey.com/docs/commands/SetTimer.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 11th, 2008, 4:12 pm 
Offline

Joined: October 19th, 2007, 8:30 pm
Posts: 136
Location: PA
does the error continuously pop up forever? or only for a certain amount of time or popups?

you could have it loop with a sleep of around 100 that detects when the popup exists, then closes it after.

what to do:
find the title of the popup window, make sure it's not a variable name in the title. if it is a specific title, great.
use:
Code:
IfWinExist, titleOfAntivirusPopup

If necessary, (to make sure you find the right window) add a comma after this code and include some text IN the window that will always show up. i.e. the name of the file or error or warning.

so you could use:
Code:
SetTimer, loopAV, 150         ;(timeTillRelaunchOfLoopAV)
return

loopAV:
IfWinExist, Data Execution Prevention - Microsoft Windows
WinKill, Data Execution Prevention - Microsoft Windows
return

^!H::                 ; press CTRL-ALT-H to shutdown script
ExitApp


NOTE: this should work if memory serves me right, and the cpu usage isn't bad. i have code somewhere to do something similar, so if this doesn't bring down the cpu usage...holler back and i'll check it out.
this code was not tested.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Google Feedfetcher, Pulover, zj403 and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group