Jump to content

Auto3Lib


PaulIA
 Share

Recommended Posts

Very cool! Everything works as it should now! :whistle: Thanks a lot for your help on this one.

Ok, I have a few meta questions regarding your choice to depend on $WM_COMMAND (or the like) and GUIRegisterMsg in your mainloop. First of all, why not use GUIOnEventMode (thereby avoiding having long switch loops..etc.)? Secondly, as far as I understand having code in the mainloop with no Sleep() should be causing, somewhat, rampant CPU usage.. I can see in my task manager that your scripts doesn't.. how/why?

I know the answers are probably somewhat obvious.. still, manages to intrigue me..

EDIT: Starting to get it, first of all it is possible to use GUIOnEventMode just fine & the use of switch statements alongside with GUIRegisterMsg makes it much more transparent to understand and work with Windows' systemcalls overall! (dont i just love it when i answer my own semi ignorant questions) :D

and..

I tried googling for "bmp versus background transparency" (and various permutations) - there's a LOT of stuff on how to set a color to transparency within C++ and so forth.. very little on setting bmp background transparency directly from an image editor.. I have both Paint Shop Pro and Photoshop but seem unable to get either to save with a transparent background? This is getting extensive.. now, also.. is there a way to NOT have the bmp files be color-inverted when the mouse cursor hovers over them?

EDIT2: Found out that the [Optional] style of _Menu_CreateMenu & _Menu_CreatePopup can be set to a inofficial "15" with quite nice effects - adds a bit of space so the icon is moved a few pixels away from the text and trims a little more space than "16" on the left..!

I found the problem with the menu code. I have a script that compiles the Auto3Lib releases and I had a typo for the menu file name. That's what I get for changing things. :P

IFAIK, the menu image commands only work on bitmaps. You can make a bitmap with a transparent background though. Do a Google and you'll find a ton of hits on how to do this with your favorite image editor.

The default menu is created with space for a checkbox. If you want a slim menu, just change the value that you pass to _Menu_CreateMenu like this:

#include <A3LMenu.au3>

Opt("MustDeclareVars", 1)

Global $hGUI, $hFile, $hMain

$hGUI  = GUICreate("Menu Test", 400, 300)
$hFile = _Menu_CreateMenu(24)
_Menu_AddMenuItem($hFile, 0, "&New"  , 1000)
_Menu_AddMenuItem($hFile, 1, "&Open" , 1001)
_Menu_AddMenuItem($hFile, 2, "&Save" , 1002)
_Menu_AddMenuItem($hFile, 3, ""      , 0   )
_Menu_AddMenuItem($hFile, 4, "E&xit" , 1003)

_Menu_SetItemBmp($hFile, 2, _Lib_LoadBitmap(@ScriptDir & "\Blue.bmp"))

$hMain = _Menu_CreateMenu(24)
_Menu_AddMenuItem($hMain, 0, "&File", 0, $hFile)

_Menu_SetMenu($hGUI, $hMain)

GUISetState()

do
until GUIGetMsg() = $GUI_EVENT_CLOSE

If you want it really slim, remove the _Menu_SetItemBmp line.

Edited by Sunaj
Link to comment
Share on other sites

When using AUTO3lib in conjunction with ANYGUI

when compiling

C:\PROGRA~1\AutoIt3\Include\A3LConstants.au3 (762) : ==> Can not redeclare a constant.:

Global Const $SWP_NOSIZE = 0x0001

In anygui ligne 1003

Const $SWP_NOMOVE = 0x0002, $SWP_NOSIZE = 0x0001, $SWP_NOZORDER = 0x0004, $SWP_FRAMECHANGED = 0x0020

Link to comment
Share on other sites

Ok, I have a few meta questions regarding your choice to depend on $WM_COMMAND (or the like) and GUIRegisterMsg in your mainloop. First of all, why not use GUIOnEventMode (thereby avoiding having long switch loops..etc.)? Starting to get it, first of all it is possible to use GUIOnEventMode just fine & the use of switch statements alongside with GUIRegisterMsg makes it much more transparent to understand and work with Windows' system calls overall! (dont i just love it when i answer my own semi ignorant questions)

You got it. The switch statements allow me to handle all of the notification events in a unified manner. If you look at the ones for the controls, you'll see that they check to see if the notification is for the control and if not, they pass the message on to a default notification handler in A3LLibrary. Just makes it easier for demos and debugging.

Secondly, as far as I understand having code in the mainloop with no Sleep() should be causing, somewhat, rampant CPU usage.. I can see in my task manager that your scripts doesn't.. how/why?

Jon is a pretty smart cookie. He programmed the GUIGetMsg function with a built in CPU idle. Check the helpfile for more info.

I tried googling for "bmp versus background transparency" (and various permutations) - there's a LOT of stuff on how to set a color to transparency within C++ and so forth.. very little on setting bmp background transparency directly from an image editor.. I have both Paint Shop Pro and Photoshop but seem unable to get either to save with a transparent background?

I used MS Paint, cleared the "Draw as Opaque" flag and it appears to work. You just need to make sure you don't "flood" the bitmap background with a solid color or it won't be transparent. If you can't get it to work, PM me with an email address and I'll send you a sample.

is there a way to NOT have the bmp files be color-inverted when the mouse cursor hovers over them?

Sure. Instead of this line:

_Menu_SetItemBmp($hFile, 2, _Lib_LoadBitmap(@ScriptDir & "\Blue.bmp"))oÝ÷ ÙK¶¬jëh×6Global $hBmp
...
$hBMP = _Lib_LoadBitmap(@ScriptDir & "\Blue.bmp")
_Menu_SetItemBitmaps($hEdit, 2, $hBmp, $hBmp)

Found out that the [Optional]style of _Menu_CreateMenu & _Menu_CreatePopup can be set to a inofficial "15" with quite nice effects - adds a bit of space so the icon is moved a few pixels away from the text and trims a little more space than "16" on the left..!

Worked out your own problem. Big "two thumbs up" from the Auto3Lib development team. :whistle: Seriously, nice work. :P Edited by PaulIA
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

When using AUTO3lib in conjunction with ANYGUI

when compiling

C:\PROGRA~1\AutoIt3\Include\A3LConstants.au3 (762) : ==> Can not redeclare a constant.:

Global Const $SWP_NOSIZE = 0x0001

In anygui ligne 1003

Const $SWP_NOMOVE = 0x0002, $SWP_NOSIZE = 0x0001, $SWP_NOZORDER = 0x0004, $SWP_FRAMECHANGED = 0x0020

The constants are delcared in ANYGUI as well as Auto3Lib. You'll need to remove them from ANYGUI if you use them in conjunction with Auto3Lib.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Damn, that is some nice lib! I was looking for toolbar functions, yeah saved me _O_ :whistle:

Thanks for the feedback. Auto3Lib is a big animal, but feel free to post here if you have any questions/problems.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I'm having trouble seeing the problem on this one. If _Toolbar_FindToolbar fails, it should set @Error to a negative value and return 0 for the Toolbar handle. Are you saying that this isn't the case in your situation? It may be finding the "&File" string in another Toolbar, which is a possiblity.

...

So it must be something else that we're not seeing. Can you revert back to the orginal code and see what value _Toolbar_FindToolbar returns? Is it 0 and @Error is negative or is it the handle to your Flash toolbar and @Error is 0?

Thanks for working with me on this.

Paul sorry if I wasn't clear on this, but it's not _Toolbar_FindToolbar that returns a zero, it's the call to 'get button text' that returns a zero to be tested against '&File'

The function call to _Toolbar_GetButtonText($hToolbar, $iCommandID) returns these 'FlashGet' toolbar buttons.

$iCommandID : $bText (tooltip)

[0] 61419 : FlashGet (Run FlashGet)

[1] 32786 : Options (Change options)

[2] 32786 : Options (Change options)

[3] 61347 : 0 (Find)

[4] 61420 : 0 (Drag and drop links here)

[5] 61398 : 0 (Site Explorer)

[6] 61367 : 0 (Download all by flashget)

[7] 32796 : 0 (Goto the FlashGet home page)

