Sign in to follow this  
Followers 0
Armand

_GUICtrlListView_SetItemParam - Effects the entire GUI ?!?

8 posts in this topic

hey guys,

As i have experienced this issue before and had to refrain from using the UDF listview functions because of it i know of these threads:

http://www.autoitscript.com/forum/index.ph...mp;#entry440033

http://www.autoitscript.com/forum/index.ph...mp;#entry449543

http://www.autoitscript.com/forum/index.ph...amp;hl=listview

Now, the solution in there is to change the $iParam to 0.

what if i later, after creating the table and filling it change the $iParam to some other numbers [0-9999...]

Will that generate the same bug we have "fixed" by changing $iParam to 0 in the first place ?!?

If so... will setting the $iParam to a very high number let's say 999999 or something else will help me evade this issue ?!?

P.S -> WHAT IS THE $iParam AND HOW IS IT EFFECT MY GUI ?! :)


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites



hey guys,

As i have experienced this issue before and had to refrain from using the UDF listview functions because of it i know of these threads:

http://www.autoitscript.com/forum/index.ph...mp;#entry440033

http://www.autoitscript.com/forum/index.ph...mp;#entry449543

http://www.autoitscript.com/forum/index.ph...amp;hl=listview

Now, the solution in there is to change the $iParam to 0.

what if i later, after creating the table and filling it change the $iParam to some other numbers [0-9999...]

Will that generate the same bug we have "fixed" by changing $iParam to 0 in the first place ?!?

If so... will setting the $iParam to a very high number let's say 999999 or something else will help me evade this issue ?!?

P.S -> WHAT IS THE $iParam AND HOW IS IT EFFECT MY GUI ?! :o

Download the current production version 3.3.0.0 and try it. If you have an issue, post a reproducer that we can run to see the problem.

:)


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

Share this post


Link to post
Share on other sites

Well... after checking it out... the problem does persist -> but using my idea [having the $iParam to something huge] bypasses that bug [or it seems so...]


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites

Well... after checking it out... the problem does persist -> but using my idea [having the $iParam to something huge] bypasses that bug [or it seems so...]

Please post the smallest symptomatic script you can so we can check it out and see if it belongs on the bug list.

:)


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

Share this post


Link to post
Share on other sites

Heh, stumbled upon this thread after i submitted the ticket ^^

Script to reproduce:

(click on Listviewitem 4 or 5)

#Include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GUIConstantsEx.au3>


Opt("GUIOnEventMode", 1)

$Gui = GUICreate("LV Test", 750, 590, 191, 113)

    $Guiplist1 = GUICtrlCreateListView("Name                                                |Score|Kills", 8, 120, 121*3, 431, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS), BitOR($LVS_EX_HEADERDRAGDROP, $LVS_EX_FULLROWSELECT,$LVS_EX_GRIDLINES,$LVS_EX_DOUBLEBUFFER,$LVS_EX_SUBITEMIMAGES))
        
        _GUICtrlListView_AddItem($Guiplist1, "TestItem1 with param 1",-1,1)
        _GUICtrlListView_AddItem($Guiplist1, "TestItem2 with param 2",-1,2)
        _GUICtrlListView_AddItem($Guiplist1, "TestItem3 with param 3",-1,3)
        _GUICtrlListView_AddItem($Guiplist1, "TestItem4 with param 4",-1,4)
        _GUICtrlListView_AddItem($Guiplist1, "TestItem5 with param 5",-1,5)
        _GUICtrlListView_AddItem($Guiplist1, "TestItem6 with param 0",-1,0)
        _GUICtrlListView_AddItem($Guiplist1, "TestItem7 with param 10",-1,10)
        
        $Butt1 = GUICtrlCreateButton("Test Button 1",8,90,120,20)
        GUICtrlSetOnEvent(-1,"TestB1")
        $Butt2 = GUICtrlCreateButton("Test Button 2",8+130,90,120,20)
        GUICtrlSetOnEvent(-1,"TestB2")
        $Butt3 = GUICtrlCreateButton("Test Button 3",8+130*2,90,120,20)
        GUICtrlSetOnEvent(-1,"TestB3")
        $Butt4 = GUICtrlCreateButton("Test Button 4",8+130*3,90,120,20)
        GUICtrlSetOnEvent(-1,"TestB4")
        
    
        ConsoleWrite($Butt1&","&$Butt2&","&$Butt3&","&$Butt4& @CRLF)
        
GUISetOnEvent($Gui_EVENT_CLOSE, "Close", $Gui)

GUISetState()

ConsoleWrite("SetText: "& ControlSetText ( $gui, "", 10 ,"test") & @CRLF) ; just to show that it only affects GUICtrlSetOnEvent


Func Close()
    Exit
EndFunc


While 1
    Sleep(10)
WEnd



Func TestB1()
    ConsoleWrite("Button1 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
EndFunc

Func TestB2()
    ConsoleWrite("Button2 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
EndFunc

Func TestB3()
    ConsoleWrite("Button3 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
EndFunc

Func TestB4()
    ConsoleWrite("Button4 Click from CtrlID: "& @GUI_CtrlId & @CRLF)
EndFunc

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite

Share this post


Link to post
Share on other sites

wow fast answer:

Changed 4 hours ago by Gary

* status changed from new to closed

* resolution set to No Bug

Not a bug, Application defined data is just that, you need to make sure that if you use lparam to start at a number higher than any control already created to not have the same application defined data value.

Changed 4 hours ago by Gary

see the example2 for _GUICtrlListView_RegisterSortCallBack in the help file

so (like Armand already said) adding a high number for $iParam is a safe way to go:

Local $iIndex = _GUICtrlListView_AddItem($hWnd, $aItem[1], $aIcons[0] + $iPlus, _GUICtrlListView_GetItemCount($hWnd) + 9999)

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite

Share this post


Link to post
Share on other sites

wow fast answer:

so (like Armand already said) adding a high number for $iParam is a safe way to go:

Local $iIndex = _GUICtrlListView_AddItem($hWnd, $aItem[1], $aIcons[0] + $iPlus, _GUICtrlListView_GetItemCount($hWnd) + 9999)
I think what Gary was trying to indicate was that the parameter is interpreted by the application. In the case of an AutoIt ListViewItem, the application is the AutoIt interpreter, not your script. By messing with that parameter, you are messing with AutoIt's use of it (to track item control IDs).

:D


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

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  
Followers 0