Search the Community
Showing results for tags 'newb'.
-
Hi I'm looking to start a new (what I think will be simple) program. Basically I want to just have a text file that sits in a location, say, C:blockwindows.txt. For AutoIt I just want it to open and begin auto-closing any windows that contain the string that is put in each line within that c:blockwindows.txt. So the C:blockwindows.txt may contain these strings "some string here test" "another string here" "yet another string". So what AutoIt would do, is constantly be monitoring for any openings of windows on the computer that contains any of those strings, whether it's at the beginning or end or whereever in the Window title. These windows could open up at any time of the day. Here's what I've got so far from research, just having a challenge determining whether it's the right approach, and ultimately, figuring out how to piece it together. - I do not know what window MatchMode to use based on the strings read from the text file to determine if the string matches that of what's in the title. I could make an exact match given that I do know what prefix and suffix comes before/after the string variable if needed. $FilePath = "C:blockedwindows.txt" $FileRead = FileRead($FilePath ) $WindowName = StringSplit($FileRead , @CRLF, 1) For $i =1 To $WindowName[0] WinClose ($WindowName[$i]) Next Something like this could work I'm just worried about CPU usage. It goes about 25% of the CPU. But if I add a sleep(1000) after WinClose, it remains at 0% CPU.