arlight1 Posted November 22, 2017 Share Posted November 22, 2017 i've been working a lot with listview recently, and found out that groups can be created to expand/collapse the items that belong to them. While a state does exist to collapse it a will, a state does not exist to expand a group within a listview at will. So that got me thinking, how do message boxes, treeview, listviews and other controls that don't use GUIGetMsg() to capture mouse clicks work? If I click "ok" on a message box, how does it automatically know to close it out? Same with a list/treeview, if I click on the "+" sign, how does it know to expand or collapse a group? Where is all that defined? Link to comment Share on other sites More sharing options...
arlight1 Posted November 23, 2017 Author Share Posted November 23, 2017 Bump Link to comment Share on other sites More sharing options...
Danyfirex Posted November 23, 2017 Share Posted November 23, 2017 Hello. It's a complex question But a start point is GUIRegisterMsg. But You need go to deep Windows Information. Check MSDN. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
arlight1 Posted November 27, 2017 Author Share Posted November 27, 2017 On 11/23/2017 at 11:16 AM, Danyfirex said: Hello. It's a complex question But a start point is GUIRegisterMsg. But You need go to deep Windows Information. Check MSDN. Saludos Thanks for the response! Would that be the way to go then if I wanted to automate the expanding/collapsing of a listview group, for example? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 27, 2017 Moderators Share Posted November 27, 2017 arlight1, _GUICtrlListView_SetGroupInfo would seem a good place to start - this is based on the Help file example for that function: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $aInfo, $hImage, $idListview GUICreate("ListView Set Group Info", 400, 300) $idListview = GUICtrlCreateListView("", 2, 2, 394, 268) 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_InsertGroup($idListview, -1, 2, "Group 2") _GUICtrlListView_SetItemGroupID($idListview, 0, 1) _GUICtrlListView_SetItemGroupID($idListview, 1, 2) _GUICtrlListView_SetItemGroupID($idListview, 2, 2) ; Change group information Sleep(1000) _GUICtrlListView_SetGroupInfo($idListview, 2, "Collapsed Group 2", 0, $LVGS_COLLAPSED) Sleep(1000) _GUICtrlListView_SetGroupInfo($idListview, 2, "Expanded Group 2") ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now