And ("&File" = 0 = True, so naturally _Toolbar_FindToolbar returns the incorrect toolbar handle.

Link to comment
Share on other sites

Paul sorry if I wasn't clear on this, but it's not _Toolbar_FindToolbar that returns a zero, it's the call to 'get button text' that returns a zero to be tested against '&File'

The function call to _Toolbar_GetButtonText($hToolbar, $iCommandID) returns these 'FlashGet' toolbar buttons.

$iCommandID : $bText (tooltip)

[0] 61419 : FlashGet (Run FlashGet)

[1] 32786 : Options (Change options)

[2] 32786 : Options (Change options)

[3] 61347 : 0 (Find)

[4] 61420 : 0 (Drag and drop links here)

[5] 61398 : 0 (Site Explorer)

[6] 61367 : 0 (Download all by flashget)

[7] 32796 : 0 (Goto the FlashGet home page)

And ("&File" = 0 = True, so naturally _Toolbar_FindToolbar returns the incorrect toolbar handle.

Doh! Sorry, I see what you're saying now. If you take out the last line of _Toolbar_GetButtonText and replace it with:

Local $sText = _tagGetData($tBuffer, 1)
  if not IsString($sText) then $sText = ""
  Return $sText
Does that fix the problem you're seeing?
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Doh! Sorry, I see what you're saying now. If you take out the last line of _Toolbar_GetButtonText and replace it with:

Local $sText = _tagGetData($tBuffer, 1)
  if not IsString($sText) then $sText = ""
  Return $sText
Does that fix the problem you're seeing?
Thanks Paul, that fixed the problem. :whistle:

Knew the problem was tied-up (somehow) with _tag...? but lacked sufficient competence to understand it, hence my inelegant workaround :P

Thanks again.

-Greg

Link to comment
Share on other sites

Thanks Paul, that fixed the problem. :whistle:

Knew the problem was tied-up (somehow) with _tag...? but lacked sufficient competence to understand it, hence my inelegant workaround :P

Thanks again.

-Greg

No problem. Thank you for being patient with working through the solution.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

PaulIA

Wow! this is realy usefull libary! Thank you for it!

I decided to make an installer for it, in that way it will be much easy for newbs to understand it and use it:

Here is a script (in attachments), you must put it to the folder with Auto3Lib to work.

It's copy needed files, includes, help, and in the end it ask for put some shortcuts to desktop and quick luanch panel. And then it execute the help file and open the examples folder :whistle:

Hope you like it :P

Au3Lib_Installer.au3

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

PaulIA

Wow! this is realy usefull libary! Thank you for it!

I decided to make an installer for it, in that way it will be much easy for newbs to understand it and use it:

Here is a script (in attachments), you must put it to the folder with Auto3Lib to work.

It's copy needed files, includes, help, and in the end it ask for put some shortcuts to desktop and quick luanch panel. And then it execute the help file and open the examples folder :whistle:

Hope you like it :P

Thanks for the feedback (and the installation script). I have been playing around with making a Wise installer for Auto3Lib, but it's a few notches down on the "to do" list. Thanks for putting in the work on this.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

i'm working on the listview of the library

everything ok, but i don't find any way to add a group to a listview

how to do that ?

keep up the good work

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

i'm working on the listview of the library

everything ok, but i don't find any way to add a group to a listview

how to do that ?

keep up the good work

In order to set the GroupID on an item, you need to use the _ListView_SetItemEx function. It's (currently) missing from the help file, but it's there. You'll also need to use _ListView_EnableGroupView and possibly _ListView_SetGroupInfo and _ListView_SetGroupMetrics.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

ok thx for the answer !!

i'll try this XD

edit :

mmm ok for the modification, but how to do to create a group ?

i've found the insertgroup message, but i don't know if it's the way

can you provide an example ? i'm totally lost

edit2 : ok i did it with the insertgroup message

i send you my example asap (if you want)

after the group is inserted you can play with the setgroupinfo & metrics

that's really excellent and listviews looks better XD

edit 3 : Added functions to add groups to listviews

hope you'll like it Paul

first, the example updated

ok ok sorry but there is still this bug of attached file

i'll try another way to post it

added _ListView_InsertGroup

a _ListView_ItemAssignGroup

#include <A3LImageList.au3>
#include <A3LListView.au3>
Opt("MustDeclareVars", 1)
; =================================================================================================
; Description ...: ListView test script
; Author ........: Paul Campbell (PaulIA)
; Notes .........:
; =================================================================================================
; =================================================================================================
; Global constants
; =================================================================================================
Global $cMaxX = 500                   ; Maximum GUI width allowed
Global $cMaxY = 400                   ; Maximum GUI height allowed
; =================================================================================================
; Global variables
; =================================================================================================
Global $hGUI, $iGUIH, $iGUIW, $hList, $hImage
; =================================================================================================
; Main
; =================================================================================================
CreateGUI()
SetColors()
AddImages()
AddColumns()
AddItems()
ShowListView()
ShowColumns()
ShowItems()
MsgLoop()
; =================================================================================================
; This function adds columns to the control
; =================================================================================================
Func AddColumns()
    _ListView_InsertColumn ($hList, 0, "Column 1", 100, "left", 0)
    _ListView_InsertColumn ($hList, 1, "Column 2", 100, "left", 1)
    _ListView_InsertColumn ($hList, 2, "Column 3", 100, "left", 2, True)
EndFunc   ;==>AddColumns
; =================================================================================================
; This function adds images to the control.  You can use icons or bitmaps for images
; =================================================================================================
Func AddImages()
    $hImage = _ImageList_Create ()
    _ImageList_AddBitmap ($hImage, @ScriptDir & "\Images\Blue.bmp")
    _ImageList_AddIcon ($hImage, @ScriptDir & "\Images\Green.ico")
    _ImageList_AddBitmap ($hImage, @ScriptDir & "\Images\Red.bmp")
    _ListView_SetImageList ($hList, $hImage, 1)
EndFunc   ;==>AddImages
; =================================================================================================
; This function adds items to the control
; =================================================================================================
Func AddItems()


    _ListView_EnableGroupView ($hList, True)
    ;   _ListView_SetGroupInfo($hList,-1,"Test Group 1")
    ;_ListView_SetGroupMetrics($hList, 2, 2, 2, 2, 0x00ff00, 0x00ff00, 0x00ff00, 0x00ff00, 0xff0000, 0x0000ff)
    ConsoleWrite(_ListView_InsertGroup($hList,1,"Test Group 1") & @CRLF)
    ConsoleWrite(_ListView_InsertGroup($hList,2,"Test Group 2") & @CRLF)
    ;_ListView_AddGroup($hList,"Test Group 1")
    _ListView_AddItem ($hList, 0, "Row 1: Col 1", 0)
    _ListView_AddSubItem ($hList, 0, "Row 1: Col 2", 1)
    _ListView_AddSubItem ($hList, 0, "Row 1: Col 3", 2)
    _ListView_AddItem ($hList, 1, "Row 2: Col 1", 1)
    _ListView_AddSubItem ($hList, 1, "Row 2: Col 2", 1)
    _ListView_AddItem ($hList, 2, "Row 3: Col 1", 2)
    _ListView_ItemAssignGroup($hList,0,0,1)
    _ListView_ItemAssignGroup($hList,1,0,2)
    _ListView_ItemAssignGroup($hList,2,0,2)
    _ListView_SetGroupMetrics($hList,bitor($LVGMF_BORDERSIZE,$LVGMF_BORDERCOLOR,$LVGMF_TEXTCOLOR), 1, 1, 1, 1, $CLR_PURPLE, $CLR_PURPLE, $CLR_PURPLE, $CLR_YELLOW, $CLR_BLUE, $CLR_PURPLE)
EndFunc   ;==>AddItems

; =================================================================================================
; This function creates the GUI interface
; =================================================================================================
Func CreateGUI()
    $hGUI = GUICreate("ListView Test GUI", 400, 300, -1, -1, $WS_SIZEBOX)
    $hList = _ListView_Create ($hGUI, 2, 2, 394, 268)
    GUISetState()
EndFunc   ;==>CreateGUI
; =================================================================================================
; This function just loops until you exit the program. It also shows how to intercept the notification
; messages from the control and how to handle resizing.
; =================================================================================================
Func MsgLoop()
    $iGUIH = _API_GetClientHeight ($hGUI)
    $iGUIW = _API_GetClientWidth ($hGUI)
    GUIRegisterMsg($WM_SIZE, "WM_SIZE")
    GUIRegisterMsg($WM_SIZING, "WM_SIZING")
    GUIRegisterMsg($WM_NOTIFY, "_ListView1_WM_NOTIFY")
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>MsgLoop
; =================================================================================================
; This function sets the control colors
; =================================================================================================
Func SetColors()
    _ListView_SetBkColor ($hList, $CLR_MONEYGREEN)
    _ListView_SetTextBkColor ($hList, $CLR_MONEYGREEN)
EndFunc   ;==>SetColors
; =================================================================================================
; Show parameters related to the ListView
; =================================================================================================
Func ShowListView()
    Local $aRect, $aTest
    $aRect = _ListView_GetViewRect ($hList)
    $aTest = _ListView_HitTest ($hList, 40, 40)
    _Lib_ConsoleWrite ("Approximate view rect height .: " & _ListView_ApproximateViewHeight ($hList))
    _Lib_ConsoleWrite ("Approximate view rect width ..: " & _ListView_ApproximateViewWidth ($hList))
    _Lib_ConsoleWrite ("Callback mask ................: " & _ListView_GetCallbackMask ($hList))
    _Lib_ConsoleWrite ("Color (background) ...........: " & _ListView_GetBkColor ($hList))
    _Lib_ConsoleWrite ("Color (text) .................: " & _ListView_GetTextColor ($hList))
    _Lib_ConsoleWrite ("Color (text background) ......: " & _ListView_GetTextBkColor ($hList))
    _Lib_ConsoleWrite ("Count per page ...............: " & _ListView_GetCountPerPage ($hList))
    _Lib_ConsoleWrite ("Edit control .................: " & _ListView_GetEditControl ($hList))
    _Lib_ConsoleWrite ("Extended styles ..............: " & _ListView_GetExtendedListViewStyle ($hList))
    _Lib_ConsoleWrite ("Group view enabled ...........: " & _ListView_GetGroupViewEnabled ($hList))
    _Lib_ConsoleWrite ("Header columns ...............: " & _ListView_GetColumnCount ($hList))
    _Lib_ConsoleWrite ("Header handle ................: " & _ListView_GetHeader ($hList))
    _Lib_ConsoleWrite ("HitTest: Item ................: " & $aTest[0])
    _Lib_ConsoleWrite ("HitTest: Over control ........: " & $aTest[1])
    _Lib_ConsoleWrite ("HitTest: Over icon ...........: " & $aTest[2])
    _Lib_ConsoleWrite ("HitTest: Over text ...........: " & $aTest[3])
    _Lib_ConsoleWrite ("HitTest: Over image ..........: " & $aTest[4])
    _Lib_ConsoleWrite ("HitTest: Over item ...........: " & $aTest[5])
    _Lib_ConsoleWrite ("HitTest: Above client area ...: " & $aTest[6])
    _Lib_ConsoleWrite ("HitTest: Below client area ...: " & $aTest[7])
    _Lib_ConsoleWrite ("HitTest: Left of client area .: " & $aTest[8])
    _Lib_ConsoleWrite ("HitTest: Right of client area : " & $aTest[9])
    _Lib_ConsoleWrite ("Hot cursor handle ............: " & _ListView_GetHotCursor ($hList))
    _Lib_ConsoleWrite ("Hot item index ...............: " & _ListView_GetHotItem ($hList))
    _Lib_ConsoleWrite ("Hover time (milliseconds) ....: " & _ListView_GetHoverTime ($hList))
    _Lib_ConsoleWrite ("Image list (large) ...........: " & _ListView_GetImageList ($hList, 0))
    _Lib_ConsoleWrite ("Image list (small) ...........: " & _ListView_GetImageList ($hList, 1))
    _Lib_ConsoleWrite ("Image list (state) ...........: " & _ListView_GetImageList ($hList, 2))
    _Lib_ConsoleWrite ("Insert mark color ............: " & _ListView_GetInsertMarkColor ($hList))
    _Lib_ConsoleWrite ("ISearch String ...............: " & _ListView_GetISearchString ($hList))
    _Lib_ConsoleWrite ("Item count ...................: " & _ListView_GetItemCount ($hList))
    _Lib_ConsoleWrite ("Item nearest point 0, 0 ......: " & _ListView_FindNearest ($hList, 0, 0))
    _Lib_ConsoleWrite ("Item spacing (horizontal) ....: " & _ListView_GetItemSpacingHorz ($hList))
    _Lib_ConsoleWrite ("Item spacing (vertical) ......: " & _ListView_GetItemSpacingVert ($hList))
    _Lib_ConsoleWrite ("Number of work areas..........: " & _ListView_GetNumberOfWorkAreas ($hList))
    _Lib_ConsoleWrite ("Origin (X position) ..........: " & _ListView_GetOriginX ($hList))
    _Lib_ConsoleWrite ("Origin (Y position) ..........: " & _ListView_GetOriginY ($hList))
    _Lib_ConsoleWrite ("Outline color ................: " & _ListView_GetOutlineColor ($hList))
    _Lib_ConsoleWrite ("Selected column ..............: " & _ListView_GetSelectedColumn ($hList))
    _Lib_ConsoleWrite ("Selected count ...............: " & _ListView_GetSelectedCount ($hList))
    _Lib_ConsoleWrite ("Selection mark ...............: " & _ListView_GetSelectionMark ($hList))
    _Lib_ConsoleWrite ("String width of 'AutoIt' .....: " & _ListView_GetStringWidth ($hList, "AutoIt"))
    _Lib_ConsoleWrite ("ToolTips handle ..............: " & _ListView_GetToolTips ($hList))
    _Lib_ConsoleWrite ("Top Index ....................: " & _ListView_GetTopIndex ($hList))
    _Lib_ConsoleWrite ("Unicode ......................: " & _ListView_GetUnicodeFormat ($hList))
    _Lib_ConsoleWrite ("View .........................: " & _ListView_GetView ($hList))
    _Lib_ConsoleWrite ("View: Details ................: " & _ListView_GetViewDetails ($hList))
    _Lib_ConsoleWrite ("View: Large ..................: " & _ListView_GetViewLarge ($hList))
    _Lib_ConsoleWrite ("View: List ...................: " & _ListView_GetViewList ($hList))
    _Lib_ConsoleWrite ("View: Small ..................: " & _ListView_GetViewSmall ($hList))
    _Lib_ConsoleWrite ("View: Tile ...................: " & _ListView_GetViewTile ($hList))
    _Lib_ConsoleWrite ("View rectangle ...............: [" & $aRect[1] & ", " & $aRect[2] & ", " & $aRect[3] & ", " & $aRect[4] & "]")
    _Lib_ConsoleWrite ()
EndFunc   ;==>ShowListView
; =================================================================================================
; Show information about the ListView columns
; =================================================================================================
Func ShowColumns()
    Local $iI, $sCol, $aColumn
    For $iI = 0 To _ListView_GetColumnCount ($hList) - 1
        $aColumn = _ListView_GetColumn ($hList, $iI)
        $sCol = "Column " & $iI & " "
        _Lib_ConsoleWrite ($sCol & "result ..............: " & $aColumn[0])
        _Lib_ConsoleWrite ($sCol & "alignment ...........: " & $aColumn[1])
        _Lib_ConsoleWrite ($sCol & "displays image ......: " & $aColumn[2])
        _Lib_ConsoleWrite ($sCol & "bitmap on right .....: " & $aColumn[3])
        _Lib_ConsoleWrite ($sCol & "header has image ....: " & $aColumn[4])
        _Lib_ConsoleWrite ($sCol & "width ...............: " & $aColumn[5])
        _Lib_ConsoleWrite ($sCol & "text ................: " & $aColumn[6])
        _Lib_ConsoleWrite ($sCol & "subitem index .......: " & $aColumn[7])
        _Lib_ConsoleWrite ($sCol & "image index .........: " & $aColumn[8])
        _Lib_ConsoleWrite ($sCol & "order ...............: " & $aColumn[9])
        _Lib_ConsoleWrite ()
    Next
EndFunc   ;==>ShowColumns
; =================================================================================================
; Show information about the items in the ListView
; =================================================================================================
Func ShowItems()
    Local $iI, $sItem, $aPos, $aRect
    For $iI = 0 To _ListView_GetItemCount ($hList) - 1
        $aRect = _ListView_GetItemRect ($hList, $iI)
        $sItem = "Item " & $iI & " "
        _Lib_ConsoleWrite ($sItem & "ID ..................: " & _ListView_MapIndexToID ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "image index .........: " & _ListView_GetItemImage ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "indent ..............: " & _ListView_GetItemIndent ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "is cut ..............: " & _ListView_GetItemCut ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "is drop hilited .....: " & _ListView_GetItemDropHilited ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "is focused ..........: " & _ListView_GetItemFocused ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "is selected .........: " & _ListView_GetItemSelected ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "next item index .....: " & _ListView_GetNextItem ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "param data ..........: " & _ListView_GetItemParam ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "position X ..........: " & _ListView_GetItemPositionX ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "position Y ..........: " & _ListView_GetItemPositionY ($hList, $iI))
        _Lib_ConsoleWrite ($sItem & "rectangle ...........: [" & $aRect[1] & ", " & $aRect[2] & ", " & $aRect[3] & ", " & $aRect[4] & "]")
        _Lib_ConsoleWrite ($sItem & "text ................: " & _ListView_GetItemText ($hList, $iI))
        _Lib_ConsoleWrite ()
    Next
EndFunc   ;==>ShowItems
; =================================================================================================
; The AutoIt GUICtrlSetResizing doesn't work on "true" Windows controls.  You can  handle  resizing
; any controls not created in AutoIt by doing something like the following.
; =================================================================================================
Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam)
    Local $iNewH, $iNewW, $iDltH, $iDltW, $iConH, $iConW
    ; Get the new GUI size
    $iNewW = _Lib_LoWord ($ilParam)
    $iNewH = _Lib_HiWord ($ilParam)
    ; Get the delta change in the GUI size
    $iDltW = $iNewW - $iGUIW
    $iDltH = $iNewH - $iGUIH
    ; Resize the control
    $iConW = _API_GetWindowWidth ($hList) + $iDltW
    $iConH = _API_GetWindowHeight ($hList) + $iDltH
    _API_SetWindowPos ($hList, 0, 0, 0, $iConW, $iConH, BitOR($SWP_NOMOVE, $SWP_NOZORDER))
    ; Update GUI size variables
    $iGUIW = $iNewW
    $iGUIH = $iNewH
    ; Make sure we let AutoIt receive the message too
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_SIZE
; =================================================================================================
; This function shows how you can limit the size of your GUI
; =================================================================================================
Func WM_SIZING($hWnd, $iMsg, $iwParam, $ilParam)
    Local $iHeight, $iX, $iY, $iWidth, $rRect
    ; lParam points to a rectangle, in screen coordinates, of the drag rectangle
    $rRect = DllStructCreate("int;int;int;int", $ilParam)
    $iX = DllStructGetData($rRect, 1)
    $iY = DllStructGetData($rRect, 2)
    $iWidth = DllStructGetData($rRect, 3) - $iX
    $iHeight = DllStructGetData($rRect, 4) - $iY
    ; Check to see if the GUI is being sized beyond what we want
    If $iWidth > $cMaxX Then DllStructSetData($rRect, 3, $iX + $cMaxX)
    If $iHeight > $cMaxY Then DllStructSetData($rRect, 4, $iY + $cMaxY)
    ; Make sure we let AutoIt receive the message too
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_SIZING
;
;
Func _ListView1_WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $tNMHDR, $hFrom, $iID, $iCode
    $tNMHDR = _tagNMHDR ($ilParam)
    $hFrom = _tagGetData ($tNMHDR, "hWndFrom")
    $iID = _tagGetData ($tNMHDR, "IDFrom")
    $iCode = _tagGetData ($tNMHDR, "Code")
    Select
        Case _Lib_WM_NOTIFY_EX ("TVN_SELCHANGING", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ITEMCHANGING", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ITEMCHANGED", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_INSERTITEM", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_DELETEITEM", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_DELETEALLITEMS", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINLABELEDIT", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ENDLABELEDIT", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_COLUMNCLICK", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINDRAG", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINRDRAG", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODCACHEHINT", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ITEMACTIVATE", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODSTATECHANGED", $hFrom, $iID, $iCode)
            ;case _Lib_WM_NOTIFY_EX("LVN_HOTTRACK"       , $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_GETDISPINFO", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_SETDISPINFO", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODFINDITEM", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINLABELEDITW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ENDLABELEDITW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_GETDISPINFOW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_SETDISPINFOW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODFINDITEMW", $hFrom, $iID, $iCode)
        Case Else
            _Lib_WM_NOTIFY ($hWnd, $iMsg, $iwParam, $ilParam)
    EndSelect
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_ListView1_WM_NOTIFY

updated A3LListview :

#include-once
#include <A3LHeader.au3>
#include <A3LMemory.au3>
#include <ListViewConstants.au3>
Opt("MustDeclareVars", 1)
; #INDEX# =======================================================================================================================
; Title .........: ListView
; Description ...: A ListView control is a window that displays a collection of items; each item consists of an icon and a label.
;                  ListView controls provide several ways to arrange and display items. For example, additional information about
;                  each item can be displayed in columns to the right of the icon and label.
; Author ........: Paul Campbell (PaulIA)
; ===============================================================================================================================
; #CONSTANTS# ===================================================================================================================
; Global Const $LV_VIEW_ICON            = 0x00000000
; Global Const $LV_VIEW_DETAILS         = 0x00000001
; Global Const $LV_VIEW_SMALLICON       = 0x00000002
; Global Const $LV_VIEW_LIST            = 0x00000003
; Global Const $LV_VIEW_TILE            = 0x00000004
; Global Const $LVA_DEFAULT             = 0x000000000
; Global Const $LVA_ALIGNLEFT           = 0x000000001
; Global Const $LVA_ALIGNTOP            = 0x000000002
; Global Const $LVA_SNAPTOGRID          = 0x000000005
Global Const $LVBKIF_SOURCE_NONE = 0x00000000
Global Const $LVBKIF_SOURCE_HBITMAP = 0x00000001
Global Const $LVBKIF_SOURCE_URL = 0x00000002
Global Const $LVBKIF_SOURCE_MASK = 0x00000003
Global Const $LVBKIF_STYLE_NORMAL = 0x00000000
Global Const $LVBKIF_STYLE_TILE = 0x00000010
Global Const $LVBKIF_STYLE_MASK = 0x00000010
Global Const $LVBKIF_FLAG_TILEOFFSET = 0x00000100
Global Const $LVBKIF_TYPE_WATERMARK = 0x10000000
; Global Const $LVCF_FMT                = 0x00000001
; Global Const $LVCF_WIDTH              = 0x00000002
; Global Const $LVCF_TEXT               = 0x00000004
Global Const $LVCF_SUBITEM = 0x00000008
Global Const $LVCF_IMAGE = 0x00000010
Global Const $LVCF_ORDER = 0x00000020
Global Const $LVCF_ALLDATA = 0X0000003F
; Global Const $LVCFMT_LEFT             = 0x00000000
; Global Const $LVCFMT_RIGHT            = 0x00000001
; Global Const $LVCFMT_CENTER           = 0x00000002
Global Const $LVCFMT_JUSTIFYMASK = 0x00000003
Global Const $LVCFMT_IMAGE = 0x00000800
Global Const $LVCFMT_BITMAP_ON_RIGHT = 0x00001000
Global Const $LVCFMT_COL_HAS_IMAGES = 0x00008000
; Global Const $LVFI_PARAM              = 0x00000001
; Global Const $LVFI_STRING             = 0x00000002
; Global Const $LVFI_PARTIAL            = 0x00000008
; Global Const $LVFI_WRAP               = 0x00000020
Global Const $LVFI_NEARESTXY = 0x00000040
Global Const $LVGA_HEADER_LEFT = 0x00000001
Global Const $LVGA_HEADER_CENTER = 0x00000002
Global Const $LVGA_HEADER_RIGHT = 0x00000004
Global Const $LVGF_NONE = 0x00000000
Global Const $LVGF_HEADER = 0x00000001
Global Const $LVGF_FOOTER = 0x00000002
Global Const $LVGF_STATE = 0x00000004
Global Const $LVGF_ALIGN = 0x00000008
Global Const $LVGF_GROUPID = 0x00000010
Global Const $LVHT_NOWHERE = 0x00000001
Global Const $LVHT_ONITEMICON = 0x00000002
Global Const $LVHT_ONITEMLABEL = 0x00000004
Global Const $LVHT_ONITEMSTATEICON = 0x00000008
Global Const $LVHT_ONITEM = 0x0000000E
Global Const $LVHT_ABOVE = 0x00000008
Global Const $LVHT_BELOW = 0x00000010
Global Const $LVHT_TORIGHT = 0x00000020
Global Const $LVHT_TOLEFT = 0x00000040
; Global Const $LVIF_TEXT               = 0x00000001
Global Const $LVIF_IMAGE = 0x00000002
Global Const $LVIF_PARAM = 0x00000004
; Global Const $LVIF_STATE              = 0x00000008
Global Const $LVIF_INDENT = 0x00000010
Global Const $LVIF_GROUPID = 0x00000100
Global Const $LVIF_COLUMNS = 0x00000200
Global Const $LVIF_NORECOMPUTE = 0x00000800
Global Const $LVIM_AFTER = 0x00000001
; Global Const $LVIR_BOUNDS             = 0x00000000
Global Const $LVIR_ICON = 0x00000001
Global Const $LVIR_LABEL = 0x00000002
Global Const $LVIR_SELECTBOUNDS = 0x00000003
; Global Const $LVIS_FOCUSED            = 0x00000001
; Global Const $LVIS_SELECTED           = 0x00000002
; Global Const $LVIS_CUT                = 0x00000004
; Global Const $LVIS_DROPHILITED        = 0x00000008
; Global Const $LVIS_OVERLAYMASK        = 0x00000F00
; Global Const $LVIS_STATEIMAGEMASK     = 0x0000F000
; Global Const $LVNI_ALL                = 0x00000000
; Global Const $LVNI_FOCUSED            = 0x00000001
; Global Const $LVNI_SELECTED           = 0x00000002
; Global Const $LVNI_CUT                = 0x00000004
; Global Const $LVNI_DROPHILITED        = 0x00000008
; Global Const $LVNI_ABOVE              = 0x00000100
; Global Const $LVNI_BELOW              = 0x00000200
; Global Const $LVNI_TOLEFT             = 0x00000400
; Global Const $LVNI_TORIGHT            = 0x00000800
; Global Const $LVSIL_NORMAL            = 0
; Global Const $LVSIL_SMALL             = 1
; Global Const $LVSIL_STATE             = 2
; Global Const $VK_PRIOR                = 0x21
; Global Const $VK_NEXT                 = 0x22
; Global Const $VK_END                  = 0x23
Global Const $VK_HOME = 0x24
; Global Const $VK_LEFT                 = 0x25
; Global Const $VK_UP                   = 0x26
; Global Const $VK_RIGHT                = 0x27
; Global Const $VK_DOWN                 = 0x28
; ===============================================================================================================================
; #MESSAGES# ====================================================================================================================
; Global Const $LVM_SETBKCOLOR                  = 0x1001
; Global Const $LVM_GETBKCOLOR                  = 0x1000
; Global Const $LVM_GETIMAGELIST                = 0x1002
Global Const $LVM_SETIMAGELIST = 0x1003
; Global Const $LVM_GETITEMCOUNT                = 0x1004
Global Const $LVM_GETITEM = 0x1005
Global Const $LVM_SETITEM = 0x1006
Global Const $LVM_INSERTITEM = 0x1007
; Global Const $LVM_DELETEITEM                  = 0x1008
; Global Const $LVM_DELETEALLITEMS              = 0x1009
; Global Const $LVM_GETCALLBACKMASK             = 0x100A
; Global Const $LVM_SETCALLBACKMASK             = 0x100B
; Global Const $LVM_GETNEXTITEM                 = 0x100C
; Global Const $LVM_FINDITEM                    = 0x100D
Global Const $LVM_GETITEMRECT = 0x100E
; Global Const $LVM_SETITEMPOSITION             = 0x100F
Global Const $LVM_GETITEMPOSITION = 0x1010
Global Const $LVM_GETSTRINGWIDTH = 0x1011
Global Const $LVM_HITTEST = 0x1012
; Global Const $LVM_ENSUREVISIBLE               = 0x1013
; Global Const $LVM_SCROLL                      = 0x1014
; Global Const $LVM_REDRAWITEMS                 = 0x1015
; Global Const $LVM_ARRANGE                     = 0x1016
; Global Const $LVM_EDITLABEL                   = 0x1017
; Global Const $LVM_GETEDITCONTROL              = 0x1018
Global Const $LVM_GETCOLUMN = 0x1019
Global Const $LVM_SETCOLUMN = 0x101A
Global Const $LVM_INSERTCOLUMN = 0x101B
; Global Const $LVM_DELETECOLUMN                = 0x101C
; Global Const $LVM_GETCOLUMNWIDTH              = 0x101D
; Global Const $LVM_SETCOLUMNWIDTH              = 0x101E
; Global Const $LVM_GETHEADER                   = 0x101F
Global Const $LVM_CREATEDRAGIMAGE = 0x1021
; Global Const $LVM_GETVIEWRECT                 = 0x1022
Global Const $LVM_GETTEXTCOLOR = 0x1023
; Global Const $LVM_SETTEXTCOLOR                = 0x1024
Global Const $LVM_GETTEXTBKCOLOR = 0x1025
; Global Const $LVM_SETTEXTBKCOLOR              = 0x1026
; Global Const $LVM_GETTOPINDEX                 = 0x1027
; Global Const $LVM_GETCOUNTPERPAGE             = 0x1028
Global Const $LVM_GETORIGIN = 0x1029
; Global Const $LVM_UPDATE                      = 0x102A
; Global Const $LVM_SETITEMSTATE                = 0x102B
; Global Const $LVM_GETITEMSTATE                = 0x102C
Global Const $LVM_GETITEMTEXT = 0x102D
Global Const $LVM_SETITEMTEXT = 0x102E
; Global Const $LVM_SETITEMCOUNT                = 0x102F
Global Const $LVM_SORTITEMS = 0x1030
Global Const $LVM_SETITEMPOSITION32 = 0x1031
; Global Const $LVM_GETSELECTEDCOUNT            = 0x1032
Global Const $LVM_GETITEMSPACING = 0x1033
Global Const $LVM_GETISEARCHSTRING = 0x1034
; Global Const $LVM_SETICONSPACING              = 0x1035
; Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE    = 0x1036
; Global Const $LVM_GETEXTENDEDLISTVIEWSTYLE    = 0x1037
; Global Const $LVM_GETSUBITEMRECT              = 0x1038
Global Const $LVM_SUBITEMHITTEST = 0x1039
; Global Const $LVM_SETCOLUMNORDERARRAY         = 0x103A
; Global Const $LVM_GETCOLUMNORDERARRAY         = 0x103B
; Global Const $LVM_SETHOTITEM                  = 0x103C
; Global Const $LVM_GETHOTITEM                  = 0x103D
Global Const $LVM_SETHOTCURSOR = 0x103E
; Global Const $LVM_GETHOTCURSOR                = 0x103F
Global Const $LVM_APPROXIMATEVIEWRECT = 0x1040
Global Const $LVM_SETWORKAREAS = 0x1041
Global Const $LVM_GETSELECTIONMARK = 0x1042
Global Const $LVM_SETSELECTIONMARK = 0x1043
Global Const $LVM_SETBKIMAGE = 0x1044
Global Const $LVM_GETBKIMAGE = 0x1045
Global Const $LVM_GETWORKAREAS = 0x1046
; Global Const $LVM_SETHOVERTIME                = 0x1047
; Global Const $LVM_GETHOVERTIME                = 0x1048
Global Const $LVM_GETNUMBEROFWORKAREAS = 0x1049
Global Const $LVM_SETTOOLTIPS = 0x104A
Global Const $LVM_GETITEMW = 0x104B
Global Const $LVM_SETITEMW = 0x104C
Global Const $LVM_INSERTITEMW = 0x104D
Global Const $LVM_GETTOOLTIPS = 0x104E
Global Const $LVM_SORTITEMSEX = 0x1051
Global Const $LVM_FINDITEMW = 0x1053
Global Const $LVM_GETSTRINGWIDTHW = 0x1057
Global Const $LVM_GETCOLUMNW = 0x105F
Global Const $LVM_SETCOLUMNW = 0x1060
Global Const $LVM_INSERTCOLUMNW = 0x1061
Global Const $LVM_GETITEMTEXTW = 0x1073
Global Const $LVM_SETITEMTEXTW = 0x1074
Global Const $LVM_GETISEARCHSTRINGW = 0x1075
Global Const $LVM_EDITLABELW = 0x1076
Global Const $LVM_SETBKIMAGEW = 0x108A
Global Const $LVM_GETBKIMAGEW = 0x108B
; Global Const $LVM_SETSELECTEDCOLUMN           = 0x108C
Global Const $LVM_SETTILEWIDTH = 0x108D
; Global Const $LVM_SETVIEW                     = 0x108E
; Global Const $LVM_GETVIEW                     = 0x108F
Global Const $LVM_INSERTGROUP = 0x1091
Global Const $LVM_SETGROUPINFO = 0x1093
Global Const $LVM_GETGROUPINFO = 0x1095
Global Const $LVM_REMOVEGROUP = 0x1096
Global Const $LVM_MOVEGROUP = 0x1097
Global Const $LVM_MOVEITEMTOGROUP = 0x109A
Global Const $LVM_SETGROUPMETRICS = 0x109B
Global Const $LVM_GETGROUPMETRICS = 0x109C
; Global Const $LVM_ENABLEGROUPVIEW             = 0x109D
Global Const $LVM_SORTGROUPS = 0x109E
Global Const $LVM_INSERTGROUPSORTED = 0x109F
Global Const $LVM_REMOVEALLGROUPS = 0x10A0
Global Const $LVM_HASGROUP = 0x10A1
Global Const $LVM_SETTILEVIEWINFO = 0x10A2
Global Const $LVM_GETTILEVIEWINFO = 0x10A3
Global Const $LVM_SETTILEINFO = 0x10A4
Global Const $LVM_GETTILEINFO = 0x10A5
Global Const $LVM_SETINSERTMARK = 0x10A6
Global Const $LVM_GETINSERTMARK = 0x10A7
Global Const $LVM_INSERTMARKHITTEST = 0x10A8
Global Const $LVM_GETINSERTMARKRECT = 0x10A9
Global Const $LVM_SETINSERTMARKCOLOR = 0x10AA
Global Const $LVM_GETINSERTMARKCOLOR = 0x10AB
Global Const $LVM_SETINFOTIP = 0x10AD
; Global Const $LVM_GETSELECTEDCOLUMN           = 0x10AE
Global Const $LVM_ISGROUPVIEWENABLED = 0x10AF
Global Const $LVM_GETOUTLINECOLOR = 0x10B0
Global Const $LVM_SETOUTLINECOLOR = 0x10B1
; Global Const $LVM_CANCELEDITLABEL             = 0x10B3
Global Const $LVM_MAPINDEXTOID = 0x10B4
Global Const $LVM_MAPIDTOINDEX = 0x10B5
; Global Const $LVM_GETUNICODEFORMAT            = $CCM_GETUNICODEFORMAT
; Global Const $LVM_SETUNICODEFORMAT            = $CCM_SETUNICODEFORMAT
; ===============================================================================================================================
; #NOTIFICATIONS# ===============================================================================================================
Global Const $LVN_ITEMCHANGING = 0xFFFFFF9C    ; An item is changing
Global Const $LVN_ITEMCHANGED = 0xFFFFFF9B    ; An item has changed
Global Const $LVN_INSERTITEM = 0xFFFFFF9A    ; A new item was inserted
Global Const $LVN_DELETEITEM = 0xFFFFFF99    ; An item is about to be deleted
Global Const $LVN_DELETEALLITEMS = 0xFFFFFF98    ; All items are about to be deleted
Global Const $LVN_BEGINLABELEDIT = 0xFFFFFF97    ; The label editting is starting
Global Const $LVN_ENDLABELEDIT = 0xFFFFFF96    ; The label editting is ending
Global Const $LVN_COLUMNCLICK = 0xFFFFFF94    ; A column was clicked
Global Const $LVN_BEGINDRAG = 0xFFFFFF93    ; A drag and drop involving the left mouse button is being initiated
Global Const $LVN_BEGINRDRAG = 0xFFFFFF91    ; A drag and drop involving the right mouse button is being initiated
Global Const $LVN_ODCACHEHINT = 0xFFFFFF8F    ; The contents of its display area for a virtual control have changed
Global Const $LVN_ITEMACTIVATE = 0xFFFFFF8E    ; The user activated an item
Global Const $LVN_ODSTATECHANGED = 0xFFFFFF8D    ; The state of an item or range of items in a virtual control has changed
Global Const $LVN_HOTTRACK = 0xFFFFFF87    ; The user moved the mouse over an item
Global Const $LVN_GETDISPINFO = 0xFFFFFF6A    ; Request for the parent to provide information
Global Const $LVN_SETDISPINFO = 0xFFFFFF69    ; Sent to the parent when it needs to update item information
Global Const $LVN_ODFINDITEM = 0xFFFFFF68    ; Sent to the parent when it needs to find a callback item
Global Const $LVN_BEGINLABELEDITW = 0xFFFFFF51    ; [Unicode] The label editting is starting
Global Const $LVN_ENDLABELEDITW = 0xFFFFFF50    ; [Unicode] The label editting is ending
Global Const $LVN_GETDISPINFOW = 0xFFFFFF4F    ; [Unicode] Request for the parent to provide information
Global Const $LVN_SETDISPINFOW = 0xFFFFFF4E    ; [Unicode] Sent to the parent when it needs to update item information
Global Const $LVN_ODFINDITEMW = 0xFFFFFF4D    ; [Unicode] Sent to the parent when it needs to find a callback item
; ===============================================================================================================================
; #STYLES# ======================================================================================================================
Global Const $LVS_ALIGNTOP = 0x00000000    ; Items are aligned at the top in icon and small icon view
; Global Const $LVS_ICON                = 0x00000000    ; This style specifies icon view
; Global Const $LVS_REPORT              = 0x00000001    ; This style specifies report view
; Global Const $LVS_SMALLICON           = 0x00000002    ; This style specifies small icon view
; Global Const $LVS_LIST                = 0x00000003    ; This style specifies list view
Global Const $LVS_TYPEMASK = 0x00000003    ; Determines the control's current window style
; Global Const $LVS_SINGLESEL           = 0x00000004    ; Only one item at a time can be selected
; Global Const $LVS_SHOWSELALWAYS       = 0x00000008    ; The selection is always shown
; Global Const $LVS_SORTASCENDING       = 0x00000010    ; Item indexes are sorted based on item text in ascending order
; Global Const $LVS_SORTDESCENDING      = 0x00000020    ; Item indexes are sorted based on item text in descending order
Global Const $LVS_SHAREIMAGELISTS = 0x00000040    ; The image list will not be deleted when the control is destroyed
; Global Const $LVS_NOLABELWRAP         = 0x00000080    ; Item text is displayed on a single line in icon view
Global Const $LVS_AUTOARRANGE = 0x00000100    ; Icons are automatically kept arranged in icon and small icon view
; Global Const $LVS_EDITLABELS          = 0x00000200    ; Item text can be edited in place
Global Const $LVS_OWNERDRAWFIXED = 0x00000400    ; The owner window can paint items in report view
Global Const $LVS_ALIGNLEFT = 0x00000800    ; Items are left aligned in icon and small icon view
Global Const $LVS_ALIGNMASK = 0x00000C00    ; Determines the control's current alignment
Global Const $LVS_NOSCROLL = 0x00002000    ; Scrolling is disabled
; Global Const $LVS_NOCOLUMNHEADER      = 0x00004000    ; Column headers are not displayed in report view
; Global Const $LVS_NOSORTHEADER        = 0x00008000    ; Column headers do not work like buttons
Global Const $LVS_TYPESTYLEMASK = 0x0000FC00    ; Determines the window styles
Global Const $LVS_DEFAULT = 0x00000220    ; Default control style
; ===============================================================================================================================
; #EXTSTYLES# ===================================================================================================================
; Global Const $LVS_EX_GRIDLINES        = 0x00000001    ; Displays gridlines around items and subitems
; Global Const $LVS_EX_SUBITEMIMAGES    = 0x00000002    ; Allows images to be displayed for subitems
; Global Const $LVS_EX_CHECKBOXES       = 0x00000004    ; Enables check boxes for items
; Global Const $LVS_EX_TRACKSELECT      = 0x00000008    ; Enables hot-track selection
; Global Const $LVS_EX_HEADERDRAGDROP   = 0x00000010    ; Enables drag-and-drop reordering of columns
; Global Const $LVS_EX_FULLROWSELECT    = 0x00000020    ; When an item is selected, the item and all its subitems are highlighted
; Global Const $LVS_EX_ONECLICKACTIVATE = 0x00000040    ; Sends an $LVN_ITEMACTIVATE message when the user clicks an item
; Global Const $LVS_EX_TWOCLICKACTIVATE = 0x00000080    ; Sends an $LVN_ITEMACTIVATE message when the user double clicks an item
; Global Const $LVS_EX_FLATSB           = 0x00000100    ; Enables flat scroll bars
; Global Const $LVS_EX_REGIONAL         = 0x00000200    ; Sets the region to include only the icons and text using SetWindowRgn
; Global Const $LVS_EX_INFOTIP          = 0x00000400    ; A message is sent to the parent before displaying an item's ToolTip
; Global Const $LVS_EX_UNDERLINEHOT     = 0x00000800    ; Causes hot items to be displayed with underlined text
; Global Const $LVS_EX_UNDERLINECOLD    = 0x00001000    ; Causes non-hot items to be displayed with underlined text
Global Const $LVS_EX_MULTIWORKAREAS = 0x00002000    ; The control will not autoarrange its icons until a work area is defined
; Global Const $LVS_EX_LABELTIP         = 0x00004000    ; If a partially hidden label lacks ToolTip text, the label will unfold
; Global Const $LVS_EX_BORDERSELECT     = 0x00008000    ; The border color of the item changes when selected
Global Const $LVS_EX_DOUBLEBUFFER = 0x00010000    ; Paints via double-buffering, which reduces flicker
Global Const $LVS_EX_SNAPTOGRID = 0x00080000    ; Icons automatically snap to grid
Global Const $LVS_EX_SIMPLESELECT = 0x00100000    ; Moves the state image to the top right of the large icon rendering

; #GROUPSTYLES# ===============================================================================================================
global const $LVGMF_NONE = 0;
global const $LVGMF_BORDERSIZE = 1;
global const $LVGMF_BORDERCOLOR = 2;
global const $LVGMF_TEXTCOLOR = 4;
; ===============================================================================================================================
; #FUNCTION# ====================================================================================================================
; Description ...: Adds a new item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index at which the new item should be inserted.  If this value is greater  than  the
;                  +number of items currently contained by the control, the new item will be appended to the end of the list  and
;                  +assigned the correct index.
;                  $sText       - Item text
;                  $iImage      - Index of the item's icon in the control's image list
; Return values .: Success      - The index of the new item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_AddSubItem, _ListView_InsertItem
; ===============================================================================================================================
Func _ListView_AddItem($hWnd, $iIndex, $sText, $iImage = -1)
    Return _ListView_InsertItem($hWnd, $iIndex, $sText, $iImage)
EndFunc   ;==>_ListView_AddItem
Func _ListView_AddGroup($hWnd, $sHeader = "", $iGroupID = -1, $iAlign = 0)
    Local $iHeader, $pHeader, $tHeader, $iGroup, $pGroup, $tGroup, $pMemory, $tMemMap, $pText, $iMask, $iResult
    Local $aAlign[3] = [$LVGA_HEADER_LEFT, $LVGA_HEADER_CENTER, $LVGA_HEADER_RIGHT]
    $tHeader = _API_MultiByteToWideChar ($sHeader)
    $pHeader = _tagGetPtr ($tHeader)
    $iHeader = _tagGetSize ($tHeader)
    $tGroup = _tagLVGROUP()
    $pGroup = _tagGetPtr ($tGroup)
    $iGroup = _tagGetSize ($tGroup)
    $iMask = BitOR($LVGF_HEADER, $LVGF_ALIGN, $LVGF_GROUPID)
    _tagSetData ($tGroup, "Size", $iGroup)
    _tagSetData ($tGroup, "Mask", $iMask)
    _tagSetData ($tGroup, "HeaderMax", $iHeader)
    _tagSetData ($tGroup, "GroupID", 0xFFFFFFFF)
    _tagSetData ($tGroup, "Align", $aAlign[$iAlign])
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tGroup, "Header", $pHeader)
        $iResult = _API_SendMessage ($hWnd, $LVM_INSERTGROUP, $iGroupID, $pGroup)
        _tagSetData ($tGroup, "Mask", $LVGF_GROUPID)
        _tagSetData ($tGroup, "GroupID", $iGroupID)
        _API_SendMessage ($hWnd, $LVM_INSERTGROUP, $iGroupID, $pGroup)
    Else
        $pMemory = _Mem_Init ($hWnd, $iGroup + $iHeader, $tMemMap)
        $pText = $pMemory + $iGroup
        _tagSetData ($tGroup, "Header", $pText)
        _Mem_Write ($tMemMap, $pGroup, $pMemory, $iGroup)
        _Mem_Write ($tMemMap, $pHeader, $pText, $iHeader)
        $iResult = _API_SendMessage ($hWnd, $LVM_INSERTGROUP, $iGroupID, $pMemory)
        _tagSetData ($tGroup, "Mask", $LVGF_GROUPID)
        _tagSetData ($tGroup, "GroupID", $iGroupID)
        _API_SendMessage ($hWnd, $LVM_INSERTGROUP, $iGroupID, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    _API_InvalidateRect ($hWnd)
    Return $iResult <> 0
EndFunc   ;==>_ListView_AddGroup
; #FUNCTION# ====================================================================================================================
; Description ...: Adds a new subitem to the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item (row)
;                  $sText       - Subitem text
;                  $iSubItem    - One based index of the subitem (Column)
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_AddItem, _ListView_SetItemText
; ===============================================================================================================================
Func _ListView_AddSubItem($hWnd, $iIndex, $sText, $iSubItem)
    Return _ListView_SetItemText($hWnd, $iIndex, $sText, $iSubItem)
EndFunc   ;==>_ListView_AddSubItem
; #FUNCTION# ====================================================================================================================
; Description ...: Calculates the approximate height required to display a given number of items
; Parameters ....: $hWnd        - Handle to the control
;                  $iCount      - Number of items to be displayed in the control. If this parameter is set to -1 the message uses
;                  +the total number of items in the control.
;                  $iCX         - Proposed X dimension of the control, in pixels.  This parameter can be set to -1 to  allow  the
;                  +message to use the current width value.
;                  $iCY         - Proposed Y dimension of the control, in pixels.  This parameter can be set to -1 to  allow  the
;                  +message to use the current height value.
; Return values .: Success      - Approximate height, in pixels, needed to display the items
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Setting the size of the control based on the dimensions provided by  this  message  can  optimize  redraw  and
;                  reduce flicker.
; Related .......: _ListView_ApproximateViewRect, _ListView_ApproximateViewWidth
; ===============================================================================================================================
Func _ListView_ApproximateViewHeight($hWnd, $iCount = -1, $iCX = -1, $iCY = -1)
    Local $aView
    $aView = _ListView_ApproximateViewRect($hWnd, $iCount, $iCX, $iCY)
    Return $aView[1]
EndFunc   ;==>_ListView_ApproximateViewHeight
; #FUNCTION# ====================================================================================================================
; Description ...: Calculates the approximate size required to display a given number of items
; Parameters ....: $hWnd        - Handle to the control
;                  $iCount      - Number of items to be displayed in the control. If this parameter is set to -1 the message uses
;                  +the total number of items in the control.
;                  $iCX         - Proposed X dimension of the control, in pixels.  This parameter can be set to -1 to  allow  the
;                  +message to use the current width value.
;                  $iCY         - Proposed Y dimension of the control, in pixels.  This parameter can be set to -1 to  allow  the
;                  +message to use the current height value.
; Return values .: Success      - Array with the following format:
;                  |[0] - Approximate width, in pixels, needed to display the items
;                  |[1] - Approximate height, in pixels, needed to display the items
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Setting the size of the control based on the dimensions provided by  this  message  can  optimize  redraw  and
;                  reduce flicker.
; Related .......: _ListView_ApproximateViewHeight, _ListView_ApproximateViewWidth
; ===============================================================================================================================
Func _ListView_ApproximateViewRect($hWnd, $iCount = -1, $iCX = -1, $iCY = -1)
    Local $iView, $aView[2]
    $iView = _API_SendMessage ($hWnd, $LVM_APPROXIMATEVIEWRECT, $iCount, _Lib_MakeLong ($iCX, $iCY))
    $aView[0] = _Lib_LoWord ($iView)
    $aView[1] = _Lib_HiWord ($iView)
    Return $aView
EndFunc   ;==>_ListView_ApproximateViewRect
; #FUNCTION# ====================================================================================================================
; Description ...: Calculates the approximate width required to display a given number of items
; Parameters ....: $hWnd        - Handle to the control
;                  $iCount      - Number of items to be displayed in the control. If this parameter is set to -1 the message uses
;                  +the total number of items in the control
;                  $iCX         - Proposed X dimension of the control, in pixels.  This parameter can be set to -1  to  allow the
;                  +message to use the current width value.
;                  $iCY         - Proposed Y dimension of the control, in pixels.  This parameter can be set to -1  to  allow the
;                  +message to use the current height value.
; Return values .: Success      - Approximate width, in pixels, needed to display the items
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Setting the size of the control based on the dimensions provided by  this  message  can  optimize  redraw  and
;                  reduce flicker.
; Related .......: _ListView_ApproximateViewHeight, _ListView_ApproximateViewRect
; ===============================================================================================================================
Func _ListView_ApproximateViewWidth($hWnd, $iCount = -1, $iCX = -1, $iCY = -1)
    Local $aView
    $aView = _ListView_ApproximateViewRect($hWnd, $iCount, $iCX, $iCY)
    Return $aView[0]
EndFunc   ;==>_ListView_ApproximateViewWidth
; #FUNCTION# ====================================================================================================================
; Description ...: Arranges items in icon view
; Parameters ....: $hWnd        - Handle to the control
;                  $iArrange    - Alignment. This can be one of the following values:
;                  |0 - Aligns items according to the controls default value
;                  |1 - Aligns items along the left edge of the window
;                  |2 - Aligns items along the top edge of the window
;                  |3 - Snaps all icons to the nearest grid position.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetView
; ===============================================================================================================================
Func _ListView_Arrange($hWnd, $iArrange)
    Local $aArrange[4] = [$LVA_DEFAULT, $LVA_ALIGNLEFT, $LVA_ALIGNTOP, $LVA_SNAPTOGRID]
    Return _API_SendMessage ($hWnd, $LVM_ARRANGE, $aArrange[$iArrange], 0) <> 0
EndFunc   ;==>_ListView_Arrange
; #FUNCTION# ====================================================================================================================
; Description ...: Prevents updating of the control until the EndUpdate function is called
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_EndUpdate
; ===============================================================================================================================
Func _ListView_BeginUpdate($hWnd)
    Return _API_SendMessage ($hWnd, $WM_SETREDRAW, 0, 0) = 0
EndFunc   ;==>_ListView_BeginUpdate
; #FUNCTION# ====================================================================================================================
; Description ...: Cancels an item text editing operation
; Parameters ....: $hWnd        - Handle to the control
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_EditLabel
; ===============================================================================================================================
Func _ListView_CancelEditLabel($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_CANCELEDITLABEL, 0, 0)
EndFunc   ;==>_ListView_CancelEditLabel
; #FUNCTION# ====================================================================================================================
; Description ...: Checks an item checkbox
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iDX         - X offset from upper/left corner of item rectangle
;                  $iDY         - Y offset from upper/left corner of item rectangle
;                  $fMove       - If True, the mouse will be moved. If False, the mouse does not move.
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_ClickItem
; ===============================================================================================================================
Func _ListView_CheckItem($hWnd, $iIndex, $iDX = 10, $iDY = 6, $fMove = False)
    Local $tPoint, $tRect, $iX, $iY
    _ListView_EnsureVisible($hWnd, $iIndex, False)
    $tRect = _ListView_GetItemRectEx($hWnd, $iIndex)
    $tPoint = _Lib_PointFromRect ($tRect, False)
    _API_ClientToScreen ($hWnd, $tPoint)
    _Lib_GetXYFromPoint ($tPoint, $iX, $iY)
    $iX = $iX + $iDX
    $iY = $iY + $iDY
    _Lib_MouseClick ("left", $iX, $iY, $fMove)
EndFunc   ;==>_ListView_CheckItem
; #FUNCTION# ====================================================================================================================
; Description ...: Clicks an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $sButton     - Button to click
;                  $fMove       - If True, the mouse will be moved. If False, the mouse does not move.
;                  $iClicks     - Number of clicks
;                  $iSpeed      - Delay between clicks
;                  $fPopupScan  - If True, a popup scan will be done after the click
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_CheckItem
; ===============================================================================================================================
Func _ListView_ClickItem($hWnd, $iIndex, $sButton = "left", $fMove = False, $iClicks = 1, $iSpeed = 1, $fPopupScan = False)
    Local $tPoint, $tRect, $iX, $iY
    _ListView_EnsureVisible($hWnd, $iIndex, False)
    $tRect = _ListView_GetItemRectEx($hWnd, $iIndex)
    $tPoint = _Lib_PointFromRect ($tRect, True)
    $tPoint = _API_ClientToScreen ($hWnd, $tPoint)
    _Lib_GetXYFromPoint ($tPoint, $iX, $iY)
    _Lib_MouseClick ($sButton, $iX, $iY, $fMove, $iClicks, $iSpeed, $fPopupScan)
EndFunc   ;==>_ListView_ClickItem
; #FUNCTION# ====================================================================================================================
; Description ...: Create a ListView control
; Parameters ....: $hWnd        - Handle to parent or owner window
;                  $iX          - Horizontal position of the control
;                  $iY          - Vertical position of the control
;                  $iWidth      - Control width
;                  $iHeight     - Control height
;                  $iStyle      - Control style:
;                  |$LVS_ALIGNLEFT       - Items are left aligned in icon and small icon view
;                  |$LVS_ALIGNTOP        - Items are aligned with the top of the control in icon and small icon view
;                  |$LVS_AUTOARRANGE     - Icons are automatically kept arranged in icon and small icon view
;                  |$LVS_EDITLABELS      - Item text can be edited in place
;                  |$LVS_ICON            - This style specifies icon view
;                  |$LVS_LIST            - This style specifies list view
;                  |$LVS_NOCOLUMNHEADER  - Column headers are not displayed in report view
;                  |$LVS_NOLABELWRAP     - Item text is displayed on a single line in icon view
;                  |$LVS_NOSCROLL        - Scrolling is disabled
;                  |$LVS_NOSORTHEADER    - Column headers do not work like buttons
;                  |$LVS_OWNERDATA       - This style specifies a virtual control
;                  |$LVS_OWNERDRAWFIXED  - The owner window can paint items in report view
;                  |$LVS_REPORT          - This style specifies report view
;                  |$LVS_SHAREIMAGELISTS - The image list will not be deleted
;                  |$LVS_SHOWSELALWAYS   - The selection, if any, is always shown
;                  |$LVS_SINGLESEL       - Only one item at a time can be selected
;                  |$LVS_SMALLICON       - This style specifies small icon view
;                  |$LVS_SORTASCENDING   - Item indexes are sorted in ascending order
;                  |$LVS_SORTDESCENDING  - Item indexes are sorted in descending order
;                  -
;                  |Default: $LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS
;                  $iExStyle    - Control extended styles:
;                  |$LVS_EX_BORDERSELECT     - When an item is selected the border color of the item changes
;                  |$LVS_EX_CHECKBOXES       - Enables check boxes for items in a list-view control
;                  |$LVS_EX_DOUBLEBUFFER     - Paints via double-buffering, which reduces flicker
;                  |$LVS_EX_FLATSB           - Enables flat scroll bars in the list view
;                  |$LVS_EX_FULLROWSELECT    - When an item is selected, the item and all its subitems are highlighted
;                  |$LVS_EX_GRIDLINES        - Displays gridlines around items and subitems
;                  |$LVS_EX_HEADERDRAGDROP   - Enables drag-and-drop reordering of columns
;                  |$LVS_EX_INFOTIP          - The $LVN_GETINFOTIP notification message is sent before displaying a ToolTip
;                  |$LVS_EX_LABELTIP         - If not set, the unfolds partly hidden labels only for the large icon mode
;                  |$LVS_EX_MULTIWORKAREAS   - The control will not autoarrange its icons until one or more work areas are defined
;                  |$LVS_EX_ONECLICKACTIVATE - The control sends an $LVN_ITEMACTIVATE messages when the user clicks an item
;                  |$LVS_EX_REGIONAL         - Sets the control region to include only the item icons and text
;                  |$LVS_EX_SIMPLESELECT     - In icon view moves the state image of the control to the top right
;                  |$LVS_EX_SUBITEMIMAGES    - Allows images to be displayed for subitems
;                  |$LVS_EX_TRACKSELECT      - Enables hot-track selection in the control
;                  |$LVS_EX_TWOCLICKACTIVATE - The control sends an $LVN_ITEMACTIVATE message when the user double-clicks an item
;                  |$LVS_EX_UNDERLINECOLD    - Causes non-hot items that may be activated to be displayed with underlined text
;                  |$LVS_EX_UNDERLINEHOT     - Causes hot items that may be activated to be displayed with underlined text
;                  -
;                  |Default: $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL
; Return values .: Success      - Handle to the ListView control
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_Create($hWnd, $iX, $iY, $iWidth = 150, $iHeight = 150, $iStyle = 0x0000000D, $iExStyle = 0x00000220)
    Local $hList
    $iStyle = BitOR($iStyle, $WS_CHILD, $WS_VISIBLE)
    $hList = _API_CreateWindowEx ($iExStyle, "SysListView32", "", $iStyle, $iX, $iY, $iWidth, $iHeight, $hWnd)
    _ListView_SetUnicodeFormat($hList, 0)
    _Lib_SetFont ($hList, _API_GetStockObject ($DEFAULT_GUI_FONT))
    Return $hList
EndFunc   ;==>_ListView_Create
; #FUNCTION# ====================================================================================================================
; Description ...: Creates a drag image list for the specified item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - Array with the following format:
;                  |[0] - Handle to the drag image list if successful, otherwise 0
;                  |[1] - X coordinate of the upper left corner of the image
;                  |[2] - Y coordinate of the upper left corner of the image
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: You are responsible for destroying the image list when it is no longer needed
; Related .......:
; ===============================================================================================================================
Func _ListView_CreateDragImage($hWnd, $iIndex)
    Local $tPoint, $aDrag[3]
    $tPoint = _tagPOINT ()
    $aDrag[0] = "0x" & Hex(_API_SendMessage ($hWnd, $LVM_CREATEDRAGIMAGE, $iIndex, _tagGetPtr ($tPoint)))
    $aDrag[1] = _tagGetData ($tPoint, "X")
    $aDrag[2] = _tagGetData ($tPoint, "Y")
EndFunc   ;==>_ListView_CreateDragImage
; #FUNCTION# ====================================================================================================================
; Description ...: Removes all items from the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_DeleteItem
; ===============================================================================================================================
Func _ListView_DeleteAllItems($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_DELETEALLITEMS, 0, 0) <> 0
EndFunc   ;==>_ListView_DeleteAllItems
; #FUNCTION# ====================================================================================================================
; Description ...: Removes a column from the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iColumn     - Zero based index of the column to delete
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Column zero cannot be deleted.  If you must delete column zero, insert a zero length  dummy  column  zero  and
;                  delete column one and above.
; Related .......:
; ===============================================================================================================================
Func _ListView_DeleteColumn($hWnd, $iColumn)
    Return _API_SendMessage ($hWnd, $LVM_DELETECOLUMN, $iColumn, 0) <> 0
EndFunc   ;==>_ListView_DeleteColumn
; #FUNCTION# ====================================================================================================================
; Description ...: Removes an item from the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_DeleteAllItems
; ===============================================================================================================================
Func _ListView_DeleteItem($hWnd, $iIndex)
    Return _API_SendMessage ($hWnd, $LVM_DELETEITEM, $iIndex, 0) <> 0
EndFunc   ;==>_ListView_DeleteItem
; #FUNCTION# ====================================================================================================================
; Description ...: Begins in place editing of the specified item text
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item to edit
; Return values .: Success      - Returns the handle to the edit control that is used to edit the item
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: When the user completes or cancels editing, the edit control is destroyed and the handle is no  longer  valid.
;                  You can subclass the edit control, but you should not destroy it.
; Related .......: _ListView_CancelEditLabel
; ===============================================================================================================================
Func _ListView_EditLabel($hWnd, $iIndex)
    _API_SetFocus ($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_EDITLABEL, $iIndex, 0))
EndFunc   ;==>_ListView_EditLabel
; #FUNCTION# ====================================================================================================================
; Description ...: Enables or disables whether the items in the control display as a group
; Parameters ....: $hWnd        - Handle to the control
;                  $fEnable     - Indicates whether to enable group displayed items
; Return values .: 0 - The ability to display listview items as a group is already enabled or disabled
;                  1 - The state of the control was successfully changed
;                  -1 - The operation failed
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......:
; ===============================================================================================================================
Func _ListView_EnableGroupView($hWnd, $fEnable)
    Return _API_SendMessage ($hWnd, $LVM_ENABLEGROUPVIEW, $fEnable, 0)
EndFunc   ;==>_ListView_EnableGroupView
; #FUNCTION# ====================================================================================================================
; Description ...: Enables screen repainting that was turned off with the BeginUpdate function
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_BeginUpdate
; ===============================================================================================================================
Func _ListView_EndUpdate($hWnd)
    Return _API_SendMessage ($hWnd, $WM_SETREDRAW, 1, 0) = 0
EndFunc   ;==>_ListView_EndUpdate
; #FUNCTION# ====================================================================================================================
; Description ...: Ensures that an item is either entirely or partially visible
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $fPartialOK  - Specifies whether the item must be entirely visible.  If True, no scrolling occurs if the  item
;                  +is at least partially visible.
; Return values .: Success       - True
;                  Failure       - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_EnsureVisible($hWnd, $iIndex, $fPartialOK)
    Return _API_SendMessage ($hWnd, $LVM_ENSUREVISIBLE, $iIndex, $fPartialOK) <> 0
EndFunc   ;==>_ListView_EnsureVisible
; #FUNCTION# ====================================================================================================================
; Description ...: Searches for an item that contains the specified text anywhere in its text
; Parameters ....: $hWnd        - Handle to the control
;                  $sText       - Text to match
;                  $iStart      - Zero based index of the item to begin the search with or -1 to start from  the  beginning.  The
;                  +specified item is itself excluded from the search.
;                  $fWrapOK     - If True, the search will continue with the first item if no match is found
; Return values .: Success      - The zero based index of the item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The search is case insensitive
; Related .......: _ListView_FindText
; ===============================================================================================================================
Func _ListView_FindInText($hWnd, $sText, $iStart = -1, $fWrapOK = True)
    Local $iI, $iJ, $iCount, $iColumns, $sList
    $iCount = _ListView_GetItemCount($hWnd)
    $iColumns = _ListView_GetColumnCount($hWnd)
    If $iColumns = 0 Then $iColumns = 1
    For $iI = $iStart + 1 To $iCount - 1
        For $iJ = 0 To $iColumns - 1
            $sList = _ListView_GetItemText($hWnd, $iI, $iJ)
            If StringInStr($sList, $sText) Then Return $iI
        Next
    Next
    If ($iStart = -1) Or Not $fWrapOK Then Return -1
    For $iI = 0 To $iStart - 1
        For $iJ = 0 To $iColumns - 1
            $sList = _ListView_GetItemText($hWnd, $iI, $iJ)
            If StringInStr($sList, $sText) Then Return $iI
        Next
    Next
    Return -1
EndFunc   ;==>_ListView_FindInText
; #FUNCTION# ====================================================================================================================
; Description ...: Searches for an item with the specified characteristics
; Parameters ....: $hWnd        - Handle to the control
;                  $iStart      - Zero based index of the item to begin the search with or -1 to start from  the  beginning.  The
;                  +specified item is itself excluded from the search.
;                  $tFindInfo   - _tagLVFINDINFO structure that contains the search information
; Return values .: Success      - The zero based index of the item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _tagLVFINDINFO
; ===============================================================================================================================
Func _ListView_FindItem($hWnd, $iStart, ByRef $tFindInfo, $sText = "")
    Local $iBuffer, $tBuffer, $pBuffer, $iFindInfo, $pFindInfo, $pMemory, $tMemMap, $pText, $iResult
    $iBuffer = StringLen($sText) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $pFindInfo = _tagGetPtr ($tFindInfo)
    _tagSetData ($tBuffer, 1, $sText)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tFindInfo, "Text", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_FINDITEM, $iStart, $pFindInfo)
    Else
        $iFindInfo = _tagGetSize ($tFindInfo)
        $pMemory = _Mem_Init ($hWnd, $iFindInfo + $iBuffer, $tMemMap)
        $pText = $pMemory + $iFindInfo
        _tagSetData ($tFindInfo, "Text", $pText)
        _Mem_Write ($tMemMap, $pFindInfo, $pMemory, $iFindInfo)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_FINDITEM, $iStart, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult
