Jump to content

Listview Group WM_NOTIFY trigger ?


Go to solution Solved by LarsJ,

Recommended Posts

Does anyone know, how to be notified when a Listview Group has been clicked, or expanded, etc. ?

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam
    Local $tInfo, $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom"), $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hWndListView
            Switch $iCode

            ;   Case $of?????? ; A Group was clicked       <---- I need help with this


                Case $LVN_COLUMNCLICK ; A column was clicked
                    $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam)
                    _DebugPrint("$LVN_COLUMNCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
                            "-->Code:" & @TAB & $iCode & @CRLF & _
                            "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _
                            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
                            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
                            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
                            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
                            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
                            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
                            "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
                    ; No return value
                Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
                    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
                    _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
                            "-->Code:" & @TAB & $iCode & @CRLF & _
                            "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _
                            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
                            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
                            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
                            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
                            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
                            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
                            "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _
                            "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
                    ; No return value

            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @CRLF & _
            "+======================================================" & @CRLF & _
            "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _
            "+======================================================" & @CRLF)
EndFunc   ;==>_DebugPrint

If Not StringInStr($CmdLineRaw, "/ErrorStdOut") Then Exit MsgBox($MB_TOPMOST, @ScriptName, 'please run from the editor, thanks', 10)

Global $idListview, $hWndListView
Example()

