tironci Posted April 27, 2010 Share Posted April 27, 2010 I am writing a script that opens a program then opens up a folder and it needs to select files from within this folder. I need it to select them in order but i cannot seem to make it to select the first one. this is the code i have for that ControlListView ( "Open", "", "[CLASS:DirectUIHWND; INSTANCE:2]", "Select", $Nmodels ) how do i make it so that it selects the first one. right now it goes directly to the middle one. thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 27, 2010 Share Posted April 27, 2010 What makes you think that "DirectUIHWND" class would respond to the regular Windows SysListView32 API, which is what ControlListView() uses? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
tironci Posted April 27, 2010 Author Share Posted April 27, 2010 (edited) this is the information that autoit window info gives me. i also want to mention that i am working on windows server 2008 R2. i also tried using [CLASS:SysListView32; INSTANCE:1] which works fine in windows server 2008 but for some reason it doesnt work now with R2. any ideas? Edited April 27, 2010 by tironci Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 27, 2010 Share Posted April 27, 2010 Why would "CLASS:SysListView32" ever work to identify a "CLASS:DirectUIHWND" control? Which is it? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
tironci Posted April 28, 2010 Author Share Posted April 28, 2010 maybe i'm not being clear. the script works fine with "CLASS:SysListView32" in win xp and win server 2008. but when i try to use it in win server 2008 r2 it doesn't work and when i use autoit window info it gives me "CLASS:DirectUIHWND" for the same listview. thats why i'm having a problem and not understanding why. i don't know if i'm being clear enough. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 28, 2010 Share Posted April 28, 2010 The explorer view in Vista shows SysListView for the contents list, and DirectUIHWND for the toolbar buttons (Organize/Views/Explore/Share/Burn). I don't have Server 2008 to compare that with. But again, if the content list in Server 2008 is also DirectUIHWND, I don't think you can expect the SysListView API functions of ControlListView() to work on it.A quick search of the forums turns up lots of depressing answers like this one: The control class is now "DirectUIHWND" which I don't think is compatible with any of the listview functions in AutoIt. I can't seem to find anything about it on MSDN. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
zorphnog Posted April 28, 2010 Share Posted April 28, 2010 This is true of Windows 7 explorer also. No more SysListView. Link to comment Share on other sites More sharing options...
microsumol Posted April 28, 2010 Share Posted April 28, 2010 This is true of Windows 7 explorer also. No more SysListView. I am having the same problem. So If we can't use SysListView, and DirectUIHWND is the "new" thing. How can we control the new list? My command as SysListView was: ControlListView ( "Open", "", "[CLASS:SysListView32; INSTANCE:1]", "Select", $Nmodels ) Is there any other Control to proper select files displayed by DirectUIHWND? Link to comment Share on other sites More sharing options...
microsumol Posted May 3, 2010 Share Posted May 3, 2010 So far doesn't seem to exist an answer so I created a work around. If anyone has a better work around please let me know. winActivate("Open") sleep($sleep) $n = 8 ;This is somewhat a "magic" number that can mess things up in my environment it was 8 Send("{TAB " & $n & "}") ;press tab $n times Sleep($sleep) ;only needed to select the first file if $Nitems = 0 Then sleep($sleep) send("{DOWN}") sleep($sleep) send ("{UP}") EndIf ; used to select the other items in the list if $Nitems > 0 Then sleep ($sleep) send ("{DOWN " & $Nitems & "}") sleep ($sleep) EndIf Link to comment Share on other sites More sharing options...
Shafayat Posted May 4, 2010 Share Posted May 4, 2010 You might prefer controlsend to send. I think it is more secure to use. [Not using this account any more. Using "iShafayet" instead] Link to comment Share on other sites More sharing options...
autoitaddicted Posted April 26, 2014 Share Posted April 26, 2014 http://www.purebasic.fr/english/viewtopic.php?f=17&t=51303&sid=94acbd61634c44f0a4288c838461a6bd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 26, 2014 Moderators Share Posted April 26, 2014 autoitaddicted,And just how is a PureBasic forum thread supposed to help? I see you have done the same thing here - please do not do it again unless you translate the code into AutoIt as well. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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