EndFunc   ;==>_ListView_FindItem
; #FUNCTION# ====================================================================================================================
; Description ...: Finds the item nearest to the position specified
; Parameters ....: $hWnd        - Handle to the control
;                  $iX          - X position
;                  $iY          - Y position
;                  $iDir        - Specifies which direction to search:
;                  |0 - Left
;                  |1 - Right
;                  |2 - Up
;                  |3 - Down
;                  |4 - From start
;                  |5 - From end
;                  |6 - From prior item
;                  |7 - From next item
;                  $iStart      - Zero based index of the item to begin the search with or -1 to start from  the  beginning.  The
;                  +specified item is itself excluded from the search.
;                  $fWrapOK     - If True, the search will continue with the first item if no match is found
; Return values .: Success      - The zero based index of the item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: This function is supported only by large icon and small icon modes
; Related .......: _ListView_FindItem
; ===============================================================================================================================
Func _ListView_FindNearest($hWnd, $iX, $iY, $iDir = 0, $iStart = -1, $fWrapOK = True)
    Local $tFindInfo, $iFlags, $aDir[8] = [$VK_LEFT, $VK_RIGHT, $VK_UP, $VK_DOWN, $VK_HOME, $VK_END, $VK_PRIOR, $VK_NEXT]
    $tFindInfo = _tagLVFINDINFO()
    $iFlags = $LVFI_NEARESTXY
    If $fWrapOK Then $iFlags = BitOR($iFlags, $LVFI_WRAP)
    _tagSetData ($tFindInfo, "Flags", $iFlags)
    _tagSetData ($tFindInfo, "X", $iX)
    _tagSetData ($tFindInfo, "Y", $iY)
    _tagSetData ($tFindInfo, "Direction", $aDir[$iDir])
    Return _ListView_FindItem($hWnd, $iStart, $tFindInfo)
