Hello, I hope someone would be able to assist with my problem.
I've been using a program for a while on Windows XP.
Now, we are switching to Windows 7 (32) and part of my scripts stopped working.
I found that anything related to _GUICtrlListView_ is giving me trouble.
The code to get the handle of the main window and the handle of the SysListView32 works.
The following examples are trying to find an "Issue Number" of a multicolumn ListView.
This example returns 0 (even when entering the handle manually and "Issue Number" exists).
Is the text "Issue Number" in the first column of the ListView? What version of AutoIt are you using? Can you post a short reproducer script that shows the problem? As it is now, it's hard to reproduce it without reinventing your code with no idea how you wrote it.
_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.
Sorry about that. Autoit v3.3.8.0 (Win7) v3.3.6.0 (WinXP) SciTE v2.28 Cisco Agent v8.0.2.200 (Program with ListView)
My scripts is actually about 2600 lines. This is the trimmed version of the part of my script giving the issue. This same script works fine in Windows XP (both 32bit). Tested script compiled under both XP and 7 using 3.3.6.0 and 3.3.8.0.
-Verified that $Agent is correct. Verified $list is correct. $Line returns 0. $Queue returns blank.
Plain Text
#include <Array.au3>
#include <Constants.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
$Agent = GetAgentHandle()
If Not @error Then
ConsoleWrite(@CRLF & $Agent)
$list = ControlGetHandle($Agent, "", "[CLASS:SysListView32; INSTANCE:2]")
If Not @error Then
ConsoleWrite(@CRLF & $list)
$Line = _GUICtrlListView_FindText($list, "CSQName")
$Queue = _GUICtrlListView_GetItemText($list, $Line, 1)
Else
TrayTip("Cisco Assistant", "Failed to Find ListView Handle.", 7, 17)
EndIf
Else
TrayTip("Cisco Assistant", "Failed to Find the Cisco Agent.", 7, 17)
EndIf
MsgBox(0,"",$Queue)
Func GetAgentHandle()
Local $Agent
$Agent = WinGetHandle("Reserved - Cisco Agent Desktop")
If @error Then
$Agent = WinGetHandle("Talking - Cisco Agent Desktop")
If @error Then
$Agent = WinGetHandle("Work - Cisco Agent Desktop")
If @error Then
$Agent = WinGetHandle("Ready - Cisco Agent Desktop")
If @error Then
$Agent = WinGetHandle("Not Ready - Cisco Agent Desktop")
If @error Then
$Agent = WinGetHandle("Cisco Agent Desktop")
EndIf
EndIf
EndIf
EndIf
EndIf
If $Agent = "" Then SetError(1)
Return $Agent
EndFunc ;==>GetAgentHandle
Please let me know if you have any thoughts or ideas. There has to be some difference between XP and Win7 when reading this ListView.
Edit: I've had time to test some more tonight and still no luck. I've tried changing "_GUICtrlListView_GetItemText" and "_GUICtrlListView_FindText" with "ControlListView". Still the same results. Works on XP but not Win7. Tried combinations of "Name or Handle" for the Window with "ClassnameNN or Handle or Advanced Info" for the Control.
Any other way of getting information from a ListView control?
Edit 2: ... I'm speachless ... The ammount I worked on this just to find the simplest solution is crazy. I went through every step of the _ListView_FindText() function and found the fault. I found that I was getting an access error in the internal memory function __Mem_OpenProcess(). This could only mean one thing.......... UAC.
#RequireAdmin seems to be the best rout to ensure a working script.