Markos Posted May 29, 2008 Share Posted May 29, 2008 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? Link to comment Share on other sites More sharing options...
Monamo Posted May 29, 2008 Share Posted May 29, 2008 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] Link to comment Share on other sites More sharing options...
Markos Posted May 30, 2008 Author Share Posted May 30, 2008 thanx, this one is working... Link to comment Share on other sites More sharing options...
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