EndFunc   ;==>_ListView_FindNearest
; #FUNCTION# ====================================================================================================================
; Description ...: Searches for an item with the specified lParam
; Parameters ....: $hWnd        - Handle to the control
;                  $iParam      - Param value to search for
;                  $iStart      - Zero based index of the item to begin the search with or -1 to start from  the  beginning.  The
;                  +specified item is itself excluded from the search.
; Return values .: Success      - The zero based index of the item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_FindItem
; ===============================================================================================================================
Func _ListView_FindParam($hWnd, $iParam, $iStart = -1)
    Local $tFindInfo
    $tFindInfo = _tagLVFINDINFO()
    _tagSetData ($tFindInfo, "Flags", $LVFI_PARAM)
    _tagSetData ($tFindInfo, "Param", $iParam)
    Return _ListView_FindItem($hWnd, $iStart, $tFindInfo)
EndFunc   ;==>_ListView_FindParam
; #FUNCTION# ====================================================================================================================
; Description ...: Searches for an item with the specified text
; Parameters ....: $hWnd        - Handle to the control
;                  $sText       - Text to match
;                  $iStart      - Zero based index of the item to begin the search with or -1 to start from  the  beginning.  The
;                  +specified item is itself excluded from the search.
;                  $fPartialOK  - If True, a match will occur if the item text begins with the text
;                  $fWrapOK     - If True, the search will continue with the first item if no match is  found
; Return values .: Success      - The zero based index of the item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The search is case insensitive
; Related .......: _ListView_FindItem
; ===============================================================================================================================
Func _ListView_FindText($hWnd, $sText, $iStart = -1, $fPartialOK = True, $fWrapOK = True)
    Local $tFindInfo, $iFlags
    $tFindInfo = _tagLVFINDINFO()
    $iFlags = $LVFI_STRING
    If $fPartialOK Then $iFlags = BitOR($iFlags, $LVFI_PARTIAL)
    If $fWrapOK Then $iFlags = BitOR($iFlags, $LVFI_WRAP)
    _tagSetData ($tFindInfo, "Flags", $iFlags)
    Return _ListView_FindItem($hWnd, $iStart, $tFindInfo, $sText)
EndFunc   ;==>_ListView_FindText
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the background color of the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Background color
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetBkColor
; ===============================================================================================================================
Func _ListView_GetBkColor($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETBKCOLOR, 0, 0), 6)
EndFunc   ;==>_ListView_GetBkColor
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the background image in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - One or more of the following flags:
;                  | 0 - The control has no background
;                  | 1 - The background is from a bitmap
;                  | 2 - The background is from a URL
;                  |[2] - URL of the background image
;                  |[3] - Percentage of the client area that the image should be X offset
;                  |[4] - Percentage of the client area that the image should be Y offset
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetBkImage
; ===============================================================================================================================
Func _ListView_GetBkImage($hWnd)
    Local $pBuffer, $tBuffer, $pMemory, $tMemMap, $pText, $iImage, $pImage, $tImage, $aImage[5]
    $tBuffer = _tagCHARARRAY (4096)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tImage = _tagLVBKIMAGE()
    $pImage = _tagGetPtr ($tImage)
    _tagSetData ($tImage, "ImageMax", 4096)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tImage, "Image", $pBuffer)
        $aImage[0] = _API_SendMessage ($hWnd, $LVM_GETBKIMAGE, 0, $pImage) <> 0
    Else
        $iImage = _tagGetSize ($tImage)
        $pMemory = _Mem_Init ($hWnd, $iImage + 4096, $tMemMap)
        $pText = $pMemory + $iImage
        _tagSetData ($tImage, "Image", $pText)
        _Mem_Write ($tMemMap, $pImage, $pMemory, $iImage)
        $aImage[0] = _API_SendMessage ($hWnd, $LVM_GETBKIMAGE, 0, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pImage, $iImage)
        _Mem_Read ($tMemMap, $pText, $pBuffer, 4096)
        _Mem_Free ($tMemMap)
    EndIf
    Switch BitAND(_tagGetData ($tImage, "Flags"), $LVBKIF_SOURCE_MASK)
        Case $LVBKIF_SOURCE_HBITMAP
            $aImage[1] = 1
        Case $LVBKIF_SOURCE_URL
            $aImage[1] = 2
    EndSwitch
    $aImage[2] = _tagGetData ($tBuffer, 1)
    $aImage[3] = _tagGetData ($tImage, "XOffPercent")
    $aImage[4] = _tagGetData ($tImage, "YOffPercent")
    Return $aImage
EndFunc   ;==>_ListView_GetBkImage
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the callback mask for the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Callback mask
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetCallBackMask
; ===============================================================================================================================
Func _ListView_GetCallbackMask($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETCALLBACKMASK, 0, 0)
EndFunc   ;==>_ListView_GetCallbackMask
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the attributes of a column
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of column
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - Alignment of the column header and the subitem text in the column:
;                  | 0 - Text is left-aligned
;                  | 1 - Text is right-aligned
;                  | 2 - Text is centered
;                  |[2] - True if item displays an image from an image list
;                  |[3] - True if bitmap appears to the right of text
;                  |[4] - True header contains an image
;                  |[5] - Width of the column, in pixels
;                  |[6] - Column header text
;                  |[7] - Index of subitem associated with the column
;                  |[8] - Zero-based index of an image within the image list
;                  |[9] - Zero-based column order
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetColumn
; ===============================================================================================================================
Func _ListView_GetColumn($hWnd, $iIndex)
    Local $pBuffer, $tBuffer, $iColumn, $pColumn, $tColumn, $pMemory, $tMemMap, $pText, $aColumn[10]
    $tBuffer = _tagCHARARRAY (4096)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tColumn = _tagLVCOLUMN()
    $pColumn = _tagGetPtr ($tColumn)
    _tagSetData ($tColumn, "Mask", $LVCF_ALLDATA)
    _tagSetData ($tColumn, "TextMax", 4096)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tColumn, "Text", $pBuffer)
        $aColumn[0] = _API_SendMessage ($hWnd, $LVM_GETCOLUMN, $iIndex, $pColumn) <> 0
    Else
        $iColumn = _tagGetSize ($tColumn)
        $pMemory = _Mem_Init ($hWnd, $iColumn + 4096, $tMemMap)
        $pText = $pMemory + $iColumn
        _tagSetData ($tColumn, "Text", $pText)
        _Mem_Write ($tMemMap, $pColumn, $pMemory, $iColumn)
        $aColumn[0] = _API_SendMessage ($hWnd, $LVM_GETCOLUMN, $iIndex, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pColumn, $iColumn)
        _Mem_Read ($tMemMap, $pText, $pBuffer, 4096)
        _Mem_Free ($tMemMap)
    EndIf
    Switch BitAND(_tagGetData ($tColumn, "Fmt"), $LVCFMT_JUSTIFYMASK)
        Case $LVCFMT_RIGHT
            $aColumn[1] = 1
        Case $LVCFMT_CENTER
            $aColumn[1] = 2
        Case Else
            $aColumn[1] = 0
    EndSwitch
    $aColumn[2] = BitAND(_tagGetData ($tColumn, "Fmt"), $LVCFMT_IMAGE) <> 0
    $aColumn[3] = BitAND(_tagGetData ($tColumn, "Fmt"), $LVCFMT_BITMAP_ON_RIGHT) <> 0
    $aColumn[4] = BitAND(_tagGetData ($tColumn, "Fmt"), $LVCFMT_COL_HAS_IMAGES) <> 0
    $aColumn[5] = _tagGetData ($tColumn, "CX")
    $aColumn[6] = _tagGetData ($tBuffer, 1)
    $aColumn[7] = _tagGetData ($tColumn, "SubItem")
    $aColumn[8] = _tagGetData ($tColumn, "Image")
    $aColumn[9] = _tagGetData ($tColumn, "Order")
    Return $aColumn
EndFunc   ;==>_ListView_GetColumn
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the number of columns in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Column count
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetColumnCount($hWnd)
    Return _Header_GetItemCount (_ListView_GetHeader($hWnd))
EndFunc   ;==>_ListView_GetColumnCount
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the current left-to-right order of columns in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] - Number of items in array (n)
;                  |[1] - First column index
;                  |[2] - First column index
;                  |[n] - Last column index
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetColumnOrderArray
; ===============================================================================================================================
Func _ListView_GetColumnOrderArray($hWnd)
    Local $iI, $iBuffer, $pBuffer, $tBuffer, $iColumns, $pMemory, $tMemMap
    $iColumns = _ListView_GetColumnCount($hWnd)
    $tBuffer = _tagINT ($iColumns)
    $pBuffer = _tagGetPtr ($tBuffer)
    If _Lib_InProcess ($hWnd) Then
        _API_SendMessage ($hWnd, $LVM_GETCOLUMNORDERARRAY, $iColumns, $pBuffer)
    Else
        $iBuffer = _tagGetSize ($tBuffer)
        $pMemory = _Mem_Init ($hWnd, $iBuffer, $tMemMap)
        _API_SendMessage ($hWnd, $LVM_GETCOLUMNORDERARRAY, $iColumns, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pBuffer, $iBuffer)
        _Mem_Free ($tMemMap)
    EndIf
    Dim $aBuffer[$iColumns + 1]
    $aBuffer[0] = $iColumns
    For $iI = 1 To $iColumns
        $aBuffer[$iI] = _tagGetData ($tBuffer, $iI)
    Next
    Return $aBuffer
EndFunc   ;==>_ListView_GetColumnOrderArray
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the width of a column in report or list view mode
; Parameters ....: $hWnd        - Handle to the control
;                  $iColumn     - Zero based index of column. This parameter is ignored in list view.
; Return values .: Success      - Column width
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetColumnWidth
; ===============================================================================================================================
Func _ListView_GetColumnWidth($hWnd, $iColumn)
    Return _API_SendMessage ($hWnd, $LVM_GETCOLUMNWIDTH, $iColumn, 0)
EndFunc   ;==>_ListView_GetColumnWidth
; #FUNCTION# ====================================================================================================================
; Description ...: Calculates the number of items that can fit vertically in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The number of fully visible items
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetCountPerPage($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETCOUNTPERPAGE, 0, 0)
EndFunc   ;==>_ListView_GetCountPerPage
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the handle to the edit control being used to edit an item's text
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The handle to the edit control
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: When label editing begins, an edit control is created, positioned,  and  initialized.  Before  displayed,  the
;                  control sends its parent window an $LVN_BEGINLABELEDIT notification message.  If you want to  customize  label
;                  editing implement a handler for $LVN_BEGINLABELEDIT and have it send an  $LVM_GETEDITCONTROL  message  to  the
;                  control. If a label is being edited, the return value will be a handle to the edit control. Use this handle to
;                  customize the edit control by sending the usual EM_XXX messages. When the user completes or  cancels  editing,
;                  the edit control is destroyed and the handle is no longer valid.  You can subclass the edit control,  but  you
;                  should not destroy it.  To cancel editing, send the control a $WM_CANCELMODE message.  The control item  being
;                  edited is the currently focused item. To find an item based on its state, use the $LVM_GETNEXTITEM message.
; Related .......: _ListView_CancelEditLabel
; ===============================================================================================================================
Func _ListView_GetEditControl($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETEDITCONTROL, 0, 0))
EndFunc   ;==>_ListView_GetEditControl
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the extended styles that are currently in use for the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Styles currently in use
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetExtendedListViewStyle
; ===============================================================================================================================
Func _ListView_GetExtendedListViewStyle($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0))
EndFunc   ;==>_ListView_GetExtendedListViewStyle
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves group information
; Parameters ....: $hWnd        - Handle to the control
;                  $iGroupID    - ID that specifies the group whose information is retrieved
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - Header text
;                  |[2] - Footer text
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_SetGroupInfo
; ===============================================================================================================================
Func _ListView_GetGroupInfo($hWnd, $iGroupID)
    Local $iGroup, $pGroup, $tGroup, $pFooter, $tFooter, $pHeader, $tHeader
    Local $pMemory, $tMemMap, $pTextF, $pTextH, $aGroup[3]
    $tHeader = _tagCHARARRAY (4096)
    $pHeader = _tagGetPtr ($tHeader)
    $tFooter = _tagCHARARRAY (4096)
    $pFooter = _tagGetPtr ($tFooter)
    $tGroup = _tagLVGROUP()
    $pGroup = _tagGetPtr ($tGroup)
    _tagSetData ($tGroup, "HeaderMax", 4096)
    _tagSetData ($tGroup, "FooterMax", 4096)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tGroup, "Header", $pHeader)
        _tagSetData ($tGroup, "Footer", $pFooter)
        $aGroup[0] = _API_SendMessage ($hWnd, $LVM_GETGROUPINFO, $iGroupID, $pGroup) = $iGroupID
    Else
        $iGroup = _tagGetSize ($tGroup)
        $pMemory = _Mem_Init ($hWnd, $iGroup + 8096, $tMemMap)
        $pTextH = $pMemory + $iGroup
        $pTextF = $pMemory + $iGroup + 4096
        _tagSetData ($tGroup, "Header", $pTextH)
        _tagSetData ($tGroup, "Footer", $pTextF)
        $aGroup[0] = _API_SendMessage ($hWnd, $LVM_GETGROUPINFO, $iGroupID, $pMemory) = $iGroupID
        _Mem_Read ($tMemMap, $pMemory, $pGroup, $iGroup)
        _Mem_Read ($tMemMap, $pTextH, $pHeader, 4096)
        _Mem_Read ($tMemMap, $pTextF, $pFooter, 4096)
        _Mem_Free ($tMemMap)
    EndIf
    $aGroup[1] = _tagGetData ($tHeader, 1)
    $aGroup[2] = _tagGetData ($tFooter, 1)
    Return $aGroup
EndFunc   ;==>_ListView_GetGroupInfo
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the metrics of a group
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] - Left border
;                  |[1] - Top border
;                  |[2] - Right border
;                  |[3] - Bottom border
;                  |[4] - Color of left border
;                  |[5] - Color of top border
;                  |[6] - Color of right border
;                  |[7] - Color or bottom border
;                  |[8] - Color of header text
;                  |[9] - Color of footer text
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_SetGroupMetrics
; ===============================================================================================================================
Func _ListView_GetGroupMetrics($hWnd)
    Local $iGroup, $pGroup, $tGroup, $pMemory, $tMemMap, $aMetrics[10]
    $tGroup = _tagLVGROUPMETRICS()
    $pGroup = _tagGetPtr ($tGroup)
    $iGroup = _tagGetSize ($tGroup)
    _tagSetData ($tGroup, "Size", $iGroup)
    If _Lib_InProcess ($hWnd) Then
        _API_SendMessage ($hWnd, $LVM_GETGROUPMETRICS, 0, $pGroup)
    Else
        $pMemory = _Mem_Init ($hWnd, $iGroup, $tMemMap)
        _API_SendMessage ($hWnd, $LVM_GETGROUPMETRICS, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pGroup, $iGroup)
        _Mem_Free ($tMemMap)
    EndIf
    $aMetrics[0] = _tagGetData ($tGroup, "Left")
    $aMetrics[1] = _tagGetData ($tGroup, "Top")
    $aMetrics[2] = _tagGetData ($tGroup, "Right")
    $aMetrics[3] = _tagGetData ($tGroup, "Bottom")
    $aMetrics[4] = _tagGetData ($tGroup, "CRLeft")
    $aMetrics[5] = _tagGetData ($tGroup, "CRTop")
    $aMetrics[6] = _tagGetData ($tGroup, "CRRight")
    $aMetrics[7] = _tagGetData ($tGroup, "CRBottom")
    $aMetrics[8] = _tagGetData ($tGroup, "CRHeader")
    $aMetrics[9] = _tagGetData ($tGroup, "CRFooter")
    Return $aMetrics
EndFunc   ;==>_ListView_GetGroupMetrics
; #FUNCTION# ====================================================================================================================
; Description ...: Checks whether the listview control has group view enabled
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetGroupViewEnabled($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_ISGROUPVIEWENABLED, 0, 0) <> 0
EndFunc   ;==>_ListView_GetGroupViewEnabled
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the handle to the header control used by the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Item count
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetHeader($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETHEADER, 0, 0))
EndFunc   ;==>_ListView_GetHeader
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves a handle to the cursor used when the pointer is over an item
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Cursor handle
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetHotCursor
; ===============================================================================================================================
Func _ListView_GetHotCursor($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETHOTCURSOR, 0, 0))
EndFunc   ;==>_ListView_GetHotCursor
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the index of the hot item
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Zero based index of the item that is hot
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetHotItem
; ===============================================================================================================================
Func _ListView_GetHotItem($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETHOTITEM, 0, 0)
EndFunc   ;==>_ListView_GetHotItem
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the time that the cursor must hover over an item before it is selected
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Time in milliseconds. If the return value is -1, then the hover time is the default hover time.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The hover time only affects ListView controls that have the $LVS_EX_TRACKSELECT, $LVS_EX_ONECLICKACTIVATE,  or
;                  $LVS_EX_TWOCLICKACTIVATE extended listview style.
; Related .......: _ListView_SetHoverTime
; ===============================================================================================================================
Func _ListView_GetHoverTime($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETHOVERTIME, 0, 0)
EndFunc   ;==>_ListView_GetHoverTime
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the handle to an image list used for drawing listview items
; Parameters ....: $hWnd        - Handle to the control
;                  $iImageList  - Image list to retrieve:
;                  |0 - Image list with large icons
;                  |1 - Image list with small icons
;                  |2 - Image list with state images
; Return values .: Success      - The handle to the specified image list
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetImageList
; ===============================================================================================================================
Func _ListView_GetImageList($hWnd, $iImageList)
    Local $aImageList[3] = [$LVSIL_NORMAL, $LVSIL_SMALL, $LVSIL_STATE]
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETIMAGELIST, $aImageList[$iImageList], 0))
EndFunc   ;==>_ListView_GetImageList
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the position of the insertion point
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - True if the insertion point appears after the item, otherwise False
;                  |[2] - Item next to which the insertion point appears.  If this is -1, there is no insertion point.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only.  An insertion point can appear only if the control is in icon view, small icon view, or  tile
;                  view, and is not in group view  mode.
; Related .......: _ListView_SetInsertMark
; ===============================================================================================================================
Func _ListView_GetInsertMark($hWnd)
    Local $iMark, $pMark, $tMark, $pMemory, $tMemMap, $aMark[3]
    $tMark = _tagLVINSERTMARK()
    $pMark = _tagGetPtr ($tMark)
    $iMark = _tagGetSize ($tMark)
    _tagSetData ($tMark, "Size", $iMark)
    If _Lib_InProcess ($hWnd) Then
        $aMark[0] = _API_SendMessage ($hWnd, $LVM_GETINSERTMARK, 0, $pMark)
    Else
        $pMemory = _Mem_Init ($hWnd, $iMark, $tMemMap)
        _Mem_Write ($tMemMap, $pMark)
        $aMark[0] = _API_SendMessage ($hWnd, $LVM_GETINSERTMARK, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pMark, $iMark)
        _Mem_Free ($tMemMap)
    EndIf
    $aMark[1] = _tagGetData ($tMark, "Flags") = $LVIM_AFTER
    $aMark[2] = _tagGetData ($tMark, "Item")
    Return $aMark
EndFunc   ;==>_ListView_GetInsertMark
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the color of the insertion point
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Color of the insertion point
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_SetInsertMarkColor
; ===============================================================================================================================
Func _ListView_GetInsertMarkColor($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETINSERTMARKCOLOR, $LVSIL_STATE, 0), 6)
EndFunc   ;==>_ListView_GetInsertMarkColor
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the rectangle that bounds the insertion point
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] = True if insertion point found, otherwise False
;                  |[1] = X coordinate of the upper left corner of the rectangle
;                  |[2] = Y coordinate of the upper left corner of the rectangle
;                  |[3] = X coordinate of the lower right corner of the rectangle
;                  |[4] = Y coordinate of the lower right corner of the rectangle
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......:
; ===============================================================================================================================
Func _ListView_GetInsertMarkRect($hWnd)
    Local $iRect, $pRect, $tRect, $pMemory, $tMemMap, $aRect[5]
    $tRect = _tagRECT ()
    $pRect = _tagGetPtr ($tRect)
    If _Lib_InProcess ($hWnd) Then
        $aRect[0] = _API_SendMessage ($hWnd, $LVM_GETINSERTMARKRECT, 0, $pRect) <> 0
    Else
        $iRect = _tagGetSize ($tRect)
        $pMemory = _Mem_Init ($hWnd, $iRect, $tMemMap)
        $aRect[0] = _API_SendMessage ($hWnd, $LVM_GETINSERTMARKRECT, 0, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pRect, $iRect)
        _Mem_Free ($tMemMap)
    EndIf
    $aRect[1] = _tagGetData ($tRect, "Left")
    $aRect[2] = _tagGetData ($tRect, "Top")
    $aRect[3] = _tagGetData ($tRect, "Right")
    $aRect[4] = _tagGetData ($tRect, "Bottom")
    Return $aRect
EndFunc   ;==>_ListView_GetInsertMarkRect
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the incremental search string of the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Incremental search string
;                  Failure      - "" if no in incremental search mode
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetISearchString($hWnd)
    Local $iBuffer, $pBuffer, $tBuffer, $pMemory, $tMemMap
    $iBuffer = _API_SendMessage ($hWnd, $LVM_GETISEARCHSTRING, 0, 0) + 1
    If $iBuffer = 1 Then Return ""
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    If _Lib_InProcess ($hWnd) Then
        _API_SendMessage ($hWnd, $LVM_GETISEARCHSTRING, 0, $pBuffer)
    Else
        $pMemory = _Mem_Init ($hWnd, $iBuffer, $tMemMap)
        _API_SendMessage ($hWnd, $LVM_GETISEARCHSTRING, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pBuffer, $iBuffer)
        _Mem_Free ($tMemMap)
    EndIf
    Return _tagGetData ($tBuffer, 1)
EndFunc   ;==>_ListView_GetISearchString
; ===============================================================================================================================
; Description ...: Retrieves some or all of an item's attributes
; Parameters ....: $hWnd        - Handle to the control
;                  $tItem       - _tagLVITEM structure that specifies the information to retrieve.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetItem
; ===============================================================================================================================
Func _ListView_GetItem($hWnd, ByRef $tItem)
    Local $iItem, $pItem, $pMemory, $tMemMap, $iResult
    $pItem = _tagGetPtr ($tItem)
    If _Lib_InProcess ($hWnd) Then
        $iResult = _API_SendMessage ($hWnd, $LVM_GETITEM, 0, $pItem)
    Else
        $iItem = _tagGetSize ($tItem)
        $pMemory = _Mem_Init ($hWnd, $iItem, $tMemMap)
        _Mem_Write ($tMemMap, $pItem)
        _API_SendMessage ($hWnd, $LVM_GETITEM, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pItem, $iItem)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult
EndFunc   ;==>_ListView_GetItem
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the number of items in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Item count
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetItemCount($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETITEMCOUNT, 0, 0)
EndFunc   ;==>_ListView_GetItemCount
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the item is marked for a cut-and-past operation
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemState
; ===============================================================================================================================
Func _ListView_GetItemCut($hWnd, $iIndex)
    Return _ListView_GetItemState($hWnd, $iIndex, $LVIS_CUT) <> 0
EndFunc   ;==>_ListView_GetItemCut
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the item is highlighted as a drag-and-drop target
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemState
; ===============================================================================================================================
Func _ListView_GetItemDropHilited($hWnd, $iIndex)
    Return _ListView_GetItemState($hWnd, $iIndex, $LVIS_DROPHILITED) <> 0
EndFunc   ;==>_ListView_GetItemDropHilited
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the item is highlighted as a drag-and-drop target
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemState
; ===============================================================================================================================
Func _ListView_GetItemFocused($hWnd, $iIndex)
    Return _ListView_GetItemState($hWnd, $iIndex, $LVIS_FOCUSED) <> 0
EndFunc   ;==>_ListView_GetItemFocused
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the index of the item's icon
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based item index
;                  $iSubItem    - One based item sub item index
; Return values .: Success      - Zero based item image index
;                  Failue       - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetItemImage
; ===============================================================================================================================
Func _ListView_GetItemImage($hWnd, $iIndex, $iSubItem = 0)
    Local $tItem
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_IMAGE)
    _tagSetData ($tItem, "Item", $iIndex)
    _tagSetData ($tItem, "SubItem", $iSubItem)
    _ListView_GetItem($hWnd, $tItem)
    Return _tagGetData ($tItem, "Image")
EndFunc   ;==>_ListView_GetItemImage
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the number of image widths the item is indented
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based item index
; Return values .: Success      - Item indention
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetItemIndent
; ===============================================================================================================================
Func _ListView_GetItemIndent($hWnd, $iIndex)
    Local $tItem
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_INDENT)
    _tagSetData ($tItem, "Item", $iIndex)
    _ListView_GetItem($hWnd, $tItem)
    Return _tagGetData ($tItem, "Indent")
EndFunc   ;==>_ListView_GetItemIndent
; #FUNCTION# ====================================================================================================================
; Description ...: Gets the overlay image that is superimposed over the item's icon image
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - Zero based image index
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetItemOverlayImage
; ===============================================================================================================================
Func _ListView_GetItemOverlayImage($hWnd, $iIndex)
    Return BitShift(_ListView_GetItemState($hWnd, $iIndex, $LVIS_OVERLAYMASK), 8)
