Sign in to follow this  
Followers 0
Orao

A script to close a window with a specific title

7 posts in this topic

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 immediately

thanks for your suggestions.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by ahmet

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0