fxm Posted October 2, 2011 Posted October 2, 2011 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.
Zedna Posted October 2, 2011 Posted October 2, 2011 (edited) Post your problematic script and specify which part doesn't work. Edited October 2, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
fxm Posted October 2, 2011 Author Posted October 2, 2011 (edited) 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 October 2, 2011 by fxm
Ascend4nt Posted October 3, 2011 Posted October 3, 2011 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. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
fxm Posted October 3, 2011 Author Posted October 3, 2011 (edited) 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 October 3, 2011 by fxm
Ascend4nt Posted October 3, 2011 Posted October 3, 2011 I modified the code a bit so you can see how to select and deselect items. Check out My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
fxm Posted October 3, 2011 Author Posted October 3, 2011 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.
fxm Posted April 9, 2012 Author Posted April 9, 2012 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.]
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