EndFunc   ;==>_ListView_GetItemOverlayImage
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the application specific value of the item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based item index
; Return values .: Success      - Application specific value
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetItemParam
; ===============================================================================================================================
Func _ListView_GetItemParam($hWnd, $iIndex)
    Local $tItem
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_PARAM)
    _tagSetData ($tItem, "Item", $iIndex)
    Return _tagGetData ($tItem, "Param")
EndFunc   ;==>_ListView_GetItemParam
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the position of an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - X position of item
;                  |[2] - Y position of item
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemPositionX, _ListView_GetItemPositionY, _ListView_SetItemPosition
; ===============================================================================================================================
Func _ListView_GetItemPosition($hWnd, $iIndex)
    Local $iPoint, $pPoint, $tPoint, $pMemory, $tMemMap, $aPoint[3]
    $tPoint = _tagPOINT ()
    $pPoint = _tagGetPtr ($tPoint)
    If _Lib_InProcess ($hWnd) Then
        $aPoint[0] = _API_SendMessage ($hWnd, $LVM_GETITEMPOSITION, $iIndex, $pPoint) <> 0
    Else
        $iPoint = _tagGetSize ($tPoint)
        $pMemory = _Mem_Init ($hWnd, $iPoint, $tMemMap)
        $aPoint[0] = _API_SendMessage ($hWnd, $LVM_GETITEMPOSITION, $iIndex, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pPoint, $iPoint)
        _Mem_Free ($tMemMap)
    EndIf
    $aPoint[1] = _tagGetData ($tPoint, "X")
    $aPoint[2] = _tagGetData ($tPoint, "Y")
    Return $aPoint
EndFunc   ;==>_ListView_GetItemPosition
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the X position of an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - X position of item
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemPosition, _ListView_GetItemPositionY, _ListView_SetItemPosition
; ===============================================================================================================================
Func _ListView_GetItemPositionX($hWnd, $iIndex)
    Local $aPoint
    $aPoint = _ListView_GetItemPosition($hWnd, $iIndex)
    Return $aPoint[1]
EndFunc   ;==>_ListView_GetItemPositionX
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the Y position of an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - Y position of item
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemPosition, _ListView_GetItemPositionX, _ListView_SetItemPosition
; ===============================================================================================================================
Func _ListView_GetItemPositionY($hWnd, $iIndex)
    Local $aPoint
    $aPoint = _ListView_GetItemPosition($hWnd, $iIndex)
    Return $aPoint[2]
EndFunc   ;==>_ListView_GetItemPositionY
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the bounding rectangle for all or part of an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iPart       - The portion of the listview item to retrieve:
;                  |0 - The bounding rectangle of the entire item
;                  |1 - The bounding rectangle of the icon or small icon
;                  |2 - The bounding rectangle of the item text
;                  |3 - The union of 1 and 2, but excludes columns in report view
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - X coordinate of the upper left corner of the rectangle
;                  |[2] - Y coordinate of the upper left corner of the rectangle
;                  |[3] - X coordinate of the lower right corner of the rectangle
;                  |[4] - Y coordinate of the lower right corner of the rectangle
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemRectEx
; ===============================================================================================================================
Func _ListView_GetItemRect($hWnd, $iIndex, $iPart = 3)
    Local $tRect, $aRect[5]
    Local $aPart[4] = [$LVIR_BOUNDS, $LVIR_ICON, $LVIR_LABEL, $LVIR_SELECTBOUNDS]
    $tRect = _ListView_GetItemRectEx($hWnd, $iIndex, $iPart)
    $aRect[0] = _tagGetData ($tRect, "Result")
    $aRect[1] = _tagGetData ($tRect, "Left")
    $aRect[2] = _tagGetData ($tRect, "Top")
    $aRect[3] = _tagGetData ($tRect, "Right")
    $aRect[4] = _tagGetData ($tRect, "Bottom")
    Return $aRect
EndFunc   ;==>_ListView_GetItemRect
; ===============================================================================================================================
; Description ...: Retrieves the bounding rectangle for all or part of an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iPart       - The portion of the listview item to retrieve:
;                  |$LVIR_BOUNDS       - Returns the bounding rectangle of the entire item, including the icon and label
;                  |$LVIR_ICON         - Returns the bounding rectangle of the icon or small icon
;                  |$LVIR_LABEL        - Returns the bounding rectangle of the item text
;                  |$LVIR_SELECTBOUNDS - Returns the union of the $LVIR_ICON and $LVIR_LABEL rectangles, but excludes columns  in
;                  +report view.
; Return values .: Success      - _tagRECTX structure
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemRect
; ===============================================================================================================================
Func _ListView_GetItemRectEx($hWnd, $iIndex, $iPart = 3)
    Local $iRect, $pRect, $tRect, $pMemory, $tMemMap
    $tRect = _tagRECTX ()
    $pRect = _tagGetPtr ($tRect)
    _tagSetData ($tRect, "Left", $iPart)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tRect, "Result", _API_SendMessage ($hWnd, $LVM_GETITEMRECT, $iIndex, $pRect))
    Else
        $iRect = _tagGetSize ($tRect)
        $pMemory = _Mem_Init ($hWnd, $iRect, $tMemMap)
        _Mem_Write ($tMemMap, $pRect)
        _tagSetData ($tRect, "Result", _API_SendMessage ($hWnd, $LVM_GETITEMRECT, $iIndex, $pMemory))
        _Mem_Read ($tMemMap, $pMemory, $pRect, $iRect)
        _Mem_Free ($tMemMap)
    EndIf
    Return $tRect
EndFunc   ;==>_ListView_GetItemRectEx
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the item is selected
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemState
; ===============================================================================================================================
Func _ListView_GetItemSelected($hWnd, $iIndex)
    Return _ListView_GetItemState($hWnd, $iIndex, $LVIS_SELECTED) <> 0
EndFunc   ;==>_ListView_GetItemSelected
; #FUNCTION# ====================================================================================================================
; Description ...: Determines the spacing between items in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $fSmall      - View for which to retrieve the item spacing:
;                  | True - Small icon view
;                  |False - Icon view
; Return values .: Success      - Array with the following format:
;                  |[0] - Horizontal spacing
;                  |[1] - Vertical spacing
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemSpacingHorz, _ListView_GetItemSpacingVert
; ===============================================================================================================================
Func _ListView_GetItemSpacing($hWnd, $fSmall = False)
    Local $iSpace, $aSpace[2]
    $iSpace = _API_SendMessage ($hWnd, $LVM_GETITEMSPACING, $fSmall, 0)
    $aSpace[0] = _Lib_LoWord ($iSpace)
    $aSpace[1] = _Lib_HiWord ($iSpace)
    Return $aSpace
EndFunc   ;==>_ListView_GetItemSpacing
; #FUNCTION# ====================================================================================================================
; Description ...: Determines the horizontal spacing between items in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $fSmall      - View for which to retrieve the item spacing:
;                  | True - Small icon view
;                  |False - Icon view
; Return values .: Success      - Horizontal spacing
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemSpacing, _ListView_GetItemSpacingVert
; ===============================================================================================================================
Func _ListView_GetItemSpacingHorz($hWnd, $fSmall = False)
    Local $aSpace
    $aSpace = _ListView_GetItemSpacing($hWnd, $fSmall)
    Return $aSpace[0]
EndFunc   ;==>_ListView_GetItemSpacingHorz
; #FUNCTION# ====================================================================================================================
; Description ...: Determines the vertical spacing between items in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $fSmall      - View for which to retrieve the item spacing:
;                  | True - Small icon view
;                  |False - Icon view
; Return values .: Success      - Vertical spacing
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemSpacing, _ListView_GetItemSpacingHorz
; ===============================================================================================================================
Func _ListView_GetItemSpacingVert($hWnd, $fSmall = False)
    Local $aSpace
    $aSpace = _ListView_GetItemSpacing($hWnd, $fSmall)
    Return $aSpace[1]
EndFunc   ;==>_ListView_GetItemSpacingVert
; ===============================================================================================================================
; Description ...: Retrieves the state of a listview item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iMask       - State information to retrieve. This can be a combination of:
;                  |$LVIS_CUT            - The item is marked for a cut-and-paste operation
;                  |$LVIS_DROPHILITED    - The item is highlighted as a drag-and-drop target
;                  |$LVIS_FOCUSED        - The item has the focus, so it is surrounded by a standard focus rectangle
;                  |$LVIS_SELECTED       - The item is selected
;                  |$LVIS_OVERLAYMASK    - Use this mask to retrieve the item's overlay image index
;                  |$LVIS_STATEIMAGEMASK - Use this mask to retrieve the item's state image index
; Return values .: Success      - The current state for the specified item
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: An items state information includes a set of bit flags as well as image list indexes that indicate the  item's
;                  state image and overlay image
; Related .......: _ListView_SetItemState
; ===============================================================================================================================
Func _ListView_GetItemState($hWnd, $iIndex, $iMask)
    Return _API_SendMessage ($hWnd, $LVM_GETITEMSTATE, $iIndex, $iMask)
EndFunc   ;==>_ListView_GetItemState
; #FUNCTION# ====================================================================================================================
; Description ...: Gets the state image that is displayed
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - One based overlay image index
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetItemStateImage
; ===============================================================================================================================
Func _ListView_GetItemStateImage($hWnd, $iIndex, $iImage)
    Return BitShift(_ListView_GetItemState($hWnd, $iIndex, $LVIS_STATEIMAGEMASK), 12)
EndFunc   ;==>_ListView_GetItemStateImage
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the text of an item or subitem
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iSubItem    - One based sub item index
; Return values .: Success      - Item or subitem text
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: To retrieve the item text, set iSubItem to zero. To retrieve the text of a subitem, set iSubItem  to  the  one
;                  based subitem's index.
; Related .......: _ListView_SetItemText
; ===============================================================================================================================
Func _ListView_GetItemText($hWnd, $iIndex, $iSubItem = 0)
    Local $pBuffer, $tBuffer, $iItem, $pItem, $tItem, $pMemory, $tMemMap, $pText
    $tBuffer = _tagCHARARRAY (4096)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tItem = _tagLVITEM()
    $pItem = _tagGetPtr ($tItem)
    _tagSetData ($tItem, "SubItem", $iSubItem)
    _tagSetData ($tItem, "TextMax", 4096)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tItem, "Text", $pBuffer)
        _API_SendMessage ($hWnd, $LVM_GETITEMTEXT, $iIndex, $pItem)
    Else
        $iItem = _tagGetSize ($tItem)
        $pMemory = _Mem_Init ($hWnd, $iItem + 4096, $tMemMap)
        $pText = $pMemory + $iItem
        _tagSetData ($tItem, "Text", $pText)
        _Mem_Write ($tMemMap, $pItem, $pMemory, $iItem)
        _API_SendMessage ($hWnd, $LVM_GETITEMTEXT, $iIndex, $pMemory)
        _Mem_Read ($tMemMap, $pText, $pBuffer, 4096)
        _Mem_Free ($tMemMap)
    EndIf
    Return _tagGetData ($tBuffer, 1)
EndFunc   ;==>_ListView_GetItemText
; #FUNCTION# ====================================================================================================================
; Description ...: Searches for an item that has the specified properties
; Parameters ....: $hWnd        - Handle to the control
;                  $iStart      - Index of the item to begin the search with, or -1 to find  the  first  item  that  matches  the
;                  +specified flags.  The specified item itself is excluded from the search.
;                  $iSearch     - Relationship to the index of the item where the search is to begin:
;                  |0 - Searches for a subsequent item by index
;                  |1 - Searches for an item that is above the specified item
;                  |2 - Searches for an item that is below the specified item
;                  |3 - Searches for an item to the left of the specified item
;                  |4 - Searches for an item to the right of the specified item
;                  $iState      - State of the item to find. Can be a combination of:
;                  |1 - The item is cut
;                  |2 - The item is highlighted
;                  |4 - The item is focused
;                  |8 - The item is selected
; Return values .: Success      - The zero based index of the next item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetNextItem($hWnd, $iStart, $iSearch = 0, $iState = 0)
    Local $iFlags, $aSearch[5] = [$LVNI_ALL, $LVNI_ABOVE, $LVNI_BELOW, $LVNI_TOLEFT, $LVNI_TORIGHT]
    $iFlags = $aSearch[$iSearch]
    If BitAND($iState, 1) <> 0 Then $iFlags = BitOR($iFlags, $LVNI_CUT)
    If BitAND($iState, 2) <> 0 Then $iFlags = BitOR($iFlags, $LVNI_DROPHILITED)
    If BitAND($iState, 4) <> 0 Then $iFlags = BitOR($iFlags, $LVNI_FOCUSED)
    If BitAND($iState, 8) <> 0 Then $iFlags = BitOR($iFlags, $LVNI_SELECTED)
    Return _API_SendMessage ($hWnd, $LVM_GETNEXTITEM, $iStart, $iFlags)
EndFunc   ;==>_ListView_GetNextItem
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the number of working areas in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Number of working areas
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetNumberOfWorkAreas($hWnd)
    Local $pBuffer, $tBuffer
    $tBuffer = _tagINT (1)
    $pBuffer = _tagGetPtr ($tBuffer)
    _API_SendMessage ($hWnd, $LVM_GETNUMBEROFWORKAREAS, 0, $pBuffer)
    Return _tagGetData ($tBuffer, 1)
EndFunc   ;==>_ListView_GetNumberOfWorkAreas
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the current view origin for the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - View X position
;                  |[2] - View Y position
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetOriginX, _ListView_GetOriginY
; ===============================================================================================================================
Func _ListView_GetOrigin($hWnd)
    Local $iPoint, $pPoint, $tPoint, $pMemory, $tMemMap, $aOrigin[3]
    $tPoint = _tagPOINT ()
    $pPoint = _tagGetPtr ($tPoint)
    If _Lib_InProcess ($hWnd) Then
        $aOrigin[0] = _API_SendMessage ($hWnd, $LVM_GETORIGIN, 0, $pPoint) <> 0
    Else
        $iPoint = _tagGetSize ($tPoint)
        $pMemory = _Mem_Init ($hWnd, $iPoint, $tMemMap)
        $aOrigin[0] = _API_SendMessage ($hWnd, $LVM_GETORIGIN, 0, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pPoint, $iPoint)
        _Mem_Free ($tMemMap)
    EndIf
    $aOrigin[1] = _tagGetData ($tPoint, "X")
    $aOrigin[2] = _tagGetData ($tPoint, "Y")
    Return $aOrigin
EndFunc   ;==>_ListView_GetOrigin
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the current horizontal view origin for the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - View X position
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetOrigin, _ListView_GetOriginY
; ===============================================================================================================================
Func _ListView_GetOriginX($hWnd)
    Local $aOrigin
    $aOrigin = _ListView_GetOrigin($hWnd)
    Return $aOrigin[1]
EndFunc   ;==>_ListView_GetOriginX
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the current horizontal view origin for the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - View Y position
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetOrigin, _ListView_GetOriginX
; ===============================================================================================================================
Func _ListView_GetOriginY($hWnd)
    Local $aOrigin
    $aOrigin = _ListView_GetOrigin($hWnd)
    Return $aOrigin[2]
EndFunc   ;==>_ListView_GetOriginY
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the color of the border of the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Border color of the control
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_SetOutlineColor
; ===============================================================================================================================
Func _ListView_GetOutlineColor($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETOUTLINECOLOR, 0, 0), 6)
EndFunc   ;==>_ListView_GetOutlineColor
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the index of the selected column
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The zero based index of the selected column
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_SetSelectedColumn
; ===============================================================================================================================
Func _ListView_GetSelectedColumn($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETSELECTEDCOLUMN, 0, 0)
EndFunc   ;==>_ListView_GetSelectedColumn
; #FUNCTION# ====================================================================================================================
; Description ...: Determines the number of selected items in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The number of selected items
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetSelectedColumn
; ===============================================================================================================================
Func _ListView_GetSelectedCount($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETSELECTEDCOUNT, 0, 0)
EndFunc   ;==>_ListView_GetSelectedCount
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the selection mark from the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The zero based selection mark
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The selection mark is the item index from which a multiple selection starts
; Related .......: _ListView_SetSelectionMark
; ===============================================================================================================================
Func _ListView_GetSelectionMark($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETSELECTIONMARK, 0, 0)
EndFunc   ;==>_ListView_GetSelectionMark
; #FUNCTION# ====================================================================================================================
; Description ...: Determines the width of a specified string
; Parameters ....: $hWnd        - Handle to the control
;                  $sString     - String for which the width will be calculated
; Return values .: Success      - The string width
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: This function returns the exact width, in pixels, of the specified string.  If you  use  the  returned  string
;                  width as the column width in the SetColumnWidth function the string will be truncated.  To retrieve the column
;                  width that can contain the string without truncating it, you must add padding to the returned string width.
; Related .......:
; ===============================================================================================================================
Func _ListView_GetStringWidth($hWnd, $sString)
    Local $iBuffer, $pBuffer, $tBuffer, $pMemory, $tMemMap, $iResult
    $iBuffer = StringLen($sString) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    _tagSetData ($tBuffer, 1, $sString)
    If _Lib_InProcess ($hWnd) Then
        $iResult = _API_SendMessage ($hWnd, $LVM_GETSTRINGWIDTH, 0, $pBuffer)
    Else
        $pMemory = _Mem_Init ($hWnd, $iBuffer, $tMemMap)
        _Mem_Write ($tMemMap, $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_GETSTRINGWIDTH, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pBuffer, $iBuffer)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult
EndFunc   ;==>_ListView_GetStringWidth
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves information about an item bounding rectangle
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the subitem's parent item
;                  $iSubItem    - One based index of the subitem
;                  $iPart       - The portion of the subitem item to retrieve:
;                  |0 - The rectangle of the entire subitem, including the icon and label
;                  |1 - The rectangle of the icon or small icon
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - X coordinate of the upper left corner of the rectangle
;                  |[2] - Y coordinate of the upper left corner of the rectangle
;                  |[3] - X coordinate of the lower right corner of the rectangle
;                  |[4] - Y coordinate of the lower right corner of the rectangle
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: This function is used only with controls that use the $LVS_REPORT style
; Related .......:
; ===============================================================================================================================
Func _ListView_GetSubItemRect($hWnd, $iIndex, $iSubItem, $iPart = 0)
    Local $iRect, $pRect, $tRect, $pMemory, $tMemMap, $aRect[5], $aPart[2] = [$LVIR_BOUNDS, $LVIR_ICON]
    $tRect = _tagRECTX ()
    $pRect = _tagGetPtr ($tRect)
    _tagSetData ($tRect, "Top", $iSubItem)
    _tagSetData ($tRect, "Left", $aPart[$iPart])
    If _Lib_InProcess ($hWnd) Then
        $aRect[0] = _API_SendMessage ($hWnd, $LVM_GETSUBITEMRECT, $iIndex, $pRect) <> 0
    Else
        $iRect = _tagGetSize ($tRect)
        $pMemory = _Mem_Init ($hWnd, $iRect, $tMemMap)
        _Mem_Write ($tMemMap, $pRect)
        $aRect[0] = _API_SendMessage ($hWnd, $LVM_GETSUBITEMRECT, $iIndex, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pRect, $iRect)
        _Mem_Free ($tMemMap)
    EndIf
    $aRect[1] = _tagGetData ($tRect, "Left")
    $aRect[2] = _tagGetData ($tRect, "Top")
    $aRect[3] = _tagGetData ($tRect, "Right")
    $aRect[4] = _tagGetData ($tRect, "Bottom")
    Return $aRect
EndFunc   ;==>_ListView_GetSubItemRect
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the text background color of the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Text background color
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetTextBkColor
; ===============================================================================================================================
Func _ListView_GetTextBkColor($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETTEXTBKCOLOR, 0, 0), 6)
EndFunc   ;==>_ListView_GetTextBkColor
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the text color of the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Text color
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetTextColor
; ===============================================================================================================================
Func _ListView_GetTextColor($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETTEXTCOLOR, 0, 0), 6)
EndFunc   ;==>_ListView_GetTextColor
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the ToolTip control handle
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The handle of the ToolTip control
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetToolTips
; ===============================================================================================================================
Func _ListView_GetToolTips($hWnd)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_GETTOOLTIPS, 0, 0), 6)
EndFunc   ;==>_ListView_GetToolTips
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the index of the topmost visible item when in list or report view mode
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The zero based index of the item
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_GetTopIndex($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETTOPINDEX, 0, 0)
EndFunc   ;==>_ListView_GetTopIndex
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the Unicode character format flag for the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: True         - Control is using Unicode characters
;                  False        - Control is using ANSI characters
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetUnicodeFormat
; ===============================================================================================================================
Func _ListView_GetUnicodeFormat($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_GETUNICODEFORMAT, 0, 0) <> 0
EndFunc   ;==>_ListView_GetUnicodeFormat
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the current view of the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - The current view:
;                  |0 - Details
;                  |1 - Large Icon
;                  |2 - List
;                  |3 - Small Icon
;                  |4 - Tile
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_SetView
; ===============================================================================================================================
Func _ListView_GetView($hWnd)
    Switch _API_SendMessage ($hWnd, $LVM_GETVIEW, 0, 0)
        Case $LV_VIEW_DETAILS
            Return 0
        Case $LV_VIEW_ICON
            Return 1
        Case $LV_VIEW_LIST
            Return 2
        Case $LV_VIEW_SMALLICON
            Return 3
        Case $LV_VIEW_TILE
            Return 4
        Case Else
            Return -1
    EndSwitch
EndFunc   ;==>_ListView_GetView
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the view mode is details
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetView
; ===============================================================================================================================
Func _ListView_GetViewDetails($hWnd)
    Return _ListView_GetView($hWnd) = 0
EndFunc   ;==>_ListView_GetViewDetails
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the view mode is large icon
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetView
; ===============================================================================================================================
Func _ListView_GetViewLarge($hWnd)
    Return _ListView_GetView($hWnd) = 1
EndFunc   ;==>_ListView_GetViewLarge
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the view mode is list
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetView
; ===============================================================================================================================
Func _ListView_GetViewList($hWnd)
    Return _ListView_GetView($hWnd) = 2
EndFunc   ;==>_ListView_GetViewList
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the view mode is small icon
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetView
; ===============================================================================================================================
Func _ListView_GetViewSmall($hWnd)
    Return _ListView_GetView($hWnd) = 3
EndFunc   ;==>_ListView_GetViewSmall
; #FUNCTION# ====================================================================================================================
; Description ...: Determines whether the view mode is tile
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetView
; ===============================================================================================================================
Func _ListView_GetViewTile($hWnd)
    Return _ListView_GetView($hWnd) = 4
EndFunc   ;==>_ListView_GetViewTile
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the bounding rectangle of all items in the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - X coordinate of the upper left corner of the rectangle
;                  |[2] - Y coordinate of the upper left corner of the rectangle
;                  |[3] - X coordinate of the lower right corner of the rectangle
;                  |[4] - Y coordinate of the lower right corner of the rectangle
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The control must be in icon or small icon view
; Related .......:
; ===============================================================================================================================
Func _ListView_GetViewRect($hWnd)
    Local $iView, $iRect, $pRect, $tRect, $pMemory, $tMemMap, $aRect[5] = [False, 0, 0, 0, 0]
    $iView = _ListView_GetView($hWnd)
    If ($iView <> 1) And ($iView <> 3) Then Return $aRect
    $tRect = _tagRECT ()
    $pRect = _tagGetPtr ($tRect)
    If _Lib_InProcess ($hWnd) Then
        $aRect[0] = _API_SendMessage ($hWnd, $LVM_GETVIEWRECT, 0, $pRect) <> 0
    Else
        $iRect = _tagGetSize ($tRect)
        $pMemory = _Mem_Init ($hWnd, $iRect, $tMemMap)
        $aRect[0] = _API_SendMessage ($hWnd, $LVM_GETVIEWRECT, 0, $pMemory) <> 0
        _Mem_Read ($tMemMap, $pMemory, $pRect, $iRect)
        _Mem_Free ($tMemMap)
    EndIf
    $aRect[1] = _tagGetData ($tRect, "Left")
    $aRect[2] = _tagGetData ($tRect, "Top")
    $aRect[3] = _tagGetData ($tRect, "Right")
    $aRect[4] = _tagGetData ($tRect, "Bottom")
    Return $aRect
