Orao Posted May 22, 2011 Posted May 22, 2011 Hi,I need a script that would run in background and constantly block (close) programs or windows with a specified title.so for example:- i would tell it each time a program or window is opened that contains the word ; keyfinder, crack, ...etc it should close this windows and report to Administrator.-actually i would like to make a blacklist for titles that are closed immediatelythanks for your suggestions.
ahmet Posted May 22, 2011 Posted May 22, 2011 (edited) 1. You can store blacklist to a file, where each line will contain one title 2. Get a list of windows using WinList() 3. Get number of lines in file 4. Read a line using FileReadLine() 5. Look for a title read by FileReadLine()in elemets of array returned by WinList() Edited May 22, 2011 by ahmet
somdcomputerguy Posted May 22, 2011 Posted May 22, 2011 I would try to use these functions - WinList, StringinStr, WinClose or WinKill. For the blacklist thing, the File functions (open, read, write). For reporting, that would depend on how you wanted to notify someone. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Orao Posted May 22, 2011 Author Posted May 22, 2011 ok. But do i need to specifie that this check process happens for each new window opened. I mean do i need to tell the script to repeat each time. And how do i do this? thanks
somdcomputerguy Posted May 22, 2011 Posted May 22, 2011 Put it all in a While loop. While 1 ConsoleWrite("Repeat ") Sleep(250) WEnd - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Orao Posted May 22, 2011 Author Posted May 22, 2011 thanks Can i also tell the script to pause or wait until a new program/window opens, and then make(repeat) the title check? In this way i would save CPU load i guess..?, and the script would repeat only when new window opens?
somdcomputerguy Posted May 22, 2011 Posted May 22, 2011 You would have to keep repeating the 'check' to see if a new program is 'in the list' that wasn't from the previous check. Put a Sleep at the end of the 'check loop' to reduce CPU load. Sleep uses milliseconds, so 1000 is 1 second, which should be fine. Increase or decrease this value if needed. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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