mercadantelaura
Active Members-
Posts
78 -
Joined
-
Last visited
mercadantelaura's Achievements
Wayfarer (2/7)
0
Reputation
-
Window Personal Size & Position
mercadantelaura replied to mercadantelaura's topic in AutoIt General Help and Support
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 -
Window Personal Size & Position
mercadantelaura replied to mercadantelaura's topic in AutoIt General Help and Support
Nobody can give me council for better solution to solve the 2 problems using my script ? -
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: #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
-
Thank you very much LarsJ for your help. I have replaced ConsoleWrite( $oFolderItem.Path() & @CRLF ) with FileWriteLine("C:List.txt", $oFolderItem.Path() & @CRLF) and all run. I found a limit: If i have files or folders selected on desktop the script don't take effect In addiction i have always same question: Where is allocated all list of files in order to write variable using only one pass for all selection data when FOR-NEXT is finished and not write on HD during cycle FOR-NEXT?? I have proved: $data = ConsoleRead() but is always empty Now your code is more rapid that previously but it takes more than 10 seconds to load list of 5.000 mp3 (small part of all my list), compared using function "ClipBoard" that emploied 2 seconds. I have upgrade my alternative code to run also on desktop using your past code from other topic that i have used for other purpose. Unfortunately i have not sufficient experience to how know directly the number of files selected and for my limit i have used command "StringInStr" to extrapolate number of selected from variable $sStatus into function nSelect() ; My Script #NoTrayIcon #include <CUIAutomation2.au3> #include <misc.au3> _Singleton("MyList", 0) $Prog = "MyProg" If NOT FileExists(@scriptDIR & "\" & $Prog & ".exe") then Exit Local $Desktop = "SysListView321" ; Desktop Control of Win7 Local $hWindow = WinGetHandle( "[active]" ) Local $ItemSelected = "" If ControlGetFocus($hWindow) = $Desktop Then $nSelect = ControlListView ( $hWindow, "", $Desktop, "GetSelectedCount" ) Else Local $nSelect = nSelect() Endif ClipPut ( "" ) Send("^c") ; Copy to clipboard all FULL PATH + FILENAME + EXTENSIONS of selected items Select Case $nSelect = "0" Run($Prog) Case $nSelect = 1 While $ItemSelected = "" Sleep(10) Local $ItemSelected = ClipGet() WEND Run($Prog & " COPY " & '"' & $ItemSelected & '"') Case $nSelect > 1 While 1 $File = @TempDIR & "\List-" & INT ( Random ( 10^10 ) ) If NOT FileExists( $File ) Then ExitLoop WEND While $ItemSelected = "" Sleep(10) Local $ItemSelected = ClipGet() WEND FileWriteLine($File, $ItemSelected) Run($prog & " COPY *" & $File) EndSelect Do Sleep(10) Until WinActive($Prog) Send("{TAB}{ENTER}") Func nSelect() Local $oUIAutomation $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return Local $pWindow, $oWindow $oUIAutomation.ElementFromHandle( $hWindow, $pWindow ) $oWindow = ObjCreateInterface( $pWindow, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oWindow ) Then Return Local $pCondition $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $UIA_ListControlTypeId, $pCondition ) If Not $pCondition Then Return Local $pUIList, $oUIList $oWindow.FindFirst( $TreeScope_Descendants, $pCondition, $pUIList ) $oUIList = ObjCreateInterface( $pUIList, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oUIList ) Then Return Local $sStatus $oUIList.GetCurrentPropertyValue( $UIA_ItemStatusPropertyId, $sStatus ) If StringInStr ( $sStatus, "sele") > 0 Then ; "If there is 'word: sele' in $status message extrapolate the number of item selected frim string Local $FileSelect = StringSplit ( StringRight($sStatus, StringLen ($sStatus) - (StringInStr ($sStatus, ",") + 1)), " " ) Return $FileSelect[1] Else Return 0 Endif EndFunc
-
OK Thanks, now it runs but there are some problems. The file list.TXT created is the input of an other freeware program that load this file list, but to run correctly it needs : "DriveLetterPathFileName.Extension" ...example... "c:MyFolderABCDEFProgramMyFile01.mp3" The list of files created have extension at the end of filename only if file is not knowed from Widnows. My explorer as default Hide extensions of files recognized and in this case script don't create correctly list because extension is not reported at the end of file. In addiction i have folders with more than 5.000 files and script glide the list files on screen when i run it and it takes lots time to generate file.TXT. There isn't other method to create file list of selected ? -- I have wrote this code but using it, i have 2 problems: --- (1) I am obliged to use Singleton because without it, lots session of application "MyProg" start (each session of every item selected), Why ??? (2) If i select also only one folder that contain 200-300 GB of Data The program not load all data (I think that is a BUG of freeware program ) #NoTrayIcon #include <Misc.au3> _Singleton("MyList", 0) ; Without Singleton at the end script start N° sessions equal the number of selected files Local $hw = WinGetHandle( "[CLASS:CabinetWClass]" ) If NOT $hw Then EXIT While 1 ; Generate a valid Random FileName of List $File = @TempDIR & "\List-" & INT ( Random ( 10^10 ) ) & ".TXT" If NOT FileExists( $File ) Then ExitLoop WEND ClipPut ( "" ) ; Clean ClipBoard Memory Send("^c") ; Copy to clipboard all FULL PATH + FILENAME + EXTENSIONS of selected items Sleep(150) Local $ItemSelected = ClipGet() ; Store clipboard selected items into variable FileWriteLine($File, $ItemSelected) ; Write on file "$CmdLine[1]" the list generated Sleep(150) ; wait to be finished writing Run("MyProg" & $File) ; start MyProg that load Text List of all files selected
-
Thanks Lars, you are very gentile but as i previously wrote i'm beginner and i don't know how try your code to obtain on my ROOT the "File.TXT" with all list of files/folders selected with their "Full-Path""Filename"."extension" Sorry but how is variable that contain list in order to create file to hard disk using FileWrite("c:\MyList.txt", $List) ControlListView for SysListView321 is more easy to use for beginner as me
-
Local $List Local $hw = WinGetHandle( "[CLASS:CabinetWClass]" ) If NOT $hw Then EXIT $FilesSelected = ControlListView($hw, "", "SysListView321", "GetSelected", 1 ) If $FilesSelected = "" Then EXIT Local $items = StringSplit($FilesSelected, "|") For $x = 1 to $items[0] $List = $List & ControlListView($hw, "", "SysListView321", "GetText", $items[$x]) & @CRLF Next MsgBox( 0, "", $List, 5 ) FileWrite ( "c:\MyList.txt", $List) This is my code under SysListView321 that under Win7 x64 don't take effect.
-
Hi Mr. Lars. You is always disponible to help beginners :-) I'm prove to code to obtain same thing using "Clipboard" because UI Automation framework is too difficult to understand for me. Stupid question from a newbie but there is not possibility to improve ControlListView_Win7_version that include same all commands and options of old ControlListView of ListView32 that user can use again but have (internal function UI Automation framework) ?
-
This is link to my old code-purpose solved by member LarsJ for an example of ControlList that that don't run beacuse listview on Win 7 is a virtual list view as LarsJ explained to me When i come back to home i will post also new script that i wrote to obtain list of selected item that under win7 x64 don't take effect
-
I need to create a TXT files with list of all files/folder full-PathFilename.ext that i have selected, but under win7 x64 command ControlListView don't run. How can i create my custom list ? Can you suggest me ho can implement that function ? Example --List.txt-- C:testfiletest.avi c:TestVideo.avi c:TestmyPersonalFolder thanks
-
Mr. LarsJ I need again your help if you can. I have saw, using your script that "Organize Menu" and its subcommands can be invoked from your script also if i have full hided command bar. (also if MenuBar need to be visible) Searching on WEB i found program "Custom Explorer Toolbar" that has permit me to add function that i want (NavPane) directly in command bar on right side of Organize Menu in order to not open --> organize...Layout...NavPane to access it but using it without open menu that now is not necessary Infact it is a direct buttom execute. In your script i have replaced Name "Organize" with "NavPane" and runs immediately as i want, but unfortunately i would a script only for this function, but your code includes also other functions. I have proved to delete from script, access to MenuBar - ViewMode included for previously my request on StatusBar that you gently have coded for me, but i don't know how do. I need script that invoke only EXECUTE of this Button that i have added to command bar, without access StatusBar/MenuBar/ViewMode and without open Organize-Layout now not necessary Please can you remove all parts unnecessary to realize this i don't have sufficient knowledge to do this, also if i read guide, infact i have removed wrong parts and causes always errors with variable don't declared If you can i thanks so much