EndFunc   ;==>_ListView_GetViewRect
; #FUNCTION# ====================================================================================================================
; Description ...: Determines which item is at a specified position
; Parameters ....: $hWnd        - Handle to the control
;                  $iX          - X position, in client coordinates, to be tested
;                  $iY          - Y position, in client coordinates, to be tested
; Return values .: Success      - Array with the following format:
;                  |[0] - Zero based index of the item at the specified position, or -1
;                  |[1] - If True, position is in control's client window but not on an item
;                  |[2] - If True, position is over item icon
;                  |[3] - If True, position is over item text
;                  |[4] - If True, position is over item state image
;                  |[5] - If True, position is somewhere on the item
;                  |[6] - If True, position is above the control's client area
;                  |[7] - If True, position is below the control's client area
;                  |[8] - If True, position is to the left of the client area
;                  |[9] - If True, position is to the right of the client area
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_HitTest($hWnd, $iX, $iY)
    Local $iFlags, $iTest, $tTest, $pTest, $pMemory, $tMemMap, $aTest[10]
    $tTest = _tagLVHITTESTINFO()
    $pTest = _tagGetPtr ($tTest)
    _tagSetData ($tTest, "X", $iX)
    _tagSetData ($tTest, "Y", $iY)
    If _Lib_InProcess ($hWnd) Then
        $aTest[0] = _API_SendMessage ($hWnd, $LVM_HITTEST, 0, $pTest)
    Else
        $iTest = _tagGetSize ($tTest)
        $pMemory = _Mem_Init ($hWnd, $iTest, $tMemMap)
        _Mem_Write ($tMemMap, $pTest)
        $aTest[0] = _API_SendMessage ($hWnd, $LVM_HITTEST, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pTest, $iTest)
        _Mem_Free ($tMemMap)
    EndIf
    $iFlags = _tagGetData ($tTest, "Flags")
    $aTest[1] = BitAND($iFlags, $LVHT_NOWHERE) <> 0
    $aTest[2] = BitAND($iFlags, $LVHT_ONITEMICON) <> 0
    $aTest[3] = BitAND($iFlags, $LVHT_ONITEMLABEL) <> 0
    $aTest[4] = BitAND($iFlags, $LVHT_ONITEMSTATEICON) <> 0
    $aTest[5] = BitAND($iFlags, $LVHT_ONITEM) <> 0
    $aTest[6] = BitAND($iFlags, $LVHT_ABOVE) <> 0
    $aTest[7] = BitAND($iFlags, $LVHT_BELOW) <> 0
    $aTest[8] = BitAND($iFlags, $LVHT_TOLEFT) <> 0
    $aTest[9] = BitAND($iFlags, $LVHT_TORIGHT) <> 0
    Return $aTest
EndFunc   ;==>_ListView_HitTest
; #FUNCTION# ====================================================================================================================
; Description ...: Inserts a new column in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of new column
;                  $sText       - Column header text
;                  $iWidth      - Width of the column, in pixels
;                  $sAlign      - Alignment of the column header and the subitem text in the column:
;                  |  Left - Text is left aligned
;                  | Right - Text is right aligned
;                  |Center - Text is centered
;                  $iImage      - Zero based index of an image within the image list
;                  $fOnRight    - If True, the column image appears to the right of text
; Return values .: Success      - The index of the new column
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The alignment of the leftmost column is always left-justified; it cannot be changed
; Related .......:
; ===============================================================================================================================
Func _ListView_InsertColumn($hWnd, $iIndex, $sText, $iWidth = 50, $sAlign = "left", $iImage = -1, $fOnRight = False)
    Local $iBuffer, $pBuffer, $tBuffer, $iColumn, $pColumn, $tColumn, $pMemory, $tMemMap, $pText, $iMask, $iFmt, $iResult
    $iBuffer = StringLen($sText) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tColumn = _tagLVCOLUMN()
    $pColumn = _tagGetPtr ($tColumn)
    $iMask = BitOR($LVCF_FMT, $LVCF_WIDTH, $LVCF_TEXT)
    Switch $sAlign
        Case "right"
            $iFmt = $LVCFMT_RIGHT
        Case "center"
            $iFmt = $LVCFMT_CENTER
    EndSwitch
    If $iImage <> -1 Then
        $iMask = BitOR($iMask, $LVCF_IMAGE)
        $iFmt = BitOR($iFmt, $LVCFMT_COL_HAS_IMAGES)
    EndIf
    If $fOnRight Then $iFmt = BitOR($iFmt, $LVCFMT_BITMAP_ON_RIGHT)
    _tagSetData ($tBuffer, 1, $sText)
    _tagSetData ($tColumn, "Mask", $iMask)
    _tagSetData ($tColumn, "Fmt", $iFmt)
    _tagSetData ($tColumn, "CX", $iWidth)
    _tagSetData ($tColumn, "TextMax", $iBuffer)
    _tagSetData ($tColumn, "Image", $iImage)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tColumn, "Text", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_INSERTCOLUMN, $iIndex, $pColumn)
    Else
        $iColumn = _tagGetSize ($tColumn)
        $pMemory = _Mem_Init ($hWnd, $iColumn + $iBuffer, $tMemMap)
        $pText = $pMemory + $iColumn
        _tagSetData ($tColumn, "Text", $pText)
        _Mem_Write ($tMemMap, $pColumn, $pMemory, $iColumn)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_INSERTCOLUMN, $iIndex, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult
EndFunc   ;==>_ListView_InsertColumn
; #FUNCTION# ====================================================================================================================
; Description ...: Insert a group in the ListView
; Parameters ....: $hWnd        - Handle to the control
;                  $iGroupID    - Index where the group is to be added. If this is -1, the group is added at the end of the list.
;                  $sHeader     - Header text
;                  $iAlign      - Alignment of the header text for the group:
;                  |0 - Left
;                  |1 - Center
;                  |2 - Right
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Yoan Roblet (Arcker),Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......: _ListView_SetGroupInfo,_ListView_SetGroupMetrics
; ===============================================================================================================================
Func _ListView_InsertGroup($hWnd, $iGroupID, $sHeader, $iAlign = 0)
    Local $iHeader, $pHeader, $tHeader, $iGroup, $pGroup, $tGroup, $pMemory, $tMemMap, $pText, $iMask, $iResult
    Local $aAlign[3] = [$LVGA_HEADER_LEFT, $LVGA_HEADER_CENTER, $LVGA_HEADER_RIGHT]
    $tHeader = _API_MultiByteToWideChar ($sHeader)
    $pHeader = _tagGetPtr ($tHeader)
    $iHeader = _tagGetSize ($tHeader)
    $tGroup = _tagLVGROUP ()
    $pGroup = _tagGetPtr ($tGroup)
    $iGroup = _tagGetSize ($tGroup)
    $iMask = BitOR($LVGF_HEADER, $LVGF_ALIGN, $LVGF_GROUPID)
    _tagSetData ($tGroup, "Size", $iGroup)
    _tagSetData ($tGroup, "Mask", $iMask)
    _tagSetData ($tGroup, "HeaderMax", $iHeader)
    _tagSetData ($tGroup, "GroupID", $iGroupID)
    _tagSetData ($tGroup, "Align", $aAlign[$iAlign])
    _tagSetData ($tGroup, "Header", $pHeader)
    $iResult = _API_SendMessage ($hWnd, $LVM_INSERTGROUP, -1, $pGroup)
    Return $iResult 
EndFunc   ;==>_ListView_InsertGroup
; #FUNCTION# ====================================================================================================================
; Description ...: Inserts a new item in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index at which the new item should be inserted.  If this value is greater  than  the
;                  +number of items currently contained by the control, the new item will be appended to the end of the list  and
;                  +assigned the correct index.
;                  $sText       - Item text
;                  $iImage      - Zero based index of the item's icon in the control's image list
; Return values .: Success      - The index of the new item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: You can not use this function to insert subitems. Use _ListView_AddSubItem or the native _ListView_SetItemText
;                  function to insert subitems.
; Related .......: _ListView_AddSubItem, _ListView_SetItemText
; ===============================================================================================================================
Func _ListView_InsertItem($hWnd, $iIndex, $sText, $iImage = -1)
    Local $iBuffer, $pBuffer, $tBuffer, $iItem, $pItem, $tItem, $pMemory, $tMemMap, $pText, $iMask, $iResult
    $iBuffer = StringLen($sText) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tItem = _tagLVITEM()
    $pItem = _tagGetPtr ($tItem)
    $iMask = $LVIF_TEXT
    If $iImage <> -1 Then $iMask = BitOR($iMask, $LVIF_IMAGE)
    _tagSetData ($tBuffer, 1, $sText)
    _tagSetData ($tItem, "Mask", $iMask)
    _tagSetData ($tItem, "Item", $iIndex)
    _tagSetData ($tItem, "TextMax", $iBuffer)
    _tagSetData ($tItem, "Image", $iImage)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tItem, "Text", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_INSERTITEM, 0, $pItem)
    Else
        $iItem = _tagGetSize ($tItem)
        $pMemory = _Mem_Init ($hWnd, $iItem + $iBuffer, $tMemMap)
        $pText = $pMemory + $iItem
        _tagSetData ($tItem, "Text", $pText)
        _Mem_Write ($tMemMap, $pItem, $pMemory, $iItem)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_INSERTITEM, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult
EndFunc   ;==>_ListView_InsertItem
; #FUNCTION# ====================================================================================================================
; Description ...: Retrieves the insertion point closest to a specified point
; Parameters ....: $hWnd        - Handle to the control
;                  $iX          - X position test point
;                  $iY          - Y position test point
; Return values .: Success      - Array with the following format:
;                  |[0] - True on success, otherwise False
;                  |[1] - True if the insertion point appears after the item, otherwise False
;                  |[2] - Item next to which the insertion point appears. If this is -1, there is no insertion point.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetInsertMark
; ===============================================================================================================================
Func _ListView_InsertMarkHitTest($hWnd, $iX, $iY)
    Local $iPoint, $pPoint, $tPoint, $iMark, $tMark, $pMark, $pMemM, $pMemP, $tMemMap, $aTest[3]
    $tPoint = _tagPOINT ()
    $pPoint = _tagGetPtr ($tPoint)
    $tMark = _tagLVINSERTMARK()
    $pMark = _tagGetPtr ($tMark)
    $iMark = _tagGetSize ($tMark)
    _tagSetData ($tPoint, "X", $iX)
    _tagSetData ($tPoint, "Y", $iY)
    _tagSetData ($tMark, "Size", $iMark)
    If _Lib_InProcess ($hWnd) Then
        $aTest[0] = _API_SendMessage ($hWnd, $LVM_INSERTMARKHITTEST, $pPoint, $pMark) <> 0
    Else
        $iPoint = _tagGetSize ($tPoint)
        $pMemM = _Mem_Init ($hWnd, $iPoint + $iMark, $tMemMap)
        $pMemP = $pMemP + $iPoint
        _Mem_Write ($tMemMap, $pMark, $pMemM, $iMark)
        _Mem_Write ($tMemMap, $pPoint, $pMemP, $iPoint)
        $aTest[0] = _API_SendMessage ($hWnd, $LVM_INSERTMARKHITTEST, $pMemP, $pMemM) <> 0
        _Mem_Read ($tMemMap, $pMemM, $pMark, $iMark)
        _Mem_Free ($tMemMap)
    EndIf
    $aTest[1] = _tagGetData ($tMark, "Flags") = $LVIM_AFTER
    $aTest[2] = _tagGetData ($tMark, "Item")
    Return $aTest
EndFunc   ;==>_ListView_InsertMarkHitTest
; #FUNCTION# ====================================================================================================================
; Description ...: Assign an Item to a Group
; Parameters ....: $hWnd        - Handle to the control
;                  $iGroupID    - Item index
;                  $sHeader     - SubItem
;                  $iAlign      - GroupID to assign to
;                  |0 - Left
;                  |1 - Center
;                  |2 - Right
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Yoan Roblet (Arcker),Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......: _ListView_SetGroupInfo,_ListView_SetGroupMetrics
; ===============================================================================================================================
func _ListView_ItemAssignGroup($hWnd,$iItem,$iSubItem,$iGroupID)
    Local $tItem, $pItem
    $tItem = _tagLVITEM ()
    $pItem = _tagGetPtr ($tItem)
    _tagSetData ($tItem, "Mask", $LVIF_GROUPID)
    _tagSetData ($tItem, "item", $iItem)
    _tagSetData ($tItem, "SubItem", $iSubItem)
    _tagSetData ($tItem, "GroupID", $iGroupID)
    _ListView_SetItemEx ($hWnd, $tItem)
EndFunc 
; #FUNCTION# ====================================================================================================================
; Description ...: Maps the ID of an item to an index
; Parameters ....: $hWnd        - Handle to the control
;                  $iID         - ID of an item
; Return values .: Success      - The most current index
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only.
; Related .......:
; ===============================================================================================================================
Func _ListView_MapIDToIndex($hWnd, $iID)
    Return _API_SendMessage ($hWnd, $LVM_MAPIDTOINDEX, $iID, 0)
EndFunc   ;==>_ListView_MapIDToIndex
; #FUNCTION# ====================================================================================================================
; Description ...: Maps an index to an item ID
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of an item
; Return values .: Success      - The ID of the item
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only.
; Related .......:
; ===============================================================================================================================
Func _ListView_MapIndexToID($hWnd, $iIndex)
    Return _API_SendMessage ($hWnd, $LVM_MAPINDEXTOID, $iIndex, 0)
EndFunc   ;==>_ListView_MapIndexToID
; #FUNCTION# ====================================================================================================================
; Description ...: Moves the group to the specified zero based index
; Parameters ....: $hWnd        - Handle to the control
;                  $iGroupID    - ID of the group to move
;                  $iIndex      - Zero based index of an item where the group will move
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only.
; Related .......: _ListView_RemoveAllGroups
; ===============================================================================================================================
Func _ListView_MoveGroup($hWnd, $iGroupID, $iIndex)
    Return _API_SendMessage ($hWnd, $LVM_MOVEGROUP, $iGroupID, $iIndex)
EndFunc   ;==>_ListView_MoveGroup
; #FUNCTION# ====================================================================================================================
; Description ...: Forces the control to redraw a range of items
; Parameters ....: $hWnd        - Handle to the control
;                  $iFirst      - Zero based index of the first item to redraw
;                  $iLast       - Zero based index of the last item to redraw
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The specified items are not actually redrawn until the control receives a $WM_PAINT message to repaint.
; Related .......:
; ===============================================================================================================================
Func _ListView_RedrawItems($hWnd, $iFirst, $iLast)
    Return _API_SendMessage ($hWnd, $LVM_REDRAWITEMS, $iFirst, $iLast) <> 0
EndFunc   ;==>_ListView_RedrawItems
; #FUNCTION# ====================================================================================================================
; Description ...: Removes all groups from the control
; Parameters ....: $hWnd        - Handle to the control
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only.
; Related .......: _ListView_RemoveGroup
; ===============================================================================================================================
Func _ListView_RemoveAllGroups($hWnd)
    Return _API_SendMessage ($hWnd, $LVM_REMOVEALLGROUPS, 0, 0)
EndFunc   ;==>_ListView_RemoveAllGroups
; #FUNCTION# ====================================================================================================================
; Description ...: Removes a group from the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iGroupID    - ID that specifies the group to remove
; Return values .: Success      - The index of the group
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only.
; Related .......: _ListView_RemoveGroup
; ===============================================================================================================================
Func _ListView_RemoveGroup($hWnd, $iGroupID)
    Return _API_SendMessage ($hWnd, $LVM_REMOVEGROUP, $iGroupID, 0)
EndFunc   ;==>_ListView_RemoveGroup
; #FUNCTION# ====================================================================================================================
; Description ...: Scrolls the content of the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iDX         - Specifies the amount of horizontal scrolling in pixels.  If the control is in list  view,  this
;                  +value specifies the number of columns to scroll.
;                  $iDY         - Specifies the amount of vertical scrolling in pixels
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: When the control is in report view, the control can only be scrolled vertically in whole line increments.  The
;                  $iDY parameter will be rounded to the nearest number of pixels that form a whole line increment.  For example,
;                  if the height of a line is 16 pixels and 8 is passed for $iDY, the list will be scrolled by  16  pixels.  If 7
;                  is passed for $iDY, the list will be scrolled 0 pixels.
; Related .......:
; ===============================================================================================================================
Func _ListView_Scroll($hWnd, $iDX, $iDY)
    Return _API_SendMessage ($hWnd, $LVM_SCROLL, $iDX, $iDY) <> 0
EndFunc   ;==>_ListView_Scroll
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the background color of the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iColor      - Background color to set or CLR_NONE value for no background color
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetBkColor
; ===============================================================================================================================
Func _ListView_SetBkColor($hWnd, $iColor)
    Local $iResult
    $iResult = _API_SendMessage ($hWnd, $LVM_SETBKCOLOR, 0, $iColor)
    _API_InvalidateRect ($hWnd)
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetBkColor
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the background image in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $sURL        - URL of the background image. If blank, the control has no background
;                  $iStyle      - Determines the background image style:
;                  |0 - Normal
;                  |1 - Tiled
;                  $iXOffset    - Percentage of the control's client area that the image  should  be  offset  horizontally.  Only
;                  +valid when 0 is used in $iStyle.
;                  $iYOffset    - Percentage of the control's client area that the image should be offset vertically.  Only valid
;                  +when 0 is used in $iStyle.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetBkImage
; ===============================================================================================================================
Func _ListView_SetBkImage($hWnd, $sURL = "", $iStyle = 0, $iXOffset = 0, $iYOffset = 0)
    Local $iBuffer, $pBuffer, $tBuffer, $iImage, $pImage, $tImage, $pMemory, $tMemMap, $pText, $iResult
    Local $aStyle[2] = [$LVBKIF_STYLE_NORMAL, $LVBKIF_STYLE_TILE]
    $iBuffer = StringLen($sURL) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tImage = _tagLVBKIMAGE()
    $pImage = _tagGetPtr ($tImage)
    If $sURL <> "" Then $iResult = $LVBKIF_SOURCE_URL
    $iResult = BitOR($iResult, $aStyle[$iStyle])
    _tagSetData ($tBuffer, 1, $sURL)
    _tagSetData ($tImage, "Flags", $iResult)
    _tagSetData ($tImage, "XOffPercent", $iXOffset)
    _tagSetData ($tImage, "YOffPercent", $iYOffset)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tImage, "Image", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETBKIMAGE, 0, $pImage)
    Else
        $iImage = _tagGetSize ($tImage)
        $pMemory = _Mem_Init ($hWnd, $iImage + $iBuffer, $tMemMap)
        $pText = $pMemory + $iImage
        _tagSetData ($tImage, "Image", $pText)
        _Mem_Write ($tMemMap, $pImage, $pMemory, $iImage)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETBKIMAGE, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetBkImage
; #FUNCTION# ====================================================================================================================
; Description ...: Changes the callback mask for the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iMask       - Value of the callback mask. The bits of the mask indicate the item states or images  for  which
;                  +the application stores the current state data.  This value can be any combination of the following:
;                  | 1 - The item is marked for a cut-and-paste operation
;                  | 2 - The item is highlighted as a drag-and-drop target
;                  | 4 - The item has the focus
;                  | 8 - The item is selected
;                  |16 - The application stores the image list index of the current overlay image
;                  |32 - The application stores the image list index of the current state image
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The callback mask is a set of bit flags that specify the item states for which the  application,  rather  than
;                  the control, stores the current data.  The callback mask applies to all of the  control's  items,  unlike  the
;                  callback item designation, which applies to a specific item.  The callback mask is zero  by  default,  meaning
;                  that the control stores all item state information.
; Related .......: _ListView_GetCallbackMask
; ===============================================================================================================================
Func _ListView_SetCallBackMask($hWnd, $iMask)
    Local $iFlags
    If BitAND($iMask, 1) <> 0 Then $iFlags = BitOR($iFlags, $LVIS_CUT)
    If BitAND($iMask, 2) <> 0 Then $iFlags = BitOR($iFlags, $LVIS_DROPHILITED)
    If BitAND($iMask, 4) <> 0 Then $iFlags = BitOR($iFlags, $LVIS_FOCUSED)
    If BitAND($iMask, 8) <> 0 Then $iFlags = BitOR($iFlags, $LVIS_SELECTED)
    If BitAND($iMask, 16) <> 0 Then $iFlags = BitOR($iFlags, $LVIS_OVERLAYMASK)
    If BitAND($iMask, 32) <> 0 Then $iFlags = BitOR($iFlags, $LVIS_STATEIMAGEMASK)
    Return _API_SendMessage ($hWnd, $LVM_SETCALLBACKMASK, $iFlags, 0) <> 0
EndFunc   ;==>_ListView_SetCallBackMask
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the attributes of a column
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of new column
;                  $sText       - Column header text
;                  $iWidth      - Width of the column, in pixels
;                  $iAlign      - Alignment of the column header and the subitem text in the column:
;                  |0 - Text is left aligned
;                  |1 - Text is right aligned
;                  |2 - Text is centered
;                  $iImage      - Zero based index of an image within the image list
;                  $fOnRight    - If True, the column image appears to the right of text
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetColumn
; ===============================================================================================================================
Func _ListView_SetColumn($hWnd, $iIndex, $sText, $iWidth = -1, $iAlign = -1, $iImage = -1, $fOnRight = False)
    Local $iBuffer, $pBuffer, $tBuffer, $iColumn, $pColumn, $tColumn, $pMemory, $tMemMap, $pText, $iMask, $iFmt, $iResult
    Local $aAlign[3] = [$LVCFMT_LEFT, $LVCFMT_RIGHT, $LVCFMT_CENTER]
    $iBuffer = StringLen($sText) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tColumn = _tagLVCOLUMN()
    $pColumn = _tagGetPtr ($tColumn)
    $iMask = $LVCF_TEXT
    If $iAlign <> -1 Then
        $iMask = BitOR($iMask, $LVCF_FMT)
        $iFmt = BitOR($iFmt, $aAlign[$iAlign])
    EndIf
    If $iWidth <> -1 Then $iMask = BitOR($iMask, $LVCF_WIDTH)
    If $iImage <> -1 Then
        $iMask = BitOR($iMask, $LVCF_IMAGE)
        $iFmt = BitOR($iFmt, $LVCFMT_COL_HAS_IMAGES)
    EndIf
    If $fOnRight Then $iFmt = BitOR($iFmt, $LVCFMT_BITMAP_ON_RIGHT)
    _tagSetData ($tBuffer, 1, $sText)
    _tagSetData ($tColumn, "Mask", $iMask)
    _tagSetData ($tColumn, "Fmt", $iFmt)
    _tagSetData ($tColumn, "CX", $iWidth)
    _tagSetData ($tColumn, "TextMax", $iBuffer)
    _tagSetData ($tColumn, "Image", $iImage)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tColumn, "Text", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETCOLUMN, $iIndex, $pColumn)
    Else
        $iColumn = _tagGetSize ($tColumn)
        $pMemory = _Mem_Init ($hWnd, $iColumn + $iBuffer, $tMemMap)
        $pText = $pMemory + $iColumn
        _tagSetData ($tColumn, "Text", $pText)
        _Mem_Write ($tMemMap, $pColumn, $pMemory, $iColumn)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETCOLUMN, $iIndex, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetColumn
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the left-to-right order of columns in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $aOrder      - Array of integers that holds the index values of the columsn in the control.  The array must be
;                  +formatted as follows:
;                  |[0] - Number of items in array
;                  |[1] - First column index
;                  |[2] - Second column index
;                  |[n] - Last column index
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_SetColumnOrderArray
; ===============================================================================================================================
Func _ListView_SetColumnOrderArray($hWnd, $aOrder)
    Local $iI, $iBuffer, $pBuffer, $tBuffer, $pMemory, $tMemMap, $iResult
    $tBuffer = _tagINT ($aOrder[0])
    $pBuffer = _tagGetPtr ($tBuffer)
    For $iI = 1 To $aOrder[0]
        _tagSetData ($tBuffer, $iI, $aOrder[$iI])
    Next
    If _Lib_InProcess ($hWnd) Then
        $iResult = _API_SendMessage ($hWnd, $LVM_SETCOLUMNORDERARRAY, $aOrder[0], $pBuffer)
    Else
        $iBuffer = _tagGetSize ($tBuffer)
        $pMemory = _Mem_Init ($hWnd, $iBuffer, $tMemMap)
        _Mem_Write ($tMemMap, $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETCOLUMNORDERARRAY, $aOrder[0], $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetColumnOrderArray
; #FUNCTION# ====================================================================================================================
; Description ...: Changes the width of a column in report view mode or the width of all columns in list mode
; Parameters ....: $hWnd        - Handle to the control
;                  $iColumn     - Zero based index of column
;                  $iCX         - Width of the column in pixels. Report view mode, has the following special values:
;                  |-1 - Automatically sizes the column
;                  |-2 - Automatically sizes the column to fit the header text
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetColumnWidth
; ===============================================================================================================================
Func _ListView_SetColumnWidth($hWnd, $iColumn, $iCX = 50)
    Return _API_SendMessage ($hWnd, $LVM_SETCOLUMNWIDTH, $iColumn, $iCX) <> 0
EndFunc   ;==>_ListView_SetColumnWidth
; #FUNCTION# ====================================================================================================================
; Description ...: Sets extended styles
; Parameters ....: $hWnd        - Handle to the control
;                  $iExStyle    - Specifies the extended control styles
;                  $iExMask     - Specifies which styles in $iExStyle are to be affected.  This parameter can be a combination of
;                  +extended styles. Only the extended styles in $iExMask will be changed. All other styles will be maintained as
;                  +they are. If this parameter is zero, all of the styles in $iExStyle will be affected.
; Return values .: Success      - The previous extended styles
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetExtendedListViewStyle
; ===============================================================================================================================
Func _ListView_SetExtendedListViewStyle($hWnd, $iExStyle, $iExMask = 0)
    Return _API_SendMessage ($hWnd, $LVM_SETEXTENDEDLISTVIEWSTYLE, $iExMask, $iExStyle)
EndFunc   ;==>_ListView_SetExtendedListViewStyle
; #FUNCTION# ====================================================================================================================
; Description ...: Sets group information
; Parameters ....: $hWnd        - Handle to the control
;                  $iGroupID    - ID of the group
;                  $sHeader     - Header text
;                  $iAlign      - Alignment of the header text for the group:
;                  |0 - Left
;                  |1 - Center
;                  |2 - Right
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......: _ListView_SetGroupInfo
; ===============================================================================================================================
Func _ListView_SetGroupInfo($hWnd, $iGroupID, $sHeader, $iAlign = 0)
    Local $iHeader, $pHeader, $tHeader, $iGroup, $pGroup, $tGroup, $pMemory, $tMemMap, $pText, $iMask, $iResult
    Local $aAlign[3] = [$LVGA_HEADER_LEFT, $LVGA_HEADER_CENTER, $LVGA_HEADER_RIGHT]
    $tHeader = _API_MultiByteToWideChar ($sHeader)
    $pHeader = _tagGetPtr ($tHeader)
    $iHeader = _tagGetSize ($tHeader)
    $tGroup = _tagLVGROUP()
    $pGroup = _tagGetPtr ($tGroup)
    $iGroup = _tagGetSize ($tGroup)
    $iMask = BitOR($LVGF_HEADER, $LVGF_ALIGN, $LVGF_GROUPID)
    _tagSetData ($tGroup, "Size", $iGroup)
    _tagSetData ($tGroup, "Mask", $iMask)
    _tagSetData ($tGroup, "HeaderMax", $iHeader)
    _tagSetData ($tGroup, "GroupID", 0xFFFFFFFF)
    _tagSetData ($tGroup, "Align", $aAlign[$iAlign])
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tGroup, "Header", $pHeader)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETGROUPINFO, $iGroupID, $pGroup)
        _tagSetData ($tGroup, "Mask", $LVGF_GROUPID)
        _tagSetData ($tGroup, "GroupID", $iGroupID)
        _API_SendMessage ($hWnd, $LVM_SETGROUPINFO, $iGroupID, $pGroup)
    Else
        $pMemory = _Mem_Init ($hWnd, $iGroup + $iHeader, $tMemMap)
        $pText = $pMemory + $iGroup
        _tagSetData ($tGroup, "Header", $pText)
        _Mem_Write ($tMemMap, $pGroup, $pMemory, $iGroup)
        _Mem_Write ($tMemMap, $pHeader, $pText, $iHeader)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETGROUPINFO, $iGroupID, $pMemory)
        _tagSetData ($tGroup, "Mask", $LVGF_GROUPID)
        _tagSetData ($tGroup, "GroupID", $iGroupID)
        _API_SendMessage ($hWnd, $LVM_SETGROUPINFO, $iGroupID, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    _API_InvalidateRect ($hWnd)
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetGroupInfo
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the metrics of a group
; Parameters ....: $hWnd        - Handle to the control
;                  $iLeft       - Left border
;                  $iTop        - Top border
;                  $iRight      - Right border
;                  $iBottom     - Bottom border
;                  $iCRLeft     - Color of left border
;                  $iCRTop      - Color of top border
;                  $iCRRight    - Color of right border
;                  $iCRBottom   - Color or bottom border
;                  $iCRHeader   - Color of header text
;                  $iCRFooter   - Color of footer text
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......: _ListView_GetGroupMetrics
; ===============================================================================================================================
Func _ListView_SetGroupMetrics($hWnd, $iMask, $iLeft, $iTop, $iRight, $iBottom, $iCRLeft, $iCRTop, $iCRRight, $iCRBottom, $iCRHeader, $iCRFooter)
    Local $iMetrics, $pMetrics, $tMetrics, $pMemory, $tMemMap
    ;Local $aMask[4] = [$LVGMF_NONE, $LVGMF_BORDERSIZE, $LVGMF_BORDERCOLOR, $LVGMF_TEXTCOLOR]
    $tMetrics = _tagLVGROUPMETRICS()
    $pMetrics = _tagGetPtr ($tMetrics)
    $iMetrics = _tagGetSize ($tMetrics)
    _tagSetData ($tMetrics, "Size", $iMetrics)
    _tagSetData ($tMetrics, "Mask", $iMask)
    _tagSetData ($tMetrics, "Left", $iLeft)
    _tagSetData ($tMetrics, "Top", $iTop)
    _tagSetData ($tMetrics, "Right", $iRight)
    _tagSetData ($tMetrics, "Bottom", $iBottom)
    _tagSetData ($tMetrics, "CRLeft", $iCRLeft)
    _tagSetData ($tMetrics, "CRTop", $iCRTop)
    _tagSetData ($tMetrics, "CRRight", $iCRRight)
    _tagSetData ($tMetrics, "CRBottom", $iCRBottom)
    _tagSetData ($tMetrics, "CRHeader", $iCRHeader)
    _tagSetData ($tMetrics, "CRFooter", $iCRFooter)
    If _Lib_InProcess ($hWnd) Then
        _API_SendMessage ($hWnd, $LVM_SETGROUPMETRICS, 0, $pMetrics)
    Else
        $pMemory = _Mem_Init ($hWnd, $iMetrics, $tMemMap)
        _Mem_Write ($tMemMap, $pMetrics)
        _API_SendMessage ($hWnd, $LVM_SETGROUPMETRICS, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
EndFunc   ;==>_ListView_SetGroupMetrics
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the cursor handle that the control uses
; Parameters ....: $hWnd        - Handle to the control
;                  $hCursor     - Handle to the cursor to be set
; Return values .: Success      - Handle to the previous hot cursor
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetHotCursor
; ===============================================================================================================================
Func _ListView_SetHotCursor($hWnd, $hCursor)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_SETHOTCURSOR, 0, $hCursor))
EndFunc   ;==>_ListView_SetHotCursor
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the hot item for the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item to be set as the hot item
; Return values .: Success      - The zero based index of the item that was previously hot
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetHotItem
; ===============================================================================================================================
Func _ListView_SetHotItem($hWnd, $iIndex)
    Return _API_SendMessage ($hWnd, $LVM_SETHOTITEM, $iIndex, 0)
