GrAaL Posted April 3, 2006 Share Posted April 3, 2006 Hi all !!! I need to check for two different windows to protect an application from user's modifications. I think that a WinWaitActive wan help me to do so, but, is there a way to check for two WinWaitActive at the same time. I was thinking about something like While (WinWaitActive("windows 1", "text 1") OR WinWaitActive("windows 2", "text 2")) ControleDisable("windows1", "text1", "ControlX") ControleDisable("windows2", "text2", "ControlY") Wend But it talk about parsing error.... Have you got a solution Thanks a lot Link to comment Share on other sites More sharing options...
Uten Posted April 3, 2006 Share Posted April 3, 2006 Just use the timeout option on WinWaitActive WinWaitActive ( "title" [, "text" [, timeout]] ) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
GrAaL Posted April 3, 2006 Author Share Posted April 3, 2006 Just use the timeout option on WinWaitActive WinWaitActive ( "title" [, "text" [, timeout]] ) I can't let the autoIT script loop every xx secondes because 80 users will use it at the same time on the same server, big performance trouble..... there're no way the 'wait' for two events ???? (thansk a lot for your reply Link to comment Share on other sites More sharing options...
Uten Posted April 3, 2006 Share Posted April 3, 2006 No, unfortunately. No event callbacks. So either 1 script for each window. Or using sleep(XXX ms) in the loop. WinWaitActive will also make your process appear to sleep. So the big question is how important is it to detect the windows and how fast must they be handled? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
MHz Posted April 4, 2006 Share Posted April 4, 2006 I can't let the autoIT script loop every xx secondes because 80 users will use it at the same time on the same server, big performance trouble..... there're no way the 'wait' for two events ???? (thansk a lot for your replyThe Latest AutoIt Beta can wait for more then 2 windows by using regular expressions. Here is a Demo Opt('WinTitleMatchMode', 4) Switch Random(1, 3, 1) Case 1 RunWait('explorer "' & @ProgramFilesDir & '"') Case 2 RunWait('explorer "' & @WindowsDir & '"') Case 3 RunWait('explorer "' & @SystemDir & '"') EndSwitch WinWait('regexp=(?i)program files|windows|system32', '', 1) $title = WinGetTitle('regexp=(?i)program files|windows|system32') Sleep(500) WinClose($title) Link to comment Share on other sites More sharing options...
Uten Posted April 4, 2006 Share Posted April 4, 2006 Opt('WinTitleMatchMode', 4) WinWait('regexp=(?i)program files|windows|system32', '', 1) $title = WinGetTitle('regexp=(?i)program files|windows|system32') Sleep(500) WinClose($title) Wow, neat trick! Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Kratos Posted June 30, 2018 Share Posted June 30, 2018 On 03/04/2006 at 5:26 PM, GrAaL said: Hi all !!! I need to check for two different windows to protect an application from user's modifications. I think that a WinWaitActive wan help me to do so, but, is there a way to check for two WinWaitActive at the same time. I was thinking about something like While (WinWaitActive("windows 1", "text 1") OR WinWaitActive("windows 2", "text 2")) ControleDisable("windows1", "text1", "ControlX") ControleDisable("windows2", "text2", "ControlY") Wend But it talk about parsing error.... Have you got a solution Thanks a lot $hWnd = WinWaitActive("[REGEXPTITLE:(WindowWithThisTitle|WindowWithThatTitle)]") If WinGetTitle($hWnd) = "WindowWithThisTitle" then DoSomething() Else DoSomethingElse() EndIf Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 30, 2018 Share Posted June 30, 2018 Don't necropost... Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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