#include <Array.au3>
#include <WinAPI.au3>
#cs **************************************************************************

	Listview - Scrollen ohne Scrollbalken

	http://www.autoit.de/index.php?page=Thread&postID=129769#post129769

#ce **************************************************************************

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GuiListView.au3>

global $dll = DllOpen("user32.dll")
$style1 = Bitor($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS)
$style2 = Bitor($LVS_REPORT, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS,$LVS_NOSCROLL)


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$ListView1 = GUICtrlCreateListView("Hallo|1", 120, 40, 433, 225, $style1)
$hListView1= GUICtrlGetHandle($ListView1)
$ListView2 = GUICtrlCreateListView("Hallo|2", 56, 40, 433, 225,$LVS_NOSCROLL,BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER))
$hListView2= GUICtrlGetHandle($ListView2)
GUICtrlSetState(-1,$GUI_HIDE)
$Button1 = GUICtrlCreateButton("Button1", 64, 288, 129, 49, 0)
$Button2 = GUICtrlCreateButton("Button2", 264, 288, 185, 49, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $style = $COLOR_HIGHLIGHT
Global $style2 = $COLOR_HIGHLIGHTTEXT
Global $style3 = $COLOR_SCROLLBAR
Global $aElem[3] = [$style, $style2, $style3]
_arrayDisplay($aElem)
Global $aColor[3] = [0xD9D1CC, 0x000000,0xD9D1CC]
Global $aBevore[3] = [_WinAPI_GetSysColor($style1),_WinAPI_GetSysColor($style2), _WinAPI_GetSysColor($style3)]
$res=_WinAPI_SetSysColors($aElem, $aColor)
ConsoleWrite("Result"&$Res & @CRLF)
for $i = 0 to 20
    GUICtrlCreateListViewItem("test|" & $i,$ListView1)
next
for $i = 0 to 20
    GUICtrlCreateListViewItem("test|" & $i,$ListView2)
next
While 1
    $nMsg = GUIGetMsg()
    If _IsPressed("28", $dll) Then
        _Setstyle()
    EndIf
        If _IsPressed("26", $dll) Then
        _Setstyle()
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            DllClose($dll)
            _WinAPI_SetSysColors($aElem, $aBevore)
            Exit
        case $Button1
            GUICtrlSetState($ListView1, $GUI_HIDE)
            GUICtrlSetState($ListView2, $GUI_Show)
            GUICtrlCreateListViewItem("test|test",$ListView1)
        case $Button2
            GUICtrlSetState($ListView2, $GUI_HIDE)
            GUICtrlSetState($ListView1, $GUI_Show)
            GUICtrlCreateListViewItem("test|test",$ListView2)
    EndSwitch
WEnd

Func _Setstyle()
    ConsoleWrite("lala" &@CRLF)
$test =  _GUICtrlListView_GetSelectedIndices( $hListView2,1)
;~ _arraydisplay($test)
if IsArray($Test) then
ConsoleWrite($Test[1] & @CRLF)
ConsoleWrite(  _GUICtrlListView_EnsureVisible($ListView2,10)&@crLF)
EndIf
endfunc
