Jump to content



Photo

no ListView with Win7 (32 or 64)

Windows 7 ListView Win7

  • Please log in to reply
2 replies to this topic

#1 CloudD901

CloudD901

    Seeker

  • Active Members
  • 14 posts

Posted 11 January 2012 - 09:59 AM

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).
$Line = _GUICtrlListView_FindText($list, "Issue Number")


This example returns blank (even when entering the handle and line manually).
$IssueNumber = _GUICtrlListView_GetItemText($list, $Line, 1)


Please let me know if any further information is needed.
I've tested this on x64 and 32 bit Win7.
Thanks!

Edited by cloudd901, 11 January 2012 - 10:00 AM.








#2 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 7,042 posts

Posted 11 January 2012 - 01:43 PM

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.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_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.

Posted Image


#3 CloudD901

CloudD901

    Seeker

  • Active Members
  • 14 posts

Posted 12 January 2012 - 04:32 AM

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


Posted Image
By cloudd901 at 2012-01-11

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. :)

Edited by cloudd901, 13 January 2012 - 06:40 AM.






Also tagged with one or more of these keywords: Windows 7, ListView, Win7

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users