 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Thu Sep 20, 2007 12:22 am Post subject: A_ListView or A_CurrentListView |
|
|
| ListView wrote: |
If the window has more than one ListView control, by default the functions operate upon the one most recently added. To change this, specify Gui, ListView, ListViewName, where ListViewName is the name of the ListView's associated variable or its ClassNN as shown by Window Spy. Once changed, all existing and future threads will use the indicated ListView.
|
It would be nice if this command updates a variable such as A_ListView (global) with the Hwnd of the current ListView so that I can do something like this (based on code from Skan):
| Code: |
;Lib\LV.ahk
LV_GetCol(Column=1, parameter="width"){
If (parameter = "width)
{
SendMessage, (LVM_GETCOLUMNWIDTH := 0x101D), (Column-1),0,, ahk_id %A_ListView%
Return ErrorLevel
}
}
|
I am slowly building a StdLib compatible collection of LV functions, and it would be nice to not have to pass the HWND, since all the built-in LV functions do not need it. (keeps the style nice), though I suppose for now I will do it the same way as the excellent LV Color changing script, which is alread in my library.
| Code: |
LV_ColorInitiate(Index_Column=1,Gui_Number=1, Control="SysListView321") ; initiate listview color change procedure
{
global hw_LV_ColorChange, LV_Index_Column
LV_Index_Column := Index_Column
Gui, %Gui_Number%:+Lastfound
Gui_ID := WinExist()
ControlGet, hw_LV_ColorChange, HWND,, %Control%, ahk_id %Gui_ID%
OnMessage( 0x4E, "WM_NOTIFY" )
}
|
_________________
(Common Answers) |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Sun Sep 23, 2007 1:12 pm Post subject: |
|
|
I agree.
I would preferable add another optional parameter to LV functions and frends, so I can say which ListView control is in question.
This is indeed very anoying aspect of AHK.
Acctually, it would be good v2 solve this general ahk problem about design that is practical or possible only for 1 control of particular class (Tab to be the worst case) _________________
 |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Feb 26, 2009 12:24 am Post subject: |
|
|
I agree whole-heartedly. The LV functions should accept a parameter indicating which listview in the script to operate on.
for instance, I propose:
LV_ADD("vMyListview","Value 1","Value 2")
instead of:
GUI, LISTVIEW, MyListview
LV_ADD("","Value 1","Value 2")
using the "global listview pointer" via gui,listview,mylistview is a serious headache for scripts that have settimers operating on many different listviews! you have to use critical on/off to guarantee that the "global listview pointer" does not get changed unexpectedly by another thread before the LV operations are complete.  |
|
| Back to top |
|
 |
UncleScrooge
Joined: 14 Apr 2009 Posts: 75 Location: Italy
|
Posted: Thu Dec 17, 2009 4:07 pm Post subject: |
|
|
Absolutely agreed.
not forgetting (btw):
A_TreeView _________________ Intel Centrino @ 2.8GHz
4 GB RAM
WIN XP SP3 |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Apr 21, 2010 6:54 pm Post subject: |
|
|
Up...
And, as a compromise to the thread-interrupt whatnot, I'll wish for: | Code: | | lv_hwnd := LV_GetHandle() |
, which puts the issue into a similar context as the other LV_*() functions. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|