AutoHotkey Community

It is currently May 27th, 2012, 1:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: March 10th, 2009, 10:42 pm 
Offline

Joined: February 25th, 2009, 4:56 pm
Posts: 6
Hi, is there a preferred method to detect a window and take an action on it?


Code:
Loop
{
   WinWait, Microsoft Office OneNote Security Notice,
   IfWinNotActive, Microsoft Office OneNote Security Notice, , WinActivate, Microsoft Office OneNote Security Notice,
   WinWaitActive, Microsoft Office OneNote Security Notice,
   Send, y   
}


Or

Code:
SetTimer, OneNoteNotice, 100
OneNoteNotice:
{
IfWinExist, Microsoft Office OneNote Security Notice,
Send, y
Return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2009, 10:44 pm 
SetTimer


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2009, 10:50 pm 
Offline

Joined: February 19th, 2009, 6:44 pm
Posts: 125
Code:
settimer, aa, 100
aa:
WinWaitActive, Microsoft Office OneNote Security Notice
send y
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2009, 10:51 pm 
Offline

Joined: February 25th, 2009, 4:56 pm
Posts: 6
Would you mind sharing why?

I assumed that Loop would take too much CPU time, but it is not detectable. Process Lasso reports an average load of 0.02% for AHK with the Loop method.

I also assume that with the Loop method the window will be closed faster, vs SetTimer having a worst time of 100 ms


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: BrandonHotkey, oldbrother, Yahoo [Bot] and 19 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