EndFunc   ;==>_ListView_SetHotItem
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the time the cursor must hover over an item before it is selected
; Parameters ....: $hWnd        - Handle to the control
;                  $iHoverTime  - The new amount of time, in milliseconds, that the mouse cursor must hover over an  item  before
;                  +it is selected. If this value is  -1, then the hover time is set to the default hover time.
; Return values .: Success      - The previous hover time
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetHoverTime
; ===============================================================================================================================
Func _ListView_SetHoverTime($hWnd, $iHoverTime)
    Return _API_SendMessage ($hWnd, $LVM_SETHOVERTIME, 0, $iHoverTime)
EndFunc   ;==>_ListView_SetHoverTime
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the spacing between icons where the style is large icon
; Parameters ....: $hWnd        - Handle to the control
;                  $iCX         - Distance, in pixels, to set between icons on the x-axis
;                  $iCY         - Distance, in pixels, to set between icons on the y-axis
; Return values .: Success      - Array with the following format:
;                  |[0] - Previous CX value
;                  |[1] - Previous CY value
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Values for $iCX and $iCY are relative to the upper-left corner of an icon bitmap. To set spacing between icons
;                  that do not overlap, the $iCX or $iCY values must include the size of the icon, plus the amount of empty space
;                  desired between icons. Values that do not include the width of the icon will result in overlaps.
; Related .......:
; ===============================================================================================================================
Func _ListView_SetIconSpacing($hWnd, $iCX, $iCY)
    Local $iResult, $aPadding[2]
    $iResult = _API_SendMessage ($hWnd, $LVM_SETICONSPACING, 0, _Lib_MakeLong ($iCX, $iCY))
    $aPadding[0] = _Lib_LoWord ($iResult)
    $aPadding[1] = _Lib_HiWord ($iResult)
    Return $aPadding
EndFunc   ;==>_ListView_SetIconSpacing
; #FUNCTION# ====================================================================================================================
; Description ...: Assigns an image list to the control
; Parameters ....: $hWnd        - Handle to the control
;                  $hHandle     - Handle to the image list to assign
;                  $iType       - Type of image list:
;                  |0 - Image list with large icons
;                  |1 - Image list with small icons
;                  |2 - Image list with state images
; Return values .: Success      - The handle to the previous image list
;                  Failue       - 0
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The current image list will be destroyed when the control is destroyed unless you set the $LVS_SHAREIMAGELISTS
;                  style. If you use this message to replace one image list with another your application must explicitly destroy
;                  all image lists other than the current one.
; Related .......: _ListView_GetImageList
; ===============================================================================================================================
Func _ListView_SetImageList($hWnd, $hHandle, $iType = 0)
    Local $aType[3] = [$LVSIL_NORMAL, $LVSIL_SMALL, $LVSIL_STATE]
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_SETIMAGELIST, $aType[$iType], $hHandle))
EndFunc   ;==>_ListView_SetImageList
; #FUNCTION# ====================================================================================================================
; Description ...: Sets ToolTip text
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $sText       - String that contains the tooltip text
;                  $iSubItem    - One based index of the subitem
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......:
; ===============================================================================================================================
Func _ListView_SetInfoTip($hWnd, $iIndex, $sText, $iSubItem = 0)
    Local $iBuffer, $pBuffer, $tBuffer, $iInfo, $pInfo, $tInfo, $pMemory, $tMemMap, $pText, $iResult
    $tBuffer = _API_MultiByteToWideChar ($sText)
    $pBuffer = _tagGetPtr ($tBuffer)
    $iBuffer = _tagGetSize ($tBuffer)
    $tInfo = _tagLVSETINFOTIP()
    $pInfo = _tagGetPtr ($tInfo)
    $iInfo = _tagGetSize ($tInfo)
    _tagSetData ($tBuffer, 1, $sText)
    _tagSetData ($tInfo, "Size", $iInfo)
    _tagSetData ($tInfo, "Item", $iIndex)
    _tagSetData ($tInfo, "SubItem", $iSubItem)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tInfo, "Text", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETINFOTIP, 0, $pInfo)
    Else
        $pMemory = _Mem_Init ($hWnd, $iInfo, $tMemMap)
        $pText = $pMemory + $iInfo
        _tagSetData ($tInfo, "Text", $pText)
        _Mem_Write ($tMemMap, $pInfo, $pMemory, $iInfo)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETINFOTIP, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetInfoTip
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the insertion point to the defined position
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $fAfter      - Insertion point:
;                  | True - The insertion point will appear after the item
;                  |False -The insertion point will appear before the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only. An insertion point can only appear if the control is in icon view, small icon view,  or  tile
;                  view, and not in group view mode.
; Related .......: _ListView_GetInsertMark
; ===============================================================================================================================
Func _ListView_SetInsertMark($hWnd, $iIndex, $fAfter = False)
    Local $iMark, $pMark, $tMark, $pMemory, $tMemMap, $iResult
    $tMark = _tagLVINSERTMARK()
    $pMark = _tagGetPtr ($tMark)
    $iMark = _tagGetSize ($tMark)
    _tagSetData ($tMark, "Size", $iMark)
    _tagSetData ($tMark, "Flags", $fAfter)
    _tagSetData ($tMark, "Item", $iIndex)
    If _Lib_InProcess ($hWnd) Then
        $iResult = _API_SendMessage ($hWnd, $LVM_SETINSERTMARK, 0, $pMark)
    Else
        $pMemory = _Mem_Init ($hWnd, $iMark, $tMemMap)
        _Mem_Write ($tMemMap, $pMark)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETINSERTMARK, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetInsertMark
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the color of the insertion point
; Parameters ....: $hWnd        - Handle to the control
;                  $iColor      - Color to set the insertion point
; Return values .: Success      - The previous insertion point color
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......: _ListView_GetInsertMarkColor
; ===============================================================================================================================
Func _ListView_SetInsertMarkColor($hWnd, $iColor)
    Return "0x" & Hex(_API_SendMessage ($hWnd, $LVM_SETINSERTMARKCOLOR, 0, $iColor), 6)
EndFunc   ;==>_ListView_SetInsertMarkColor
; #FUNCTION# ====================================================================================================================
; Description ...: Sets some or all of a item's attributes
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index at which the new item should be inserted.  If this value is greater  than  the
;                  +number of items currently contained by the control, the new item will be appended to the end of the list  and
;                  +assigned the correct index.
;                  $sText       - Item text
;                  $iSubItem    - One based index of the subitem or zero if this refers to an item
;                  $iImage      - Zero base index of the item's icon in the control's image list
;                  $iParam      - Value specific to the item
;                  $iIndent     - Number of image widths to indent the item. A single indentation equals the width of an image.
; Return values .: Success      - The zero based index of the new item
;                  Failure      - -1
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItem
; ===============================================================================================================================
Func _ListView_SetItem($hWnd, $iIndex, $sText, $iSubItem = 0, $iImage = -1, $iParam = -1, $iIndent = -1)
    Local $iBuffer, $pBuffer, $tBuffer, $tItem, $iMask
    $iBuffer = StringLen($sText) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tItem = _tagLVITEM()
    $iMask = $LVIF_TEXT
    If $iImage <> -1 Then $iMask = BitOR($iMask, $LVIF_IMAGE)
    If $iParam <> -1 Then $iMask = BitOR($iMask, $LVIF_PARAM)
    If $iIndex <> -1 Then $iMask = BitOR($iMask, $LVIF_INDENT)
    _tagSetData ($tBuffer, 1, $sText)
    _tagSetData ($tItem, "Mask", $iMask)
    _tagSetData ($tItem, "Text", $pBuffer)
    _tagSetData ($tItem, "TextMax", $iBuffer)
    _tagSetData ($tItem, "Image", $iImage)
    _tagSetData ($tItem, "Param", $iMask)
    _tagSetData ($tItem, "Ident", $iIndent)
    Return _ListView_SetItemEx($hWnd, $tItem)
EndFunc   ;==>_ListView_SetItem
; ===============================================================================================================================
; Description ...: Sets some or all of a item's attributes
; Parameters ....: $hWnd        - Handle to the control
;                  $tItem       - _tagLVITEM structure
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: To set the attributes of an item set the Item member of the _tagLVITEM structure to the index of the item, and
;                  set the SubItem member to zero.  For an item, you can set the State, Text, Image, and  Param  members  of  the
;                  _tagLVITEM structure.  To set the text of a subitem, set the Item and SubItem members to indicate the specific
;                  subitem, and use the Text member to specify the text.  You cannot set the State or Param members for  subitems
;                  because subitems do not have these attributes.
; ===============================================================================================================================
Func _ListView_SetItemEx($hWnd, ByRef $tItem)
    Local $iItem, $pItem, $iBuffer, $pBuffer, $pMemory, $tMemMap, $pText, $iResult
    $pItem = _tagGetPtr ($tItem)
    If _Lib_InProcess ($hWnd) Then
        $iResult = _API_SendMessage ($hWnd, $LVM_SETITEM, 0, $pItem)
    Else
        $iItem = _tagGetSize ($tItem)
        $iBuffer = _tagGetData ($tItem, "TextMax")
        $pBuffer = _tagGetData ($tItem, "Text")
        $pMemory = _Mem_Init ($hWnd, $iItem + $iBuffer, $tMemMap)
        $pText = $pMemory + $iItem
        _tagSetData ($tItem, "Text", $pText)
        _Mem_Write ($tMemMap, $pItem, $pMemory, $iItem)
        If $pBuffer <> 0 Then _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETITEM, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetItemEx
; #FUNCTION# ====================================================================================================================
; Description ...: Causes the control to allocate memory for the specified number of items
; Parameters ....: $hWnd        - Handle to the control
;                  $iItems      - Number of items that the control will ultimately contain
;                  $iFlags      - Values that specify the behavior of the control after resetting the item count.  This value can
;                  +be a combination of the following:
;                  |1 - The control will not repaint unless affected items are currently in view
;                  |2 - The control will not change the scroll position when the item count changes
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: If the control was created without the $LVS_OWNERDATA style,  sending  this  message  causes  the  control  to
;                  allocate its internal data structure for the specified number of items.  This prevents the control from having
;                  to allocate the data structure every time an item is added. If the control was created with the $LVS_OWNERDATA
;                  style sending this message sets the virtual number of items that the control contains.  The $iFlags  parameter
;                  is intended only for controls that use the $LVS_OWNERDATA and $LVS_REPORT or $LVS_LIST styles.
; Related .......: _ListView_GetItemCount
; ===============================================================================================================================
Func _ListView_SetItemCount($hWnd, $iItems, $iFlags = 0)
    Return _API_SendMessage ($hWnd, $LVM_SETITEMCOUNT, $iItems, $iFlags) <> 0
EndFunc   ;==>_ListView_SetItemCount
; #FUNCTION# ====================================================================================================================
; Description ...: Sets whether the item is marked for a cut-and-paste operation
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $fEnabled    - If True the item state is set, otherwise it is not set.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:_ListView_GetItemCut
; ===============================================================================================================================
Func _ListView_SetItemCut($hWnd, $iIndex, $fEnabled = True)
    Local $iStateMask = 0
    If $fEnabled Then $iStateMask = $LVIS_CUT
    Return _ListView_SetItemState($hWnd, $iIndex, $LVIS_CUT, $iStateMask)
EndFunc   ;==>_ListView_SetItemCut
; #FUNCTION# ====================================================================================================================
; Description ...: Sets whether the item is highlighted as a drag-and-drop target
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $fEnabled    - If True the item state is set, otherwise it is not set.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemDropHilited
; ===============================================================================================================================
Func _ListView_SetItemDropHilited($hWnd, $iIndex, $fEnabled = True)
    Local $iStateMask = 0
    If $fEnabled Then $iStateMask = $LVIS_DROPHILITED
    Return _ListView_SetItemState($hWnd, $iIndex, $LVIS_DROPHILITED, $iStateMask)
EndFunc   ;==>_ListView_SetItemDropHilited
; #FUNCTION# ====================================================================================================================
; Description ...: Sets whether the item has the focus
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $fEnabled    - If True the item state is set, otherwise it is not set.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemFocuse
; ===============================================================================================================================
Func _ListView_SetItemFocused($hWnd, $iIndex, $fEnabled = True)
    Local $iStateMask = 0
    If $fEnabled Then $iStateMask = $LVIS_FOCUSED
    Return _ListView_SetItemState($hWnd, $iIndex, $LVIS_FOCUSED, $iStateMask)
EndFunc   ;==>_ListView_SetItemFocused
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the index of the item's icon in the control's image list
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iImage      - Zero based index into the control's image list
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemImage
; ===============================================================================================================================
Func _ListView_SetItemImage($hWnd, $iIndex, $iImage)
    Local $tItem
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_IMAGE)
    _tagSetData ($tItem, "Item", $iIndex)
    _tagSetData ($tItem, "Image", $iImage)
    Return _ListView_SetItemEx($hWnd, $tItem)
EndFunc   ;==>_ListView_SetItemImage
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the number of image widths to indent the item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iIndent     - Indention value
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemIndent
; ===============================================================================================================================
Func _ListView_SetItemIndent($hWnd, $iIndex, $iIndent)
    Local $tItem
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_INDENT)
    _tagSetData ($tItem, "Item", $iIndex)
    _tagSetData ($tItem, "Indent", $iIndent)
    Return _ListView_SetItemEx($hWnd, $tItem)
EndFunc   ;==>_ListView_SetItemIndent
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the value specific to the item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iParam      - Item specific value
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemParam
; ===============================================================================================================================
Func _ListView_SetItemParam($hWnd, $iIndex, $iParam)
    Local $tItem
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_PARAM)
    _tagSetData ($tItem, "Item", $iIndex)
    _tagSetData ($tItem, "Param", $iParam)
    Return _ListView_SetItemEx($hWnd, $tItem)
EndFunc   ;==>_ListView_SetItemParam
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the overlay image is superimposed over the item's icon image
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iImage      - One based overlay image index
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemOverlayImage
; ===============================================================================================================================
Func _ListView_SetItemOverlayImage($hWnd, $iIndex, $iImage)
    Return _ListView_SetItemState($hWnd, $iIndex, BitShift($iImage, -8), $LVIS_OVERLAYMASK)
EndFunc   ;==>_ListView_SetItemOverlayImage
; #FUNCTION# ====================================================================================================================
; Description ...: Moves an item to a specified position in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iCX         - New x-position of the item's upper-left corner, in view coordinates
;                  $iCY         - New y-position of the item's upper-left corner, in view coordinates
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: If the control has the $LVS_AUTOARRANGE style, the items in the control are arranged after the position of the
;                  item is set.
; Related .......: _ListView_GetItemPosition
; ===============================================================================================================================
Func _ListView_SetItemPosition($hWnd, $iIndex, $iCX, $iCY)
    Return _API_SendMessage ($hWnd, $LVM_SETITEMPOSITION, $iIndex, _Lib_MakeLong ($iCX, $iCY)) <> 0
EndFunc   ;==>_ListView_SetItemPosition
; #FUNCTION# ====================================================================================================================
; Description ...: Moves an item to a specified position in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iCX         - New x-position of the item's upper-left corner, in view coordinates
;                  $iCY         - New y-position of the item's upper-left corner, in view coordinates
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: If the control has the $LVS_AUTOARRANGE style, the items in the control are arranged after the position of the
;                  item is set.
; Related .......:
; ===============================================================================================================================
Func _ListView_SetItemPosition32($hWnd, $iIndex, $iCX, $iCY)
    Local $iPoint, $pPoint, $tPoint, $pMemory, $tMemMap, $iResult
    $tPoint = _tagPOINT ()
    $pPoint = _tagGetPtr ($tPoint)
    _tagSetData ($tPoint, "X", $iCX)
    _tagSetData ($tPoint, "Y", $iCY)
    If _Lib_InProcess ($hWnd) Then
        $iResult = _API_SendMessage ($hWnd, $LVM_SETITEMPOSITION32, $iIndex, $pPoint)
    Else
        $iPoint = _tagGetSize ($tPoint)
        $pMemory = _Mem_Init ($hWnd, $iPoint, $tMemMap)
        _Mem_Write ($tMemMap, $pPoint)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETITEMPOSITION32, $iIndex, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetItemPosition32
; #FUNCTION# ====================================================================================================================
; Description ...: Sets whether the item is selected
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $fEnabled    - If True the item state is set, otherwise it is not set.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemSelected
; ===============================================================================================================================
Func _ListView_SetItemSelected($hWnd, $iIndex, $fEnabled = True)
    Local $iStateMask = 0
    If $fEnabled Then $iStateMask = $LVIS_SELECTED
    Return _ListView_SetItemState($hWnd, $iIndex, $LVIS_SELECTED, $iStateMask)
EndFunc   ;==>_ListView_SetItemSelected
; #FUNCTION# ====================================================================================================================
; Description ...: Changes the state of an item in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iState      - Item state to be changed
;                  $iStateMask  - Bits that determine whether state is active or inactive
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemState
; ===============================================================================================================================
Func _ListView_SetItemState($hWnd, $iIndex, $iState, $iStateMask)
    Local $tItem, $iCurr
    $tItem = _tagLVITEM()
    _tagSetData ($tItem, "Mask", $LVIF_STATE)
    _tagSetData ($tItem, "Item", $iIndex)
    _tagSetData ($tItem, "State", $iState)
    _tagSetData ($tItem, "StateMask", $iStateMask)
    Return _ListView_SetItemEx($hWnd, $tItem)
EndFunc   ;==>_ListView_SetItemState
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the state image that is displayed
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $iImage      - One based overlay image index
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemStateImage
; ===============================================================================================================================
Func _ListView_SetItemStateImage($hWnd, $iIndex, $iImage)
    Return _ListView_SetItemState($hWnd, $iIndex, BitShift($iImage, -12), $LVIS_STATEIMAGEMASK)
EndFunc   ;==>_ListView_SetItemStateImage
; #FUNCTION# ====================================================================================================================
; Description ...: Changes the text of an item or subitem
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
;                  $sText       - Item or subitem text
;                  $iSubItem    - One based index of the subitem or 0 to set the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetItemText
; ===============================================================================================================================
Func _ListView_SetItemText($hWnd, $iIndex, $sText, $iSubItem = 0)
    Local $iBuffer, $pBuffer, $tBuffer, $iItem, $pItem, $tItem, $pMemory, $tMemMap, $pText, $iResult
    $iBuffer = StringLen($sText) + 1
    $tBuffer = _tagCHARARRAY ($iBuffer)
    $pBuffer = _tagGetPtr ($tBuffer)
    $tItem = _tagLVITEM()
    $pItem = _tagGetPtr ($tItem)
    _tagSetData ($tBuffer, 1, $sText)
    _tagSetData ($tItem, "Mask", $LVIF_TEXT)
    _tagSetData ($tItem, "item", $iIndex)
    _tagSetData ($tItem, "SubItem", $iSubItem)
    If _Lib_InProcess ($hWnd) Then
        _tagSetData ($tItem, "Text", $pBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETITEM, 0, $pItem)
    Else
        $iItem = _tagGetSize ($tItem)
        $pMemory = _Mem_Init ($hWnd, $iItem + $iBuffer, $tMemMap)
        $pText = $pMemory + $iItem
        _tagSetData ($tItem, "Text", $pText)
        _Mem_Write ($tMemMap, $pItem, $pMemory, $iItem)
        _Mem_Write ($tMemMap, $pBuffer, $pText, $iBuffer)
        $iResult = _API_SendMessage ($hWnd, $LVM_SETITEM, 0, $pMemory)
        _Mem_Free ($tMemMap)
    EndIf
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetItemText
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the color of the border
; Parameters ....: $hWnd        - Handle to the control
;                  $iColor      - Color to set the border
; Return values .: Success      - Previous outline color
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_GetOutlineColor
; ===============================================================================================================================
Func _ListView_SetOutlineColor($hWnd, $iColor)
    Return _API_SendMessage ($hWnd, $LVM_SETOUTLINECOLOR, 0, $iColor)
