Jump to content

Recommended Posts

Posted

Hello,

I need some help with Lists or ListView. Not sure which one. Here is what I need.

I want to open a console window(something like Windows Explorer). And Select a particular file or folder with its name/text. Eg. "Program Files". Is this do-able?

I have used ControlListView but have not had much success with it.

Thanks

Posted (edited)

Welcome to Autoit, if I am not mistaken you want a File Dialog.

Function Reference

FileOpenDialog

--------------------------------------------------------------------------------

Initiates a Open File Dialog.

FileOpenDialog ( "title", "init dir", "filter" [, options [, "default name" [, hwnd]]] )

Parameters See Autoit helpfile.

Edited by athiwatc
Posted

Not really. Its for another app. Eg AV software.

I need to read the listview which needs to select maybe "Quarantine" or "Autoupdate" etc by text.

Posted

check _GUICtrlListView_GetItemText()

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

Two thoughts

1) Below might be the solution you are looking for.

2) Just shellexecute explorer.exe using parameters to get to a certain folder (see example below)

#Include <WinAPI.au3>

ShellExecute("explorer.exe","c:")
sleep(5000)
    $hwnd= WinGetHandle("[active]")
    $classed = _WinAPI_GetClassName($hwnd)
    local $var = "[CLASS:"&$classed&"]"
    if $var = "[CLASS:ExploreWClass]" or $var = "[CLASS:CabinetWClass]" Then
                    $sSelected_Path = ControlGetText($var, "", "Edit1")
                 ;   $CLVItem = ControlListView($var, "", "[CLASS:SysListView32; INSTANCE:1]", "GetSelected")

                ;   ToolTip($Item)
            for $i = 1 to ControlListView($var, "", "[CLASS:SysListView32; INSTANCE:1]", "GetItemCount")
                ;$CLVItem = ControlListView($var, "", "[CLASS:SysListView32; INSTANCE:1]", "GetSelected")
                $Item = ControlListView($var, "", "[CLASS:SysListView32; INSTANCE:1]", "GetText", $i)
                if $Item="Program Files" then 
                                ControlListView($var, "", "[CLASS:SysListView32; INSTANCE:1]", "Select",$i)
                                send("{enter}")
                                ExitLoop
                EndIf
            Next

    EndIf

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
×
×
  • Create New...