Jump to content

Why this func not work?


Recommended Posts

I everybody! I don't want anyone use my computer to visit xxx site so that i have created a function like this:

$FullTitle = WinGetTitle("", "xxx")
    $pid = WinGetProcess($FullTitle)    
    ProcessClose($pid)

And check process repeatly. But it only work with Internet Explorer and some other Applications :). Firefox can't be Close.

And My question is: WHY? ( I want to close firefox)

Edited by Xtupid

Please don't angry if I wrote something wrong because my English vocabulary is very little....

Link to comment
Share on other sites

It's not doing anything on the firefox window because it's not picking up any text to match the "xxx" against. You're going to have to find another way to deal with those kinds of windows.

Link to comment
Share on other sites

Not all porn sites contain "xxx" I'm sure.

I khow! It only is sample function

Anybody know how to slove this problem?

Please don't angry if I wrote something wrong because my English vocabulary is very little....

Link to comment
Share on other sites

Not all porn sites contain "xxx" I'm sure.

I khow! It only is sample function

Anybody know how to slove this problem?

Please don't angry if I wrote something wrong because my English vocabulary is very little....

Link to comment
Share on other sites

Might not be the solution to your issue, but if it is a Windows PC you might have more success by using the "hosts" file to block sites by site name (not a keyword).

These links might help you decide:

http://en.wikipedia.org/wiki/Hosts_file

http://www.mvps.org/winhelp2002/hostsfaq.htm

I know some ways to slove this problem but now I want to construe this :

- I try use AutoIt Window Info to get title of porn site in firefox. For example, it gets "xxx". But firefox still running and AutoIt Window Info has been closed :) ( because it contain "xxx"...WHY firefox is still running?

....

Please don't angry if I wrote something wrong because my English vocabulary is very little....

Link to comment
Share on other sites

I know some ways to slove this problem but now I want to construe this :

- I try use AutoIt Window Info to get title of porn site in firefox. For example, it gets "xxx". But firefox still running and AutoIt Window Info has been closed :) ( because it contain "xxx"...WHY firefox is still running?

....

Preemptive Suicide? :(
Link to comment
Share on other sites

Richard told you what you were doing wrong...

;1=start, 2=subStr, 3=exact, 4=advanced, -1 to  -4=Nocase
Opt("WinTitleMatchMode", 2)
$FullTitle = WinGetTitle("xxx", "")
$pid = WinGetProcess($FullTitle)    
ProcessClose($pid)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...