Jump to content

Recommended Posts

Posted

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

Posted (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 by tironci
Posted

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.

Posted

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:

  On 9/11/2009 at 2:29 PM, 'weaponx said:

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.

:idea:

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
Posted

  On 4/28/2010 at 2:44 PM, 'zorphnog said:

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?

Posted

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
  • 3 years later...
  • Moderators
Posted

autoitaddicted,

And just how is a PureBasic forum thread supposed to help? :huh:

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...