Jump to content

A newbie question...


Recommended Posts

hi,

please tell me how can i detect and close windows with both upper and lower case characters.

TRAYSETSTATE("2")
AutoItSetOption("WinTitleMatchMode", 2)
;
If WinExists("Sex") Then
    WinClose("Sex")
    MsgBox(262160, "Web Closed", "Browse Somewhere Else")

this code will detect only word "sex"

how can i make it to detect if word is SeX , SEX , sEX , SEx , etc.

i dont want to increase the size of my script and exe so please tell me what to do with it.

thanx in advance for the help!

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

i don't know if exist some simple solution but i got this :

Opt("WinTitleMatchMode",2)
$String="SEX"
$var=WinGetTitle("sex","")
$Check=StringUpper($var)
If StringInStr($Check,$String)<>0 then
msgbox(64,"","We found some SEX :)")
WinClose($var)
Endif

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

@d4rk

thanx for the help !

you rocks !!!

i am just creating a Little Porn Blocker.

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

  • Developers

Its better to use the [REGEXPTITLE ] option. See "Advanced Window Descriptions " in the helpfile.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

i found it in help file but could not understand what to do with it.

can u please give a example.

thanx a lot for the great support and giving time to help me.

OS: Windows XP SP2, AutoIt version: 3.2.10.0Help The Great Forum Which is Used by You For Help.01 - Always Respect The Forum Members.02 - Use Search Before Posting or making any new Thread.03 - Help The Newbies.
Link to comment
Share on other sites

  • Developers

This list all visible windows with the word sex in it and it doesn't matter if caps or lower case is used.

$var = WinList("[REGEXPTITLE:.*[Ss][Ee][Xx].*]")

For $i = 1 to $var[0][0]
 ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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