EndFunc   ;==>_ListView_SetOutlineColor
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the index of the selected column
; Parameters ....: $hWnd        - Handle to the control
;                  $iColumn     - Zero based column index
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP only
; Related .......: _ListView_GetSelectedColumn
; ===============================================================================================================================
Func _ListView_SetSelectedColumn($hWnd, $iColumn)
    Return _API_SendMessage ($hWnd, $LVM_SETSELECTEDCOLUMN, $iColumn, 0)
EndFunc   ;==>_ListView_SetSelectedColumn
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the selection mark in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the new selection mark. If -1,the selection mark is removed.
; Return values .: Success      - The previous selection mark
;                  Failure      - -1 if there is no previous selection mark
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: The selection mark is the item index from which a multiple selection starts.  This message does not affect the
;                  selection state of the item.
; Related .......: _ListView_GetSelectionMark
; ===============================================================================================================================
Func _ListView_SetSelectionMark($hWnd, $iIndex)
    Return _API_SendMessage ($hWnd, $LVM_SETSELECTIONMARK, 0, $iIndex)
EndFunc   ;==>_ListView_SetSelectionMark
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the background color of text in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iColor      - Text color
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetTextBkColor
; ===============================================================================================================================
Func _ListView_SetTextBkColor($hWnd, $iColor)
    Return _API_SendMessage ($hWnd, $LVM_SETTEXTBKCOLOR, 0, $iColor) <> 0
EndFunc   ;==>_ListView_SetTextBkColor
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the color of text in the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iColor      - Text color
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetTextColor
; ===============================================================================================================================
Func _ListView_SetTextColor($hWnd, $iColor)
    Local $iResult
    $iResult = _API_SendMessage ($hWnd, $LVM_SETTEXTCOLOR, 0, $iColor)
    _API_InvalidateRect ($hWnd)
    Return $iResult <> 0
EndFunc   ;==>_ListView_SetTextColor
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the ToolTip control that the control will use to display ToolTips
; Parameters ....: $hWnd        - Handle to the control
;                  $hToolTip    - Handle to the ToolTip control to be set
; Return values .: Success      - The handle to the previous ToolTip control
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetToolTips
; ===============================================================================================================================
Func _ListView_SetToolTips($hWnd, $hToolTip)
    Return _API_SendMessage ($hWnd, $LVM_SETTOOLTIPS, 0, $hToolTip)
EndFunc   ;==>_ListView_SetToolTips
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the UNICODE character format flag for the control
; Parameters ....: $hWnd        - Handle to the control
;                  $fUnicode    - Determines the character set that is used by the control. If True, the control will use Unicode
;                  +characters.  If this value is zero, the control will use ANSI characters.
; Return values .: Success      - The previous Unicode format flag for the control
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_GetUnicodeFormat
; ===============================================================================================================================
Func _ListView_SetUnicodeFormat($hWnd, $fUnicode)
    Return _API_SendMessage ($hWnd, $LVM_SETUNICODEFORMAT, $fUnicode, 0)
EndFunc   ;==>_ListView_SetUnicodeFormat
; #FUNCTION# ====================================================================================================================
; Description ...: Sets the view of the control
; Parameters ....: $hWnd        - Handle to the control
;                  $iView       - View state for the control:
;                  |0 - Details
;                  |1 - Large Icon
;                  |2 - List
;                  |3 - Small Icon
;                  |4 - Tile
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......: Windows XP Only
; Related .......: _ListView_GetView
; ===============================================================================================================================
Func _ListView_SetView($hWnd, $iView)
    Local $aView[5] = [$LV_VIEW_DETAILS, $LV_VIEW_ICON, $LV_VIEW_LIST, $LV_VIEW_SMALLICON, $LV_VIEW_TILE]
    Return _API_SendMessage ($hWnd, $LVM_SETVIEW, $aView[$iView], 0)
EndFunc   ;==>_ListView_SetView
; #FUNCTION# ====================================================================================================================
; Description ...: Determines which listview item or subitem is at a given position
; Parameters ....: $hWnd        - Handle to the control
;                  $iX          - X position to test
;                  $iY          - Y position to test
; Return values .: Success      - Array with the following format:
;                  |[ 0] - Zero based index of the item at the specified position, or -1
;                  |[ 1] - Zero based index of the subitem at the specified position, or -1
;                  |[ 2] - If True, position is in control's client window but not on an item
;                  |[ 3] - If True, position is over item icon
;                  |[ 4] - If True, position is over item text
;                  |[ 5] - If True, position is over item state image
;                  |[ 6] - If True, position is somewhere on the item
;                  |[ 7] - If True, the position is above the control's client area
;                  |[ 8] - If True, the position is below the control's client area
;                  |[ 9] - If True, the position is to the left of the client area
;                  |[10] - If True, the position is to the right of the client area
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......: _ListView_HitTest
; ===============================================================================================================================
Func _ListView_SubItemHitTest($hWnd, $iX, $iY)
    Local $iTest, $pTest, $tTest, $pMemory, $tMemMap, $iFlags, $aTest[11]
    $tTest = _tagLVHITTESTINFO()
    $pTest = _tagGetPtr ($tTest)
    _tagSetData ($tTest, "X", $iX)
    _tagSetData ($tTest, "Y", $iY)
    If _Lib_InProcess ($hWnd) Then
        _API_SendMessage ($hWnd, $LVM_SUBITEMHITTEST, 0, $pTest)
    Else
        $iTest = _tagGetSize ($tTest)
        $pMemory = _Mem_Init ($hWnd, $iTest, $tMemMap)
        _Mem_Write ($tMemMap, $pTest)
        _API_SendMessage ($hWnd, $LVM_SUBITEMHITTEST, 0, $pMemory)
        _Mem_Read ($tMemMap, $pMemory, $pTest, $iTest)
        _Mem_Free ($tMemMap)
    EndIf
    $iFlags = _tagGetData ($tTest, "Flags")
    $aTest[ 0] = _tagGetData ($tTest, "Item")
    $aTest[ 1] = _tagGetData ($tTest, "SubItem")
    $aTest[ 2] = BitAND($iFlags, $LVHT_NOWHERE) <> 0
    $aTest[ 3] = BitAND($iFlags, $LVHT_ONITEMICON) <> 0
    $aTest[ 4] = BitAND($iFlags, $LVHT_ONITEMLABEL) <> 0
    $aTest[ 5] = BitAND($iFlags, $LVHT_ONITEMSTATEICON) <> 0
    $aTest[ 6] = BitAND($iFlags, $LVHT_ONITEM) <> 0
    $aTest[ 7] = BitAND($iFlags, $LVHT_ABOVE) <> 0
    $aTest[ 8] = BitAND($iFlags, $LVHT_BELOW) <> 0
    $aTest[ 9] = BitAND($iFlags, $LVHT_TOLEFT) <> 0
    $aTest[10] = BitAND($iFlags, $LVHT_TORIGHT) <> 0
    Return $aTest
EndFunc   ;==>_ListView_SubItemHitTest
; #FUNCTION# ====================================================================================================================
; Description ...: Updates an item
; Parameters ....: $hWnd        - Handle to the control
;                  $iIndex      - Zero based index of the item
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_Update($hWnd, $iIndex)
    Return _API_SendMessage ($hWnd, $LVM_UPDATE, $iIndex, 0) <> 0
EndFunc   ;==>_ListView_Update
; #FUNCTION# ====================================================================================================================
; Description ...: Debug display WM_NOTIFY messages
; Parameters ....: $hWnd        - Window handle
;                  $iMsg        - Message
;                  $iwParam     - wParam
;                  $ilParam     - lParam
; Return values .: None
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _ListView_WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $tNMHDR, $hFrom, $iID, $iCode
    $tNMHDR = _tagNMHDR ($ilParam)
    $hFrom = _tagGetData ($tNMHDR, "hWndFrom")
    $iID = _tagGetData ($tNMHDR, "IDFrom")
    $iCode = _tagGetData ($tNMHDR, "Code")
    Select
        Case _Lib_WM_NOTIFY_EX ("TVN_SELCHANGING", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ITEMCHANGING", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ITEMCHANGED", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_INSERTITEM", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_DELETEITEM", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_DELETEALLITEMS", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINLABELEDIT", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ENDLABELEDIT", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_COLUMNCLICK", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINDRAG", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINRDRAG", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODCACHEHINT", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ITEMACTIVATE", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODSTATECHANGED", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_HOTTRACK", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_GETDISPINFO", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_SETDISPINFO", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODFINDITEM", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_BEGINLABELEDITW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ENDLABELEDITW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_GETDISPINFOW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_SETDISPINFOW", $hFrom, $iID, $iCode)
        Case _Lib_WM_NOTIFY_EX ("LVN_ODFINDITEMW", $hFrom, $iID, $iCode)
        Case Else
            _Lib_WM_NOTIFY ($hWnd, $iMsg, $iwParam, $ilParam)
    EndSelect
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_ListView_WM_NOTIFY
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVBKIMAGE strucutre
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Flags      - This member may be one or more of the following flags.  You can use the LVBKIF_SOURCE_MASK value
;                  +to mask off all but the source flags.  You can use the LVBKIF_STYLE_MASK value to mask off all but the  style
;                  +flags.
;                  |$LVBKIF_SOURCE_NONE     - The control has no background image
;                  |$LVBKIF_SOURCE_URL      - The Image member contains the URL of the background image
;                  |$LVBKIF_STYLE_NORMAL    - The background image is displayed normally
;                  |$LVBKIF_STYLE_TILE      - The background image will be tiled to fill the entire background of the control
;                  |$LVBKIF_FLAG_TILEOFFSET - You use this flag to specify the coordinates of the first tile.  This flag is valid
;                  +only if the $LVBKIF_STYLE_TILE flag is also specified. If this flag is not specified the first tile begins at
;                  +the upper-left corner of the client area.
;                  hBmp        - Not used
;                  Image       - Address of a string that contains the URL of the background image. This member is only valid if
;                  +the $LVBKIF_SOURCE_URL flag is set in Flags.  This member must be initialized to point  to  the  buffer  that
;                  +contains or receives the text before sending the message.
;                  ImageMax    - Size of the buffer at the address in Image.  If information is being sent to the  control,  this
;                  +member is ignored.
;                  XOffPercent - Percentage of the client area that the image should be offset horizontally.  For example, at  0
;                  +percent, the image will be displayed against the left edge of the control's client area.  At 50 percent,  the
;                  +image will be displayed horizontally centered in the control's client area. At 100 percent, the image will be
;                  +displayed against the right edge  of  the  control's  client  area.  This  member  is  only  valid  when  the
;                  +$LVBKIF_STYLE_NORMAL is specified in  Flags.  If  both  $LVBKIF_FLAG_TILEOFFSET  and  $LVBKIF_STYLE_TILE  are
;                  +specified in Flags, then the value specifies the pixel, not percentage offset, of the first tile.  Otherwise,
;                  +the value is ignored.
;                  YOffPercent - Percentage of the control's client area that the image should be offset vertically. For example
;                  +at 0 percent, the image will be displayed against the top edge of the control's client area.  At 50  percent,
;                  +the image will be displayed vertically centered in the control's client area.  At 100 percent, the image will
;                  +be displayed against the bottom edge of the control's client  area.  This  member  is  only  valid  when  the
;                  +$LVBKIF_STYLE_NORMAL is specified in  Flags.  If  both  $LVBKIF_FLAG_TILEOFFSET  and  $LVBKIF_STYLE_TILE  are
;                  +specified in Flags, then the value specifies the pixel, not percentage offset, of the first tile.  Otherwise,
;                  +the value is ignored.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVBKIMAGE($pPointer = 0)
    Local $aTag[2] = ["tagLVBKIMAGE_", _tagStruct ("int;int;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Flags, hBmp, Image, ImageMax, XOffPercent, YOffPercent")
EndFunc   ;==>_tagLVBKIMAGE
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVCOLUMN structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Mask    - Variable specifying which members contain valid information.  This member can be zero,  or  one  or
;                  +more of the following values:
;                  |LVCF_FMT     - The Fmt member is valid
;                  |LVCF_WIDTH   - The CX member is valid
;                  |LVCF_TEXT    - The Text member is valid
;                  |LVCF_SUBITEM - The SubItem member is valid
;                  |LVCF_IMAGE   - The Image member is valid
;                  |LVCF_ORDER   - The Order member is valid.
;                  Fmt     - Alignment of the column header and the subitem text in the column.  This member can be one  of  the
;                  +following values. The alignment of the leftmost column is always left-justified; it cannot be changed:
;                  |LVCFMT_LEFT            - Text is left-aligned
;                  |LVCFMT_RIGHT           - Text is right-aligned
;                  |LVCFMT_CENTER          - Text is centered
;                  |LVCFMT_JUSTIFYMASK     - A bitmask used to select those bits of Fmt that control field justification
;                  |LVCFMT_IMAGE           - The item displays an image from an image list
;                  |LVCFMT_BITMAP_ON_RIGHT - The bitmap appears to the right of text
;                  |LVCFMT_COL_HAS_IMAGES  - The header item contains an image in the image list.
;                  CX      - Width of the column, in pixels
;                  Text    - If column information is being set, this member is the address of a string that contains the column
;                  +header text.  If the structure is receiving information about a column, this member specifies the address  of
;                  +the buffer that receives the column header text.
;                  TextMax - Size of the buffer pointed to by the Text member.  If the structure is  not  receiving  information
;                  +about a column, this member is ignored.
;                  SubItem - Index of subitem associated with the column
;                  Image   - Zero based index of an image within the image list
;                  Order   - Zero-based column offset. Column offset is in left-to-right order.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVCOLUMN($pPointer = 0)
    Local $aTag[2] = ["tagLVCOLUMN_", _tagStruct ("int;int;int;ptr;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Mask, Fmt, CX, Text, TextMax, SubItem, Image, Order")
EndFunc   ;==>_tagLVCOLUMN
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVFINDINFO structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Flags     - Type of search to perform. This member can be set to one or more of the following values:
;                  |$LVFI_PARAM    - Searches for a match between this structure's Param member and the Param member of an item.
;                  +If $LVFI_PARAM is specified, all other flags are ignored.
;                  |$LVFI_PARTIAL  - Checks to see if the item text begins with the string pointed to by the Text  member.  This
;                  +value implies use of $LVFI_STRING.
;                  |$LVFI_STRING   - Searches based on the item text.  Unless additional values are specified, the item text  of
;                  +the matching item must exactly match the string pointed to by the Text member.
;                  |$LVFI_WRAP     - Continues the search at the beginning if no match is found
;                  |LVFI_NEARESTXY - Finds the item nearest to the position specified in the X and Y members, in  the  direction
;                  +specified by the Direction member. This flag is supported only by large icon and small icon modes.
;                  Text      - Address of a string to compare with the item text.  It is valid if $LVFI_STRING or  $LVFI_PARTIAL
;                  +is set in the Flags member.
;                  Param     - Value to compare with the Param member of an item's  $LVITEM  structure.  It  is  valid  only  if
;                  +$LVFI_PARAM is set in the flags member.
;                  X         - Initial X search position. It is valid only if $LVFI_NEARESTXY is set in the Flags member.
;                  Y         - Initial Y search position. It is valid only if $LVFI_NEARESTXY is set in the Flags member.
;                  Direction - Virtual key code that specifies the direction to search. The following codes are supported:
;                  |VK_LEFT
;                  |VK_RIGHT
;                  |VK_UP
;                  |VK_DOWN
;                  |VK_HOME
;                  |VK_END
;                  |VK_PRIOR
;                  |VK_NEXT
;                  |This member is valid only if $LVFI_NEARESTXY is set in the flags member.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVFINDINFO($pPointer = 0)
    Local $aTag[2] = ["tagLVFINDINFO_", _tagStruct ("int;ptr;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Flags, Text, Param, X, Y, Direction")
EndFunc   ;==>_tagLVFINDINFO
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVGROUP structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Size      - Size of this structure, in bytes
;                  Mask      - Mask that specifies which members of the structure are valid input.  Can be one or  more  of  the
;                  +following values:
;                  |$LVGF_NONE    - No other items are valid
;                  |$LVGF_HEADER  - Header and HeaderMax members are valid
;                  |$LVGF_FOOTER  - Reserved
;                  |$LVGF_STATE   - Reserved
;                  |$LVGF_ALIGN   - Align member is valid
;                  |$LVGF_GROUPID - GroupId member is valid
;                  Header    - Pointer to a string that contains the header text when item information is being  set.  If  group
;                  +information is being retrieved this member specifies the address of the buffer that receives the header text.
;                  HeaderMax - Size of the buffer pointed to by the Header member. If the structure is not receiving information
;                  +about a group, this member is ignored.
;                  Footer    - Reserved
;                  FooterMax - Reserved
;                  GroupID   - ID of the group
;                  StateMask - Reserved
;                  State     - Reserved
;                  Align     - Indicates the alignment of the header text.  It can have one or more of the following values. Use
;                  +one of the header flags.
;                  |LVGA_HEADER_CENTER - Header text is centered horizontally in the window
;                  |LVGA_HEADER_LEFT   - Header text is aligned at the left of the window
;                  |LVGA_HEADER_RIGHT  - Header text is aligned at the right of the window.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVGROUP($pPointer = 0)
    Local $aTag[2] = ["tagLVGROUP_", _tagStruct ("int;int;ptr;int;ptr;int;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Size, Mask, Header, HeaderMax, Footer, FooterMax, GroupID, StateMask, State, Align")
EndFunc   ;==>_tagLVGROUP
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVGROUPMETRICS structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Size     - Size of this structure, in bytes
;                  Mask     - Flag that can have one or more of the following values:
;                  |$LVGMF_BORDERCOLOR
;                  |$LVGMF_BORDERSIZE
;                  |$LVGMF_NONE
;                  |$LVGMF_TEXTCOLOR
;                  Left     - Specifies the left border
;                  Top      - Specifies the top border
;                  Right    - Specifies the right border
;                  Bottom   - Specifies the bottom border
;                  CRLeft   - Specifies the color of the left border
;                  CRTop    - Specifies the color of the top border
;                  CRRight  - Specifies the color of the right border
;                  CRBottom - Specifies the color of the bottom border
;                  CRHeader - Specifies the color of the header text
;                  CRFooter - Specifies the color of the footer text
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVGROUPMETRICS($pPointer = 0)
    Local $aTag[2] = ["tagLVGROUPMETRICS_", _tagStruct ("int;int;int;int;int;int;int;int;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Size, Mask, Left, Top, Right, Bottom, CRLeft, CRTop, CRRight, CRBottom, CRHeader, CRFooter")
EndFunc   ;==>_tagLVGROUPMETRICS
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVHITTESTINFO
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: X       - X position to hit test
;                  Y       - Y position to hit test
;                  Flags   - Results of a hit test. Can be one or more of the following values:
;                  |$LVHT_ABOVE           - The position is above the control's client area
;                  |$LVHT_BELOW           - The position is below the control's client area
;                  |$LVHT_NOWHERE         - The position is inside the client window, but it is not over a list item
;                  |$LVHT_ONITEMICON      - The position is over an item's icon
;                  |$LVHT_ONITEMLABEL     - The position is over an item's text
;                  |$LVHT_ONITEMSTATEICON - The position is over the state image of an item
;                  |$LVHT_TOLEFT          - The position is to the left of the client area
;                  |$LVHT_TORIGHT         - The position is to the right of the client area
;                  Item    - Receives the index of the matching item. Or if hit-testing a subitem,  this  value  represents  the
;                  +subitem's parent item.
;                  SubItem - Receives the index of the matching subitem. When hit-testing an item, this member will be zero.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVHITTESTINFO($pPointer = 0)
    Local $aTag[2] = ["tagLVHITTESTINFO_", _tagStruct ("int;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "X, Y, Flags, Item, SubItem")
EndFunc   ;==>_tagLVHITTESTINFO
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVINSERTMARK structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Size     - Size of this structure, in bytes
;                  Flags    - Flag that specifies where the insertion point should appear:
;                  |$LVIM_AFTER - The insertion point appears after the item specified if the $LVIM_AFTER flag is set; otherwise
;                  +it appears before the specified item.
;                  Item     - Item next to which the insertion point appears. If -1, there is no insertion point.
;                  Reserved - Reserved. Must be set to 0.
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVINSERTMARK($pPointer = 0)
    Local $aTag[2] = ["tagLVINSERTMARK_", _tagStruct ("int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Size, Flags, Item, Reserved")
EndFunc   ;==>_tagLVINSERTMARK
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVITEM structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Mask      - Set of flags that specify which members of this structure contain data to be set or which members
;                  +are being requested. This member can have one or more of the following flags set:
;                  |$LVIF_COLUMNS     - The Columns member is valid
;                  |$LVIF_DI_SETITEM  - The operating system should store the requested list item information
;                  |$LVIF_GROUPID     - The GroupID member is valid
;                  |$LVIF_IMAGE       - The Image member is valid
;                  |$LVIF_INDENT      - The Indent member is valid
;                  |$LVIF_NORECOMPUTE - The control will not generate LVN_GETDISPINFO to retrieve text information
;                  |$LVIF_PARAM       - The Param member is valid
;                  |$LVIF_STATE       - The State member is valid
;                  |$LVIF_TEXT        - The Text member is valid
;                  Item      - Zero based index of the item to which this structure refers
;                  SubItem   - One based index of the subitem to which this structure refers
;                  State     - Indicates the item's state, state image, and overlay image
;                  StateMask - Value specifying which bits of the state member will be retrieved or modified
;                  Text      - Pointer to a string containing the item text
;                  TextMax   - Number of bytes in the buffer pointed to by Text, including the string terminator
;                  Image     - Index of the item's icon in the control's image list
;                  Param     - Value specific to the item
;                  Indent    - Number of image widths to indent the item
;                  GroupID   - Identifier of the tile view group that receives the item
;                  Columns   - Number of tile view columns to display for this item
;                  pColumns  - Pointer to the array of column indices
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVITEM($pPointer = 0)
    Local $aTag[2] = ["tagLVITEM_", _tagStruct ("int;int;int;int;int;ptr;int;int;int;int;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Mask, Item, SubItem, State, StateMask, Text, TextMax, Image, Param, Indent, GroupID, Columns, pColumns")
EndFunc   ;==>_tagLVITEM
; #STRUCTURE# ===================================================================================================================
; Description ...: _tagLVSETINFOTIP structure
; Parameters ....: $pPointer    - If supplied, structure will be mapped over this pointer
; Fields ........: Size    - Size of this structure, in bytes
;                  Flags   - Flag that specifies how the text should be set. Set to zero.
;                  Text    - Pointer to a Unicode string that contains the tooltip text
;                  Item    - Contains the zero based index of the item to which this structure refers
;                  SubItem - Contains the one based index of the subitem to which this structure refers
;                  hBMP    - Reserved
; Author ........: Paul Campbell (PaulIA)
; Remarks .......:
; ===============================================================================================================================
Func _tagLVSETINFOTIP($pPointer = 0)
    Local $aTag[2] = ["tagLVSETINFOTIP_", _tagStruct ("int;int;ptr;int;int;int", $pPointer) ]
    Return _tagBuild ($aTag, "Size, Flags, Text, Item, SubItem, hBMP")
EndFunc   ;==>_tagLVSETINFOTIP
Opt("MustDeclareVars", 0)

Edited by arcker

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

Hello,

Thanks for the great work that you have done.

I am looking within your help files and examples a possibility to list all windows XP users defined on my system. I haven't found it until now. Is it possible within the set of functions that you have made available?

Thanks a lot.

Link to comment
Share on other sites

Hello,

Thanks for the great work that you have done.

I am looking within your help files and examples a possibility to list all windows XP users defined on my system. I haven't found it until now. Is it possible within the set of functions that you have made available?

Thanks a lot.

Welcome to the forum! Run this in the SciTE editor:

#include <A3LListView.au3>

Run("RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3")
_Lib_WinWaitActive("System Properties")
ControlClick("System Properties", "", "S&ettings")
_Lib_WinWaitActive("User Profiles")
$hList = ControlGetHandle("User Profiles", "", "SysListView321")
if $hList = 0 then _Lib_ShowError("Unable to get ListView")
for $iI = 0 to _ListView_GetItemCount($hList)
  _Lib_ConsoleWrite(_ListView_GetItemText($hList, $iI))
next
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

when trying to use contextmenu of the treeview1 example :

C:\PROGRA~1\AutoIt3\beta\Include\A3LStructs.au3 (54) : ==> Subscript used with non-Array variable.: 
Local $iElement = Eval($aTag[0] & $sElement) 
Local $iElement = Eval($aTag^ ERROR

i've found that the problem is in the _Treeview_HitTestNode function

Edited by arcker

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

when trying to use contextmenu of the treeview1 example :

C:\PROGRA~1\AutoIt3\beta\Include\A3LStructs.au3 (54) : ==> Subscript used with non-Array variable.: 
Local $iElement = Eval($aTag[0] & $sElement) 
Local $iElement = Eval($aTag^ ERROR

i've found that the problem is in the _Treeview_HitTestNode function

Change _TreeView_HitTestNode to this:

Func _TreeView_HitTestNode($hWnd, $iX, $iY)
  Local $tHitTest

  $tHitTest = _TreeView_HitTestEx($hWnd, $iX, $iY)
  Return _tagGetData($tHitTest, "Item")
EndFunc
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...