Jump to content
Sign in to follow this  
Markos

need help with winsetstate

Recommended Posts

Markos

I want to hide window with name similar to:

3% [file 1.avi] (dub in progress)

I need to match the '[' and ']' characters but the problem is that winsetstate counts these chars as special chars as it does in for ex.:

winsetstate('[CLASS:xxx]','',...)

this did not work:

Opt('WinTitleMatchMode', 2)
WinSetState('[' & $file & '] (dub in progress)','',@SW_HIDE)

I thought it can be done using [REGEXPTITLE:] but I dont know how.

Can anyone help me?


Share this post


Link to post
Share on other sites
Monamo

I want to hide window with name similar to:

3% [file 1.avi] (dub in progress)

I need to match the '[' and ']' characters but the problem is that winsetstate counts these chars as special chars as it does in for ex.:

winsetstate('[CLASS:xxx]','',...)

this did not work:

Opt('WinTitleMatchMode', 2)
WinSetState('[' & $file & '] (dub in progress)','',@SW_HIDE)

I thought it can be done using [REGEXPTITLE:] but I dont know how.

Can anyone help me?

I kept running into failures w/ REGEXPTITLE on this particular one as well. Here's a workaround method - longer code than planned, but it works for the naming pattern you gave as an example:

Dim $aWindows

$aWindows = WinList()
$sPattern = "\d{1,3}\%\h{1}\[.*[\.avi]\].*"

For $i = 1 To $aWindows[0][0]
    If StringRegExp($aWindows[$i][0], $sPattern) Then
        WinSetState($aWindows[$i][1], "", @SW_HIDE)
    EndIf
Next

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites
Markos

thanx, this one is working...


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  

×