nevermind Posted August 21, 2009 Share Posted August 21, 2009 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 Link to comment Share on other sites More sharing options...
WolfWorld Posted August 21, 2009 Share Posted August 21, 2009 (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 August 21, 2009 by athiwatc Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
nevermind Posted August 21, 2009 Author Share Posted August 21, 2009 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. Link to comment Share on other sites More sharing options...
Manjish Posted August 21, 2009 Share Posted August 21, 2009 check _GUICtrlListView_GetItemText() [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
picea892 Posted August 21, 2009 Share Posted August 21, 2009 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 Link to comment Share on other sites More sharing options...
nevermind Posted August 22, 2009 Author Share Posted August 22, 2009 Thanks all. Its working now. 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