Func Example()
    Local $aInfo, $hImage, $idListview

    GUICreate("ListView Group COLLAPSIBLE", 400, 300)

    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    $hWndListView = GUICtrlGetHandle($idListview)
    GUISetState(@SW_SHOW)

    ; Load images
    $hImage = _GUIImageList_Create()
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x0000FF, 16, 16))
    _GUICtrlListView_SetImageList($idListview, $hImage, 1)

    ; Add columns
    _GUICtrlListView_AddColumn($idListview, "Column 1", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 2", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 3", 100)

    ; Add items
    _GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 2", 1)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2)
    _GUICtrlListView_AddItem($idListview, "Row 2: Col 1", 1)
    _GUICtrlListView_AddSubItem($idListview, 1, "Row 2: Col 2", 1)
    _GUICtrlListView_AddItem($idListview, "Row 3: Col 1", 2)

    ; Build groups
    _GUICtrlListView_EnableGroupView($idListview)
    _GUICtrlListView_InsertGroup($idListview, -1, 1, "Group 1", 1)
    _GUICtrlListView_SetGroupInfo($idListview, 1, "Group 1", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
    _GUICtrlListView_InsertGroup($idListview, -1, 2, "Group 2")
    _GUICtrlListView_SetGroupInfo($idListview, 2, "Group 2", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
    _GUICtrlListView_SetItemGroupID($idListview, 0, 1)
    _GUICtrlListView_SetItemGroupID($idListview, 1, 2)
    _GUICtrlListView_SetItemGroupID($idListview, 2, 2)

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>Example
 
Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

If you look at the example script for _GUICtrlListview_Create() you will find a lot of Windows message handlers in there that might help.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

If you look at the example script for _GUICtrlListview_Create() you will find a lot of Windows message handlers in there that might help.

Thanks for the reply BrewManNH.

I did what you asked and corrected the entries adding an "a" to the variables not found, still no luck, it may not even be in WM_NOTIFY , maybe a different GUIRegisterMsg is needed.

That's why I'm asking. I did a "Case Else" in the Switch to see what would show, but found nothing to tell "you did something to the Group Title".

Edit1: I kept the "Switch $iCode" short, because is just the example. To show my predicament.

Edit2: Even tho the order of the code is unusual, it's fully functional, and the order of the functions is so, as to easily see where I'm stuck at, at first glance.

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Solution

Try this:

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
 
Global $idListview, $hWndListView

Global Const $LVN_GROUPINFO = ($LVN_FIRST - 88)
Global Const $tagNMLVGROUP = $tagNMHDR & ";int iGroupId;uint iNewState;uint iOldState"
;                                                            $LVGS_flags    $LVGS_flags

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
  #forceref $hWnd, $iMsg, $wParam
  Local $tInfo, $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
  Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom"), $iCode = DllStructGetData($tNMHDR, "Code")
  Switch $hWndFrom
    Case $hWndListView
      Switch $iCode

        ; Case $of?????? ; A Group was clicked       <---- I need help with this
        Case $LVN_GROUPINFO
          $tInfo = DllStructCreate($tagNMLVGROUP, $lParam)
          _DebugPrint("$LVN_GROUPINFO" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
            "-->Code:" & @TAB & $iCode & @CRLF & _
            "-->GroupId:" & @TAB & DllStructGetData($tInfo, "iGroupId") & @CRLF & _
            "-->NewState:" & @TAB & DllStructGetData($tInfo, "iNewState") & @CRLF & _
            "-->OldState:" & @TAB & DllStructGetData($tInfo, "iOldState"))

        Case $LVN_COLUMNCLICK ; A column was clicked
          $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam)
          _DebugPrint("$LVN_COLUMNCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
            "-->Code:" & @TAB & $iCode & @CRLF & _
            "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _
            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
            "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
          ; No return value

        Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
          $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
          _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
            "-->Code:" & @TAB & $iCode & @CRLF & _
            "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _
            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
            "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _
            "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
          ; No return value

      EndSwitch
  EndSwitch
  Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY
 
Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @CRLF & _
            "+======================================================" & @CRLF & _
            "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _
            "+======================================================" & @CRLF)
EndFunc   ;==>_DebugPrint
 
If Not StringInStr($CmdLineRaw, "/ErrorStdOut") Then Exit MsgBox($MB_TOPMOST, @ScriptName, 'please run from the editor, thanks', 10)

Example()
 
Func Example()
    Local $aInfo, $hImage, $idListview
 
    GUICreate("ListView Group COLLAPSIBLE", 400, 300)
 
    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    $hWndListView = GUICtrlGetHandle($idListview)
    GUISetState(@SW_SHOW)
 
    ; Load images
    $hImage = _GUIImageList_Create()
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x0000FF, 16, 16))
    _GUICtrlListView_SetImageList($idListview, $hImage, 1)
 
    ; Add columns
    _GUICtrlListView_AddColumn($idListview, "Column 1", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 2", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 3", 100)
 
    ; Add items
    _GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 2", 1)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2)
    _GUICtrlListView_AddItem($idListview, "Row 2: Col 1", 1)
    _GUICtrlListView_AddSubItem($idListview, 1, "Row 2: Col 2", 1)
    _GUICtrlListView_AddItem($idListview, "Row 3: Col 1", 2)
 
    ; Build groups
    _GUICtrlListView_EnableGroupView($idListview)
    _GUICtrlListView_InsertGroup($idListview, -1, 1, "Group 1", 1)
    _GUICtrlListView_SetGroupInfo($idListview, 1, "Group 1", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
    _GUICtrlListView_InsertGroup($idListview, -1, 2, "Group 2")
    _GUICtrlListView_SetGroupInfo($idListview, 2, "Group 2", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
    _GUICtrlListView_SetItemGroupID($idListview, 0, 1)
    _GUICtrlListView_SetItemGroupID($idListview, 1, 2)
    _GUICtrlListView_SetItemGroupID($idListview, 2, 2)
 
    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
 
    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
 
    GUIDelete()
EndFunc   ;==>Example
Link to comment
Share on other sites

Try this:

Masterfull. At line 28 is want I wanted. Thanks LarsJ

#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>

Global $idListview, $hWndListView

Global Const $LVN_GROUPINFO = ($LVN_FIRST - 88)
Global Const $tagNMLVGROUP = $tagNMHDR & ";int iGroupId;uint iNewState;uint iOldState"
;                                                            $LVGS_flags    $LVGS_flags

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam
    Local $tInfo, $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom"), $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hWndListView
            Switch $iCode

                Case $LVN_GROUPINFO ; A Group was clicked
                    $tInfo = DllStructCreate($tagNMLVGROUP, $lParam)
                    Local $Collapsed = False
                    If DllStructGetData($tInfo, "iNewState") > DllStructGetData($tInfo, "iOldState") Then $Collapsed = True
                    _DebugPrint("$LVN_GROUPINFO" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
                            "-->Code:" & @TAB & $iCode & @CRLF & _
                            "-->IsCollapsed:" & @TAB & $Collapsed & @CRLF & _ ; <--- this is what I was looking to have, thanks LarsJ
                            "-->GroupId:" & @TAB & DllStructGetData($tInfo, "iGroupId") & @CRLF & _
                            "-->NewState:" & @TAB & DllStructGetData($tInfo, "iNewState") & @CRLF & _
                            "-->OldState:" & @TAB & DllStructGetData($tInfo, "iOldState"))

                Case $LVN_COLUMNCLICK ; A column was clicked
                    $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam)
                    _DebugPrint("$LVN_COLUMNCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
                            "-->Code:" & @TAB & $iCode & @CRLF & _
                            "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _
                            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
                            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
                            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
                            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
                            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
                            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
                            "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
                    ; No return value

                Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
                    $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
                    _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
                            "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
                            "-->Code:" & @TAB & $iCode & @CRLF & _
                            "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _
                            "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
                            "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
                            "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
                            "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
                            "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
                            "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
                            "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _
                            "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
                    ; No return value

            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @CRLF & _
            "+======================================================" & @CRLF & _
            "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _
            "+======================================================" & @CRLF)
EndFunc   ;==>_DebugPrint

If Not StringInStr($CmdLineRaw, "/ErrorStdOut") Then Exit MsgBox($MB_TOPMOST, @ScriptName, 'please run from the editor, thanks', 10)

Example()

Func Example()
    Local $aInfo, $hImage, $idListview

    GUICreate("ListView Group COLLAPSIBLE", 400, 300)

    $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    $hWndListView = GUICtrlGetHandle($idListview)
    GUISetState(@SW_SHOW)

    ; Load images
    $hImage = _GUIImageList_Create()
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0xFF0000, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x00FF00, 16, 16))
    _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x0000FF, 16, 16))
    _GUICtrlListView_SetImageList($idListview, $hImage, 1)

    ; Add columns
    _GUICtrlListView_AddColumn($idListview, "Column 1", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 2", 100)
    _GUICtrlListView_AddColumn($idListview, "Column 3", 100)

    ; Add items
    _GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 2", 1)
    _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2)
    _GUICtrlListView_AddItem($idListview, "Row 2: Col 1", 1)
    _GUICtrlListView_AddSubItem($idListview, 1, "Row 2: Col 2", 1)
    _GUICtrlListView_AddItem($idListview, "Row 3: Col 1", 2)

    ; Build groups
    _GUICtrlListView_EnableGroupView($idListview)
    _GUICtrlListView_InsertGroup($idListview, -1, 1, "Group 1", 1)
    _GUICtrlListView_SetGroupInfo($idListview, 1, "Group 1", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
    _GUICtrlListView_InsertGroup($idListview, -1, 2, "Group 2")
    _GUICtrlListView_SetGroupInfo($idListview, 2, "Group 2", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
    _GUICtrlListView_SetItemGroupID($idListview, 0, 1)
    _GUICtrlListView_SetItemGroupID($idListview, 1, 2)
    _GUICtrlListView_SetItemGroupID($idListview, 2, 2)

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>Example

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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