Jump to content
Sign in to follow this  
fxm

Win7/64 compatibility problems

Recommended Posts

fxm

I have an existing script which works properly in XP and Vista.

In Win7/64 [i chose the "64" option at Autoit install time] a couple of functions I use appear not to work.

The most basic problem appears to be that folder displays are very different in Win7/64. For starters, according to AutoitWindowInfo a SysListView control no longer exists in the window.

I half expected that SysListView32 would be gone but I can't even see what - if anything - has replaced it, let alone how to interact with the replacement. [Expecting to see SysListView64 was evidently too naive by half.]

Can someone give me a pointer to a relevant thread? I haven't had much luck searching this forum for "windows7" and similar.

Share this post


Link to post
Share on other sites
fxm

Post your problematic script

This

$sWDF = StringMid(@WorkingDir, 1 + StringInStr(@WorkingDir, "\", 0, -1))
$iRtn = ShellExecute(@WorkingDir)

works on all platforms. A directory list for the folder ["GAMEFILE" in this case] is opened in a new window.

This

WinWait($sWDF, "FolderView")
If Not WinActive($sWDF, "FolderView") Then WinActivate($sWDF, "FolderView")
WinWaitActive($sWDF, "FolderView")

fails in Win7/64 because the string "FolderView" is not found.

Changing that to "ShellView" [the string which is actually present]

WinWait($sWDF, "ShellView")
If Not WinActive($sWDF, "ShellView") Then WinActivate($sWDF, "ShellView")
WinWaitActive($sWDF, "ShellView")

works [sets the focus as expected].

Now we come to

$sNew = "110930A.HTM"
$iIdx = ControlListView($sWDF, "ShellView", "SysListView321", "FindItem", $sNew)

the minimal failing case.

The essential problem at this level is that there is no "SysListView" control of any kind anywhere in the window.

The part of the window containing the filelist has [as reported by AutoitWindowInfor] a ClassnameNN of DirectUIHWND3 but taking a wild guess and making the rote substitution

$iIdx = ControlListView($sWDF, "ShellView", "DirectUIHWND3", "FindItem", $sNew)

doesn't return the expected value [not much of a surpise].

Edited by fxm

Share this post


Link to post
Share on other sites
Ascend4nt

This isn't related specifically to x64, but there is a solution in this thread: Check the previous posts to understand what it does and what it returns. :graduated:

Share this post


Link to post
Share on other sites
fxm

understand what it does and what it returns

What it returns seems obvious.

Unless I'm missing something, what it does is read-only. For example, it doesn't emulate

ControlListView($sWDF, "FolderView", "SysListView321", "SelectClear")
or

ControlListView($sWDF, "FolderView", "SysListView321", "Select", $iIdx)

Now that I know what to search for, I am finding discussions about the transition to DirectUIHWND.

Perhaps I can solve my problems with ControlSend() or equivalent.

Edited by fxm

Share this post


Link to post
Share on other sites
Ascend4nt

I modified the code a bit so you can see how to select and deselect items. Check out

Share this post


Link to post
Share on other sites
fxm

how to select and deselect items.

Check out

Awesome!

Unfortunately the problem application is on a client's PC which I can't access at the moment. If it weren't for that, I would be testing up a storm right now.

I'll report back as soon as I can.

Thanks.

Share this post


Link to post
Share on other sites
fxm

I modified the code a bit so you can see how to select and deselect items. Check out

Using your example and references [thanks again!] I was able to port the basic functions from SysListView32 to DirectUIHWND - while learning a lot about objects and something about the shell.

Now, however, the scope of the task I am automating has changed and I am feeling the [apparent] lack of some SysListView32 methods that I had taken for granted would be available somewhere in the DirectUIHWND environment.

The clearest example of these is the "FindItemWithText()" method - implemented in ControlListView() as the "FindItem" 'command'. Before I try to implement such a function by brute force [iterating the FolderItems collection and applying ParseName()] can you confirm for me that there is no more straightforward way? [i had enough difficulty navigating the MSDN documentation for the objects I need to access for each method I want to use that I wouldn't be at all surprised to learn that I have missed something very simple.]

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×