mercadantelaura Posted April 11, 2014 Share Posted April 11, 2014 (edited) I'm using Win7 64 bits. I have coded a small script utility that i have added to my explorer toolbar in order to obtain immediately (when i click icon) window dimension and position to value that i have setted into script. Unfortunately i have 2 problems: (1st) If the dimension of Left/Right Panel is changed and not equal to value that i want, in order to obtain the dimension that i want of Left Panel "SysTreeView321" and Right Panel "DirectUIHWND3" i'm using function "MouseClickDrag" to Move sepration column that change dimension of this 2 controls. Unfortunately this method is not immediately (as for only WinMove) and in addiction if i move mouse before that script has finished its work, the dimension of 2 controls is not restored to my configuration but setted to mouse position. (2nd) If i restore personal dimension and i open new session of explorer.exe it will be opened with old wrong dimension and i need to click again toolbar icon to re-set custom config. To take effect also for New session of explorer i must manually change dimension of window moving window border with mouse because the new dimension setted using "WinMove" is not stored from windows. Why ? There is some better solution ? Thanks This is my code: expandcollapse popup#NoTrayIcon Local $hWindow = WinGetHandle( "[CLASS:CabinetWClass]" ) If Not $hWindow Then EXIT Local $FromLeft = 37 Local $FromTop = 20 Local $Width = 950 Local $Height = 650 Local $Separation = 346 WinMove( $hWindow, "", $FromLeft, $FromTop, $Width, $Height) Local $MousePos = MouseGetPos() Local $ControlLeftPos = ControlGetPos ( $hWindow, "", "SysTreeView321" ) Local $ControlRightPos = ControlGetPos ( $hWindow, "", "DirectUIHWND3" ) Do Sleep(5) Local $WinPos = WinGetPos( $hWindow ) Until $WinPos[0] = $FromLeft Local $Border_vSize = 150 Local $Border_hSize = ( $WinPos[2] - $ControlLeftPos[2] - $ControlRightPos[2] ) / 3 Local $SeparationColumn = $WinPos[0] + $ControlLeftPos[2] + $Border_hSize * 1.5 If $SeparationColumn <> $Separation Then MouseClickDrag ("Left", $SeparationColumn, $WinPos[1] +$Border_vSize, $Separation, $WinPos[1] +$Border_vSize, 0) MouseMove($MousePos[0], $MousePos[1], 0) ; Return to previously Mouse Position Edited April 11, 2014 by mercadantelaura Link to comment Share on other sites More sharing options...
mercadantelaura Posted April 14, 2014 Author Share Posted April 14, 2014 Nobody can give me council for better solution to solve the 2 problems using my script ? Link to comment Share on other sites More sharing options...
mercadantelaura Posted April 15, 2014 Author Share Posted April 15, 2014 Someone know a method to store new dimension and position of active wiNdow setted using function "WinMove" in order to obtain same dimension and position of new window opening new session of window explorer ? Thanks all member that can give me help 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