Hyflex Posted May 25, 2010 Share Posted May 25, 2010 I am needing some help, I have loads of WinMoves setup, currently in a while loop... The following is one of the WinMoves i use: WinMove("[CLASS:WindowsForms10.window.8.app.0.378734a]", "", 0, 628, 1675, 382) I want it so if that window apears for it to move it once, and then if i move it manually it will stay there, Until I close it and relaunch it.. but I have 10+ windows open at same time different Class values. I have no idea how to do it... Link to comment Share on other sites More sharing options...
exodius Posted May 25, 2010 Share Posted May 25, 2010 Something like this? $vWinCheck = 0 If WinExists("[CLASS:WindowsForms10.window.8.app.0.378734a]") And $vWinCheck = 0 Then WinMove("[CLASS:WindowsForms10.window.8.app.0.378734a]", "", 0, 628, 1675, 382) $vWinCheck = 1 ElseIf Not WinExists ("[CLASS:WindowsForms10.window.8.app.0.378734a]") And $vWinCheck = 1 Then $vWinCheck = 0 EndIf Link to comment Share on other sites More sharing options...
Hyflex Posted May 25, 2010 Author Share Posted May 25, 2010 Something like this? $vWinCheck = 0 If WinExists("[CLASS:WindowsForms10.window.8.app.0.378734a]") And $vWinCheck = 0 Then WinMove("[CLASS:WindowsForms10.window.8.app.0.378734a]", "", 0, 628, 1675, 382) $vWinCheck = 1 ElseIf Not WinExists ("[CLASS:WindowsForms10.window.8.app.0.378734a]") And $vWinCheck = 1 Then $vWinCheck = 0 EndIf Hmm, I launch all the different windows at different times, i close some and reopen some. I want them to move as soon as they appear but not move until they close/re appear. Link to comment Share on other sites More sharing options...
evilertoaster Posted May 25, 2010 Share Posted May 25, 2010 (edited) Resize array and add more classes as necessary. dim $WindowClasses[10][2] $WindowClasses[0][0]="[CLASS:WindowsForms10.window.8.app.0.378734a]" $WindowClasses[1][0]="[CLASS:WindowsForms10.window.8.app.0.378734b]" $WindowClasses[2][0]="[CLASS:WindowsForms10.window.8.app.0.378734c]" $WindowClasses[3][0]="[CLASS:WindowsForms10.window.8.app.0.378734e]" $WindowClasses[4][0]="[CLASS:WindowsForms10.window.8.app.0.378734f]" $WindowClasses[5][0]="[CLASS:WindowsForms10.window.8.app.0.378734g]" $WindowClasses[6][0]="[CLASS:WindowsForms10.window.8.app.0.378734h]" $WindowClasses[7][0]="[CLASS:WindowsForms10.window.8.app.0.378734i]" $WindowClasses[8][0]="[CLASS:WindowsForms10.window.8.app.0.378734j]" $WindowClasses[9][0]="[CLASS:WindowsForms10.window.8.app.0.378734k]" for $i=0 to 9 $WindowClasses[$i][1]=True Next while 1 for $i=0 to 9 If WinExists($WindowClasses[$i][0]) And $WindowClasses[$i][1]=true Then WinMove($WindowClasses[$i][0], "", 0, 628, 1675, 382) $WindowClasses[$i][1]=False EndIf If (Not WinExists ($WindowClasses[$i][0])) And $WindowClasses[$i][1] = False Then $WindowClasses[$i][1]=True Next WEnd Edited May 25, 2010 by evilertoaster Link to comment Share on other sites More sharing options...
Hyflex Posted May 25, 2010 Author Share Posted May 25, 2010 Hmm that is nearly perfect i think. Apart from not every prgram moves to same spot.. i put them in diff locations on screen Link to comment Share on other sites More sharing options...
evilertoaster Posted May 25, 2010 Share Posted May 25, 2010 make $WindowClasses a 10x4 array and store the X,Y of each window in $WindowClasses[$i][2] and $WindowClasses[$i][3] Link to comment Share on other sites More sharing options...
Hyflex Posted May 25, 2010 Author Share Posted May 25, 2010 make $WindowClasses a 10x4 array and store the X,Y of each window in $WindowClasses[$i][2] and $WindowClasses[$i][3] Could you word that for stupid people (i have no idea what u said) Link to comment Share on other sites More sharing options...
evilertoaster Posted May 25, 2010 Share Posted May 25, 2010 expandcollapse popupdim $WindowClasses[10][4] ;window classes $WindowClasses[0][0]="[CLASS:WindowsForms10.window.8.app.0.378734a]" $WindowClasses[1][0]="[CLASS:WindowsForms10.window.8.app.0.378734b]" $WindowClasses[2][0]="[CLASS:WindowsForms10.window.8.app.0.378734c]" $WindowClasses[3][0]="[CLASS:WindowsForms10.window.8.app.0.378734e]" $WindowClasses[4][0]="[CLASS:WindowsForms10.window.8.app.0.378734f]" $WindowClasses[5][0]="[CLASS:WindowsForms10.window.8.app.0.378734g]" $WindowClasses[6][0]="[CLASS:WindowsForms10.window.8.app.0.378734h]" $WindowClasses[7][0]="[CLASS:WindowsForms10.window.8.app.0.378734i]" $WindowClasses[8][0]="[CLASS:WindowsForms10.window.8.app.0.378734j]" $WindowClasses[9][0]="[CLASS:WindowsForms10.window.8.app.0.378734k]" ;x-coords $WindowClasses[0][2]=0 $WindowClasses[1][2]=100 $WindowClasses[2][2]=200 $WindowClasses[3][2]=300 $WindowClasses[4][2]=400 $WindowClasses[5][2]=500 $WindowClasses[6][2]=600 $WindowClasses[7][2]=700 $WindowClasses[8][2]=800 $WindowClasses[9][2]=900 ;y-coords $WindowClasses[0][3]=0 $WindowClasses[1][3]=50 $WindowClasses[2][3]=100 $WindowClasses[3][3]=150 $WindowClasses[4][3]=200 $WindowClasses[5][3]=250 $WindowClasses[6][3]=300 $WindowClasses[7][3]=350 $WindowClasses[8][3]=400 $WindowClasses[9][3]=450 for $i=0 to 9 $WindowClasses[$i][1]=True Next while 1 for $i=0 to 9 If WinExists($WindowClasses[$i][0]) And $WindowClasses[$i][1]=true Then WinMove($WindowClasses[$i][0], "", $WindowClasses[$i][2], $WindowClasses[$i][3], 1675, 382) $WindowClasses[$i][1]=False EndIf If (Not WinExists ($WindowClasses[$i][0])) And $WindowClasses[$i][1] = False Then $WindowClasses[$i][1]=True Next WEnd 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