Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

11 Sep 2019, 01:11


EDIT: Function modified for simplicity and examples given for proper handling.

I recently came across the need for this and wanted to share. Hope this helps someone. I only saw 2 questions like this on the forum, one of which was in the archvies.

The core functions are SaveTree() and LoadTree(). SaveTree() just converts the structure into text so that you can do with it as you please (I use FileAppend). LoadTree() takes a var you give it and loads the tree. You must populate the var yourself, for example with FileRead, getting the data from text file / previously saved tree.

SaveTree() dumps pure text in the following format:

Code: Select all

[child;]node name[;node child;node child;...];node_attrib
[child;]node name[;node child;node child;...];node_attrib
[child;]node name[;node child;node child;...];node_attrib
...
New lines are `r`n

Explanation:
[child;] = signifies that a particular node is a child of the previous line. If this node is top-level, then the substring "child;" does not exist.
node name = the node being recorded on any given line
[;node child;node child;...] = if the parent node has children, they are listed here, but only 1 level of children (ie. "siblings" as the AHK help docs put it)
node_attrib = "C" for checked / "E" for expanded / "B" for bold
This example uses system services and puts them into a hierarchy. Exactly how I made the hierarchy I can't get into in this example, there's already a bunch of code, and then we're talking about WMI queries and other objects that would confuse the point, which is to save/load a TreeView's contents. I can put that stuff into another post if people want.

Code: Select all

Global MainHwnd, ServiceTreeHwnd, ServiceTree, ServiceTreeSelectedID

Gui, New, +HwndMainHwnd
Gui, Add, Button, Section gSaveServiceTree, Save Layout
Gui, Add, Button, x+0 yp gLoadServiceTree, Load Layout
Gui, Add, TreeView, xs y+6 w600 r17 Checked +HwndServiceTreeHwnd vServiceTree ; define vControlName and Hwnd
Gui, Show

SaveServiceTree() {
    MsgBox, 4, Save Tree, Are you sure?
    
    IfMsgBox, No
        return
    
    FileDelete, ServiceTree.txt
    
    ; if you are dealing with multiple GUIs or multiple TreeViews, then the next 2 lines are VERY important for you
    ; Gui, %MainHwnd%:Default ; be sure to do this if necessary
    ; Gui, TreeView, ServiceTree ; be sure to do this if necessary
    
    TreeData := SaveTree() ; dump tree data to var
    FileAppend, %TreeData%, ServiceTree.txt ; save tree data
    MsgBox Tree saved.
}

LoadServiceTree() { ; GUI button event
    FileRead, TreeData, ServiceTree.txt ; read file into var (TreeData)
    
    ; if you are dealing with multiple GUIs or multiple TreeViews, then the next 2 lines are VERY important for you
    ; Gui, %MainHwnd%:Default ; be sure to do this if necessary
    ; Gui, TreeView, ServiceTree ; be sure to do this if necessary
    
    TV_Delete() ; clear tree before reloading, if desired
    GuiControl, -Redraw, ServiceTree ; turn off Redraw for performance gain
    LoadTree(TreeData) ; Load tree
    GuiControl, +Redraw, ServiceTree ; turn Redraw back on to see results
}


GuiContextMenu(GuiHwnd, CtrlHwnd, EventInfo, IsRightClick, X, Y) {
    If (CtrlHwnd = ServiceTreeHwnd) {
        Gui, TreeView, ServiceTree ; ensure that you operate on the intended TreeView (if you have multiple TreeView controls)
        ServiceTreeSelectedID := EventInfo ; save unique tree item ID to global var for "Delete" menu
        Menu, ServiceTreeMenu, Add, Delete, ServiceTreeMenuEvent ; right-click "Delete" context menu
        Menu, ServiceTreeMenu, Show
    }
}

ServiceTreeMenuEvent(ItemName, ItemPos, MenuName) {
    If (ItemName = "Delete") {
        Gui, %MainHwnd%:Default ; need this after the context menu appears
        Gui, TreeView, ServiceTree ; might need this if you have multiple TreeView controls
        result := TV_Delete(ServiceTreeSelectedID) ; delete tree item with it's unique ID saved from GuiContextMenu
    }
}

GuiClose() { ; GUI close event
    ExitApp ; do this otherwise the script keeps running after the GUI closes
}


; ====================================================================
; by TheArkive
; SaveTree()
; ====================================================================

SaveTree() {
    CurID := TV_GetNext() ; get top most node ID
    TV_GetText(CurText,CurID) ; get top most node text
    
    While (CurID > 0) {
        CurLine := CurText
        
        attrib := TV_Get(CurID,"E") ; check if expanded
        If (attrib > 0) {
            attribList := "E"
        }
        attrib := TV_Get(CurID,"C") ; check if checked
        If (attrib > 0) {
            attribList .= "C"
        }
        attrib := TV_Get(CurID,"B") ; check if bold
        If (attrib > 0) {
            attribList .= "B"
        }
        
        CurChildID := TV_GetChild(CurID) ; get first child ID if any
        TV_GetText(CurChildText,CurChildID) ; get first child text if any
        
        While (CurChildID > 0) {
            CurLine .= ";" CurChildText
            
            CurChildID := TV_GetNext(CurChildID) ;  init for next child
            TV_GetText(CurChildText,CurChildID)
        }
        
        CurParentID := TV_GetParent(CurID) ; check if top level node or child
        If (CurParentID > 0) {
            CurLine := "child;" CurLine
        }
        
        FinalData .= CurLine ";" attribList "`r`n"
        
        attribList := "" ; init/reset for next iteration
        CurID := TV_GetNext(CurID,"Full") ; initialize for next iteration/node
        TV_GetText(CurText,CurID)
    }
    
    return FinalData
}

; ====================================================================
; by TheArkive
; LoadTree(TreeData)
; ====================================================================

LoadTree(TreeData) {
    IsChild := 0 ; first init
    CurID := 0
    ParentID := 0
    IsExpanded := false
    
    Loop, Parse, TreeData, `r, `n
    {
        CurLine := A_LoopField
        iLen := StrLen(CurLine)
        Loop, Parse, CurLine, % Chr(59) ; chr59 = ";"
            i := A_Index ; get number of tokens in CurLine
        
        lastSep := InStr(CurLine,";",,1,i-1)
        firstSep := InStr(CurLine,";",,1,1)
        
        CheckChild := SubStr(CurLine,1,(firstSep-1)) ; get first token of CurLine (sep = ";")
        
        If (CheckChild = "child") {
            IsChild := 1
        }

        attribList := SubStr(CurLine,lastSep+1,iLen-lastSep)
        
        Loop, Parse, attribList
        {
            If (A_LoopField = "E") {
                IsExpanded := true
            } Else If (A_LoopField = "C") {
                attribs .= "Check "
            } Else If (A_LoopField = "B") {
                attribs .= "Bold"
            }
        }
        
        attribs := Trim(attribs,OmitChars:=" `r`n") ; get saved node attributes
        
        If (IsChild = 0) {
            nodeList := SubStr(CurLine,1,lastSep-1)
        } Else {
            nodeList := SubStr(CurLine,firstSep+1,(lastSep-firstSep-1))
        }
        
        nodeListFirst := InStr(nodeList,";",,1,1)

        If (nodeListFirst = 0) {
            FirstNode := nodeList
            ChildNodes := ""
        } Else {
            FirstNode := SubStr(nodeList,1,nodeListFirst-1)
            ChildNodes := SubStr(nodeList,(nodeListFirst+1),iLen-nodeListFirst)
        }
        
        ; ====================================================
        
        If (IsChild = 0) {
            CurID := TV_Add(FirstNode,0,attribs) ; define CurID for future ParentID operations
            If (ChildNodes <> "") {
                Loop, Parse, ChildNodes, % Chr(59)
                {
                    TV_Add(A_LoopField,CurID)
                }
            }
            
            If (IsExpanded) {
                TV_Modify(CurID,"Expand")
            }
            
            ParentID := TV_GetNext(CurID,"Full") ; define ParentID by navigating in "Full" mode, like how the datafile was made
        } Else { ; if IsChild=true, FirstNode should already be created and ParentID should be the ID for that node
            CheckParentID := TV_Modify(ParentID,attribs)
            If (CheckParentID <> ParentID) {
                MsgBox parent ID issue
            }
            
            If (ChildNodes <> "") {
                Loop, Parse, ChildNodes, % Chr(59)
                {
                    TV_Add(A_LoopField,ParentID)
                }
            }
            
            If (IsExpanded) {
                TV_Modify(ParentID,"Expand")
            }
            
            ParentID := TV_GetNext(ParentID,"Full") ; define ParentID by navigating in "Full" mode, like how the datafile was made
        }
        
        ; ====================================================
        
        attribs := "" ; subsequent inits
        IsExpanded := false
        attribList := ""
        FirstNode := ""
        ChildNodes := ""
        IsChild := 0
        nodeList := ""
    }
}
That script should work as-is, but there is no data in the tree. Save the following to a text file and call it "ServiceTree.txt" and put that txt file in the same folder as your example ahk script before you run it.

Code: Select all

AllJoyn Router Service (AJRouter);
AOMEI Backupper Scheduler Service (Backupper Service);C
App Readiness (AppReadiness);
Application Layer Gateway Service (ALG);
Application Management (AppMgmt);
AssignedAccessManager Service (AssignedAccessManagerSvc);
Auto Time Zone Updater (tzautoupdate);
Autodesk Desktop App Service (AdAppMgrSvc);C
BitLocker Drive Encryption Service (BDESVC);
Block Level Backup Engine Service (wbengine);
Bluetooth Support Service (bthserv);C
Bluetooth User Support Service_8f667 (BluetoothUserService_8f667);
Capability Access Manager Service (camsvc);C
CaptureService_8f667 (CaptureService_8f667);
Clipboard User Service_8f667 (cbdhsvc_8f667);C
Connected Devices Platform User Service_8f667 (CDPUserSvc_8f667);C
ConsentUX_8f667 (ConsentUxUserSvc_8f667);
Contact Data_8f667 (PimIndexMaintenanceSvc_8f667);C
CredentialEnrollmentManagerUserSvc_8f667 (CredentialEnrollmentManagerUserSvc_8f667);
Data Sharing Service (DsSvc);
DbxSvc (DbxSvc);C
DCOM Server Process Launcher (DcomLaunch);Remote Procedure Call (RPC) (RpcSs);EC
child;Remote Procedure Call (RPC) (RpcSs);ActiveX Installer (AxInstSV);AVCTP service (BthAvctpSvc);Background Intelligent Transfer Service (BITS);Background Tasks Infrastructure Service (BrokerInfrastructure);Base Filtering Engine (BFE);Bluetooth Audio Gateway Service (BTAGService);Cellular Time (autotimesvc);Certificate Propagation (CertPropSvc);Client License Service (ClipSVC);CNG Key Isolation (KeyIso);COM+ Event System (EventSystem);Connected User Experiences and Telemetry (DiagTrack);CoreMessaging (CoreMessagingRegistrar);Credential Manager (VaultSvc);Cryptographic Services (CryptSvc);Data Usage (DusmSvc);Delivery Optimization (DoSvc);Device Management Enrollment Service (DmEnrollmentSvc);Device Management Wireless Application Protocol (WAP) Push message Routing Service (dmwappushservice);Device Setup Manager (DsmSvc);Diagnostic Execution Service (diagsvc);Display Policy Service (DispBrokerDesktopSvc);Distributed Link Tracking Client (TrkWks);Downloaded Maps Manager (MapsBroker);Dropbox Update Service (dbupdate);Dropbox Update Service (dbupdatem);Encrypting File System (EFS);Enterprise App Management Service (EntAppSvc);File History Service (fhsvc);Function Discovery Provider Host (fdPHost);Geolocation Service (lfsvc);Google Update Service (gupdate);Google Update Service (gupdatem);Group Policy Client (gpsvc);Intel(R) Content Protection HECI Service (cphs);Link-Layer Topology Discovery Mapper (lltdsvc);Local Session Manager (LSM);LxssManager (LxssManager);Microsoft Account Sign-in Assistant (wlidsvc);Microsoft Passport (NgcSvc);Microsoft Passport Container (NgcCtnrSvc);Microsoft Software Shadow Copy Provider (swprv);Microsoft Storage Spaces SMP (smphost);Microsoft Store Install Service (InstallService);Microsoft Windows SMS Router Service. (SmsRouter);Network Connection Broker (NcbService);Network Setup Service (NetSetupSvc);Network Store Interface Service (nsi);Offline Files (CscService);Optimize drives (defragsvc);Payments and NFC/SE Manager (SEMgrSvc);Performance Counter DLL Host (PerfHost);Performance Logs & Alerts (pla);Phone Service (PhoneSvc);Portable Device Enumerator Service (WPDBusEnum);Print Spooler (Spooler);Printer Extensions and Notifications (PrintNotify);Program Compatibility Assistant Service (PcaSvc);Quality Windows Audio Video Experience (QWAVE);Radio Management Service (RmSvc);Recommended Troubleshooting Service (TroubleshootingSvc);Remote Desktop Configuration (SessionEnv);Remote Desktop Services (TermService);Remote Registry (RemoteRegistry);Security Accounts Manager (SamSs);Security Center (wscsvc);Shared PC Account Manager (shpamsvc);Shell Hardware Detection (ShellHWDetection);Smart Card Removal Policy (SCPolicySvc);Software Protection (sppsvc);Spatial Data Service (SharedRealitySvc);State Repository Service (StateRepository);Still Image Acquisition Events (WiaRpc);SysMain (SysMain);System Events Broker (SystemEventsBroker);System Guard Runtime Monitor Broker (SgrmBroker);Telephony (TapiSrv);Touch Keyboard and Handwriting Panel Service (TabletInputService);Update Orchestrator Service (UsoSvc);User Profile Service (ProfSvc);Virtual Disk (vds);Volume Shadow Copy (VSS);Volumetric Audio Compositor Service (VacSvc);Web Management (WebManagement);Wi-Fi Direct Services Connection Manager Service (WFDSConMgrSvc);Windows Audio (Audiosrv);Windows Backup (SDRSVC);Windows Biometric Service (WbioSrvc);Windows Camera Frame Server (FrameServer);Windows Connect Now - Config Registrar (wcncsvc);Windows Defender Antivirus Service (WinDefend);Windows Encryption Provider Host Service (WEPHOSTSVC);Windows Image Acquisition (WIA) (stisvc);Windows Insider Service (wisvc);Windows Installer (msiserver);Windows License Manager Service (LicenseManager);Windows Management Instrumentation (Winmgmt);Windows Management Service (WManSvc);Windows Mobile Hotspot Service (icssvc);Windows Perception Service (spectrum);Windows Perception Simulation Service (perceptionsimulation);Windows Push Notifications System Service (WpnService);Windows PushToInstall Service (PushToInstall);Windows Remote Management (WS-Management) (WinRM);Windows Security Service (SecurityHealthService);Windows Update (wuauserv);Windows Update Medic Service (WaaSMedicSvc);WWAN AutoConfig (WwanSvc);Xbox Live Auth Manager (XblAuthManager);EC
child;ActiveX Installer (AxInstSV);
child;AVCTP service (BthAvctpSvc);C
child;Background Intelligent Transfer Service (BITS);
child;Background Tasks Infrastructure Service (BrokerInfrastructure);Embedded Mode (embeddedmode);Windows Search (WSearch);EC
child;Embedded Mode (embeddedmode);
child;Windows Search (WSearch);Windows Media Player Network Sharing Service (WMPNetworkSvc);Work Folders (workfolderssvc);EC
child;Windows Media Player Network Sharing Service (WMPNetworkSvc);
child;Work Folders (workfolderssvc);
child;Base Filtering Engine (BFE);ESET Firewall Helper (ekrnEpfw);IKE and AuthIP IPsec Keying Modules (IKEEXT);Internet Connection Sharing (ICS) (SharedAccess);IPsec Policy Agent (PolicyAgent);Network Connectivity Assistant (NcaSvc);Routing and Remote Access (RemoteAccess);Windows Defender Antivirus Network Inspection System Driver (WdNisDrv);Windows Defender Firewall (mpssvc);EC
child;ESET Firewall Helper (ekrnEpfw);C
child;IKE and AuthIP IPsec Keying Modules (IKEEXT);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Xbox Live Networking Service (XboxNetApiSvc);
child;Internet Connection Sharing (ICS) (SharedAccess);
child;IPsec Policy Agent (PolicyAgent);C
child;Network Connectivity Assistant (NcaSvc);
child;Routing and Remote Access (RemoteAccess);
child;Windows Defender Antivirus Network Inspection System Driver (WdNisDrv);Windows Defender Antivirus Network Inspection Service (WdNisSvc);E
child;Windows Defender Antivirus Network Inspection Service (WdNisSvc);
child;Windows Defender Firewall (mpssvc);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Xbox Live Networking Service (XboxNetApiSvc);
child;Bluetooth Audio Gateway Service (BTAGService);C
child;Cellular Time (autotimesvc);
child;Certificate Propagation (CertPropSvc);C
child;Client License Service (ClipSVC);
child;CNG Key Isolation (KeyIso);Extensible Authentication Protocol (Eaphost);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Extensible Authentication Protocol (Eaphost);Wired AutoConfig (dot3svc);E
child;Wired AutoConfig (dot3svc);
child;Xbox Live Networking Service (XboxNetApiSvc);
child;COM+ Event System (EventSystem);System Event Notification Service (SENS);EC
child;System Event Notification Service (SENS);COM+ System Application (COMSysApp);Intel(R) HD Graphics Control Panel Service (igfxCUIService2.0.0.0);EC
child;COM+ System Application (COMSysApp);
child;Intel(R) HD Graphics Control Panel Service (igfxCUIService2.0.0.0);C
child;Connected User Experiences and Telemetry (DiagTrack);C
child;CoreMessaging (CoreMessagingRegistrar);C
child;Credential Manager (VaultSvc);C
child;Cryptographic Services (CryptSvc);Application Identity (AppIDSvc);EC
child;Application Identity (AppIDSvc);Smartlocker Filter Driver (applockerfltr);E
child;Smartlocker Filter Driver (applockerfltr);
child;Data Usage (DusmSvc);C
child;Delivery Optimization (DoSvc);C
child;Device Management Enrollment Service (DmEnrollmentSvc);
child;Device Management Wireless Application Protocol (WAP) Push message Routing Service (dmwappushservice);
child;Device Setup Manager (DsmSvc);
child;Diagnostic Execution Service (diagsvc);
child;Display Policy Service (DispBrokerDesktopSvc);C
child;Distributed Link Tracking Client (TrkWks);C
child;Downloaded Maps Manager (MapsBroker);
child;Dropbox Update Service (dbupdate);
child;Dropbox Update Service (dbupdatem);
child;Encrypting File System (EFS);
child;Enterprise App Management Service (EntAppSvc);
child;File History Service (fhsvc);
child;Function Discovery Provider Host (fdPHost);Function Discovery Resource Publication (FDResPub);E
child;Function Discovery Resource Publication (FDResPub);C
child;Geolocation Service (lfsvc);C
child;Google Update Service (gupdate);
child;Google Update Service (gupdatem);
child;Group Policy Client (gpsvc);
child;Intel(R) Content Protection HECI Service (cphs);
child;Link-Layer Topology Discovery Mapper (lltdsvc);
child;Local Session Manager (LSM);C
child;LxssManager (LxssManager);
child;Microsoft Account Sign-in Assistant (wlidsvc);
child;Microsoft Passport (NgcSvc);
child;Microsoft Passport Container (NgcCtnrSvc);
child;Microsoft Software Shadow Copy Provider (swprv);
child;Microsoft Storage Spaces SMP (smphost);
child;Microsoft Store Install Service (InstallService);C
child;Microsoft Windows SMS Router Service. (SmsRouter);
child;Network Connection Broker (NcbService);Connected Devices Platform Service (CDPSvc);EC
child;Connected Devices Platform Service (CDPSvc);C
child;Network Setup Service (NetSetupSvc);
child;Network Store Interface Service (nsi);DHCP Client (Dhcp);DNS Client (Dnscache);IKE and AuthIP IPsec Keying Modules (IKEEXT);IP Translation Configuration Service (IpxlatCfgSvc);Network Connections (Netman);SSDP Discovery (SSDPSRV);Windows Connection Manager (Wcmsvc);Workstation (LanmanWorkstation);EC
child;DHCP Client (Dhcp);Network Location Awareness (NlaSvc);WinHTTP Web Proxy Auto-Discovery Service (WinHttpAutoProxySvc);EC
child;Network Location Awareness (NlaSvc);Network List Service (netprofm);EC
child;Network List Service (netprofm);Microsoft App-V Client (AppVClient);Network Connected Devices Auto-Setup (NcdAutoSetup);EC
child;Microsoft App-V Client (AppVClient);
child;Network Connected Devices Auto-Setup (NcdAutoSetup);C
child;WinHTTP Web Proxy Auto-Discovery Service (WinHttpAutoProxySvc);IP Helper (iphlpsvc);EC
child;IP Helper (iphlpsvc);Network Connectivity Assistant (NcaSvc);EC
child;Network Connectivity Assistant (NcaSvc);
child;DNS Client (Dnscache);debugregsvc (debugregsvc);Network Connectivity Assistant (NcaSvc);Remote Access Connection Manager (RasMan);EC
child;debugregsvc (debugregsvc);
child;Network Connectivity Assistant (NcaSvc);
child;Remote Access Connection Manager (RasMan);Routing and Remote Access (RemoteAccess);EC
child;Routing and Remote Access (RemoteAccess);
child;IKE and AuthIP IPsec Keying Modules (IKEEXT);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Xbox Live Networking Service (XboxNetApiSvc);
child;IP Translation Configuration Service (IpxlatCfgSvc);
child;Network Connections (Netman);
child;SSDP Discovery (SSDPSRV);UPnP Device Host (upnphost);EC
child;UPnP Device Host (upnphost);
child;Windows Connection Manager (Wcmsvc);Windows Mobile Hotspot Service (icssvc);WLAN AutoConfig (WlanSvc);EC
child;Windows Mobile Hotspot Service (icssvc);
child;WLAN AutoConfig (WlanSvc);C
child;Workstation (LanmanWorkstation);Netlogon (Netlogon);Remote Desktop Configuration (SessionEnv);EC
child;Netlogon (Netlogon);
child;Remote Desktop Configuration (SessionEnv);
child;Offline Files (CscService);
child;Optimize drives (defragsvc);
child;Payments and NFC/SE Manager (SEMgrSvc);
child;Performance Counter DLL Host (PerfHost);
child;Performance Logs & Alerts (pla);
child;Phone Service (PhoneSvc);C
child;Portable Device Enumerator Service (WPDBusEnum);
child;Print Spooler (Spooler);Fax (Fax);EC
child;Fax (Fax);
child;Printer Extensions and Notifications (PrintNotify);
child;Program Compatibility Assistant Service (PcaSvc);C
child;Quality Windows Audio Video Experience (QWAVE);
child;Radio Management Service (RmSvc);
child;Recommended Troubleshooting Service (TroubleshootingSvc);
child;Remote Desktop Configuration (SessionEnv);
child;Remote Desktop Services (TermService);Remote Desktop Services UserMode Port Redirector (UmRdpService);E
child;Remote Desktop Services UserMode Port Redirector (UmRdpService);
child;Remote Registry (RemoteRegistry);
child;Security Accounts Manager (SamSs);Distributed Transaction Coordinator (MSDTC);KtmRm for Distributed Transaction Coordinator (KtmRm);Server (LanmanServer);EC
child;Distributed Transaction Coordinator (MSDTC);
child;KtmRm for Distributed Transaction Coordinator (KtmRm);
child;Server (LanmanServer);C
child;Security Center (wscsvc);C
child;Shared PC Account Manager (shpamsvc);
child;Shell Hardware Detection (ShellHWDetection);C
child;Smart Card Removal Policy (SCPolicySvc);C
child;Software Protection (sppsvc);
child;Spatial Data Service (SharedRealitySvc);
child;State Repository Service (StateRepository);AppX Deployment Service (AppXSVC);EC
child;AppX Deployment Service (AppXSVC);
child;Still Image Acquisition Events (WiaRpc);
child;SysMain (SysMain);C
child;System Events Broker (SystemEventsBroker);Task Scheduler (Schedule);EC
child;Task Scheduler (Schedule);Natural Authentication (NaturalAuthentication);EC
child;Natural Authentication (NaturalAuthentication);
child;System Guard Runtime Monitor Broker (SgrmBroker);C
child;Telephony (TapiSrv);Fax (Fax);E
child;Fax (Fax);
child;Touch Keyboard and Handwriting Panel Service (TabletInputService);C
child;Update Orchestrator Service (UsoSvc);C
child;User Profile Service (ProfSvc);Application Information (Appinfo);Natural Authentication (NaturalAuthentication);Shared PC Account Manager (shpamsvc);User Manager (UserManager);EC
child;Application Information (Appinfo);B
child;Natural Authentication (NaturalAuthentication);
child;Shared PC Account Manager (shpamsvc);
child;User Manager (UserManager);Web Account Manager (TokenBroker);Xbox Live Game Save (XblGameSave);EC
child;Web Account Manager (TokenBroker);C
child;Xbox Live Game Save (XblGameSave);
child;Virtual Disk (vds);
child;Volume Shadow Copy (VSS);
child;Volumetric Audio Compositor Service (VacSvc);
child;Web Management (WebManagement);
child;Wi-Fi Direct Services Connection Manager Service (WFDSConMgrSvc);
child;Windows Audio (Audiosrv);C
child;Windows Backup (SDRSVC);
child;Windows Biometric Service (WbioSrvc);C
child;Windows Camera Frame Server (FrameServer);
child;Windows Connect Now - Config Registrar (wcncsvc);C
child;Windows Defender Antivirus Service (WinDefend);
child;Windows Encryption Provider Host Service (WEPHOSTSVC);
child;Windows Image Acquisition (WIA) (stisvc);C
child;Windows Insider Service (wisvc);
child;Windows Installer (msiserver);
child;Windows License Manager Service (LicenseManager);C
child;Windows Management Instrumentation (Winmgmt);IP Helper (iphlpsvc);EC
child;IP Helper (iphlpsvc);Network Connectivity Assistant (NcaSvc);EC
child;Network Connectivity Assistant (NcaSvc);
child;Windows Management Service (WManSvc);
child;Windows Mobile Hotspot Service (icssvc);
child;Windows Perception Service (spectrum);
child;Windows Perception Simulation Service (perceptionsimulation);
child;Windows Push Notifications System Service (WpnService);C
child;Windows PushToInstall Service (PushToInstall);
child;Windows Remote Management (WS-Management) (WinRM);
child;Windows Security Service (SecurityHealthService);C
child;Windows Update (wuauserv);
child;Windows Update Medic Service (WaaSMedicSvc);
child;WWAN AutoConfig (WwanSvc);Local Profile Assistant Service (wlpasvc);E
child;Local Profile Assistant Service (wlpasvc);
child;Xbox Live Auth Manager (XblAuthManager);Xbox Live Game Save (XblGameSave);E
child;Xbox Live Game Save (XblGameSave);
Developer Tools Service (DeveloperToolsService);
Device Association Service (DeviceAssociationService);C
Device Install Service (DeviceInstall);
DeviceAssociationBroker_8f667 (DeviceAssociationBrokerSvc_8f667);
DevicePicker_8f667 (DevicePickerUserSvc_8f667);
DevicesFlow_8f667 (DevicesFlowUserSvc_8f667);
DevQuery Background Discovery Broker (DevQueryBroker);
Diagnostic Policy Service (DPS);C
Diagnostic Service Host (WdiServiceHost);C
Diagnostic System Host (WdiSystemHost);
Display Enhancement Service (DisplayEnhancementService);C
Elan Service (ETDService);C
ESET Service (ekrn);C
FlexNet Licensing Service 64 (FlexNet Licensing Service 64);
GameDVR and Broadcast User Service_8f667 (BcastDVRUserService_8f667);
GraphicsPerfSvc (GraphicsPerfSvc);
Human Interface Device Service (hidserv);C
Hyper-V Data Exchange Service (vmickvpexchange);
Hyper-V Guest Service Interface (vmicguestinterface);
Hyper-V Guest Shutdown Service (vmicshutdown);
Hyper-V Heartbeat Service (vmicheartbeat);
Hyper-V PowerShell Direct Service (vmicvmsession);
Hyper-V Remote Desktop Virtualization Service (vmicrdv);
Hyper-V Volume Shadow Copy Requestor (vmicvss);
IncrediBuild Agent (IncrediBuild_Agent);C
IncrediBuild Coordinator (IncrediBuild_Coordinator);C
InstallRoot (InstallRoot);C
Intel Bluetooth Service (ibtsiva);C
Language Experience Service (LxpSvc);
Logitech Gaming Registry Service (LogiRegistryService);C
LxssManagerUser_8f667 (LxssManagerUser_8f667);C
MessagingService_8f667 (MessagingService_8f667);
Microsoft (R) Diagnostics Hub Standard Collector Service (diagnosticshub.standardcollector.service);
Microsoft iSCSI Initiator Service (MSiSCSI);
Mozilla Maintenance Service (MozillaMaintenance);
Net.Tcp Port Sharing Service (NetTcpPortSharing);
NVIDIA Display Container LS (NVDisplay.ContainerLocalSystem);C
NVIDIA Telemetry Container (NvTelemetryContainer);C
Office  Source Engine (ose);
OpenSSH Authentication Agent (ssh-agent);
OpenSSH SSH Server (sshd);SshdBroker (SshdBroker);E
child;SshdBroker (SshdBroker);
Parental Controls (WpcMonSvc);
Peer Networking Identity Manager (p2pimsvc);Peer Name Resolution Protocol (PNRPsvc);Peer Networking Grouping (p2psvc);E
child;Peer Name Resolution Protocol (PNRPsvc);Peer Networking Grouping (p2psvc);PNRP Machine Name Publication Service (PNRPAutoReg);E
child;Peer Networking Grouping (p2psvc);
child;PNRP Machine Name Publication Service (PNRPAutoReg);
child;Peer Networking Grouping (p2psvc);
Plug and Play (PlugPlay);Logitech Bluetooth Service (LBTServ);EC
child;Logitech Bluetooth Service (LBTServ);
Power (Power);C
PrintWorkflow_8f667 (PrintWorkflowUserSvc_8f667);
Private Internet Access Service (PrivateInternetAccessService);C
Problem Reports and Solutions Control Panel Support (wercplsupport);
Remote Packet Capture Protocol v.0 (experimental) (rpcapd);
Remote Procedure Call (RPC) Locator (RpcLocator);
Retail Demo Service (RetailDemo);
RPC Endpoint Mapper (RpcEptMapper);Remote Procedure Call (RPC) (RpcSs);EC
child;Remote Procedure Call (RPC) (RpcSs);ActiveX Installer (AxInstSV);AVCTP service (BthAvctpSvc);Background Intelligent Transfer Service (BITS);Background Tasks Infrastructure Service (BrokerInfrastructure);Base Filtering Engine (BFE);Bluetooth Audio Gateway Service (BTAGService);Cellular Time (autotimesvc);Certificate Propagation (CertPropSvc);Client License Service (ClipSVC);CNG Key Isolation (KeyIso);COM+ Event System (EventSystem);Connected User Experiences and Telemetry (DiagTrack);CoreMessaging (CoreMessagingRegistrar);Credential Manager (VaultSvc);Cryptographic Services (CryptSvc);Data Usage (DusmSvc);Delivery Optimization (DoSvc);Device Management Enrollment Service (DmEnrollmentSvc);Device Management Wireless Application Protocol (WAP) Push message Routing Service (dmwappushservice);Device Setup Manager (DsmSvc);Diagnostic Execution Service (diagsvc);Display Policy Service (DispBrokerDesktopSvc);Distributed Link Tracking Client (TrkWks);Downloaded Maps Manager (MapsBroker);Dropbox Update Service (dbupdate);Dropbox Update Service (dbupdatem);Encrypting File System (EFS);Enterprise App Management Service (EntAppSvc);File History Service (fhsvc);Function Discovery Provider Host (fdPHost);Geolocation Service (lfsvc);Google Update Service (gupdate);Google Update Service (gupdatem);Group Policy Client (gpsvc);Intel(R) Content Protection HECI Service (cphs);Link-Layer Topology Discovery Mapper (lltdsvc);Local Session Manager (LSM);LxssManager (LxssManager);Microsoft Account Sign-in Assistant (wlidsvc);Microsoft Passport (NgcSvc);Microsoft Passport Container (NgcCtnrSvc);Microsoft Software Shadow Copy Provider (swprv);Microsoft Storage Spaces SMP (smphost);Microsoft Store Install Service (InstallService);Microsoft Windows SMS Router Service. (SmsRouter);Natural Authentication (NaturalAuthentication);Network Connection Broker (NcbService);Network Setup Service (NetSetupSvc);Network Store Interface Service (nsi);Offline Files (CscService);Optimize drives (defragsvc);Payments and NFC/SE Manager (SEMgrSvc);Performance Counter DLL Host (PerfHost);Performance Logs & Alerts (pla);Phone Service (PhoneSvc);Portable Device Enumerator Service (WPDBusEnum);Print Spooler (Spooler);Printer Extensions and Notifications (PrintNotify);Program Compatibility Assistant Service (PcaSvc);Quality Windows Audio Video Experience (QWAVE);Radio Management Service (RmSvc);Recommended Troubleshooting Service (TroubleshootingSvc);Remote Desktop Configuration (SessionEnv);Remote Desktop Services (TermService);Remote Registry (RemoteRegistry);Security Accounts Manager (SamSs);Security Center (wscsvc);Shared PC Account Manager (shpamsvc);Shell Hardware Detection (ShellHWDetection);Smart Card Removal Policy (SCPolicySvc);Software Protection (sppsvc);Spatial Data Service (SharedRealitySvc);State Repository Service (StateRepository);Still Image Acquisition Events (WiaRpc);SysMain (SysMain);System Events Broker (SystemEventsBroker);System Guard Runtime Monitor Broker (SgrmBroker);Telephony (TapiSrv);Touch Keyboard and Handwriting Panel Service (TabletInputService);Update Orchestrator Service (UsoSvc);User Profile Service (ProfSvc);Virtual Disk (vds);Volume Shadow Copy (VSS);Volumetric Audio Compositor Service (VacSvc);Web Management (WebManagement);Wi-Fi Direct Services Connection Manager Service (WFDSConMgrSvc);Windows Audio (Audiosrv);Windows Backup (SDRSVC);Windows Biometric Service (WbioSrvc);Windows Camera Frame Server (FrameServer);Windows Connect Now - Config Registrar (wcncsvc);Windows Defender Antivirus Service (WinDefend);Windows Encryption Provider Host Service (WEPHOSTSVC);Windows Image Acquisition (WIA) (stisvc);Windows Insider Service (wisvc);Windows Installer (msiserver);Windows License Manager Service (LicenseManager);Windows Management Instrumentation (Winmgmt);Windows Management Service (WManSvc);Windows Mobile Hotspot Service (icssvc);Windows Perception Service (spectrum);Windows Perception Simulation Service (perceptionsimulation);Windows Push Notifications System Service (WpnService);Windows PushToInstall Service (PushToInstall);Windows Remote Management (WS-Management) (WinRM);Windows Security Service (SecurityHealthService);Windows Update (wuauserv);Windows Update Medic Service (WaaSMedicSvc);WWAN AutoConfig (WwanSvc);Xbox Live Auth Manager (XblAuthManager);EC
child;ActiveX Installer (AxInstSV);
child;AVCTP service (BthAvctpSvc);C
child;Background Intelligent Transfer Service (BITS);
child;Background Tasks Infrastructure Service (BrokerInfrastructure);Embedded Mode (embeddedmode);Windows Search (WSearch);EC
child;Embedded Mode (embeddedmode);
child;Windows Search (WSearch);Windows Media Player Network Sharing Service (WMPNetworkSvc);Work Folders (workfolderssvc);EC
child;Windows Media Player Network Sharing Service (WMPNetworkSvc);
child;Work Folders (workfolderssvc);
child;Base Filtering Engine (BFE);ESET Firewall Helper (ekrnEpfw);IKE and AuthIP IPsec Keying Modules (IKEEXT);Internet Connection Sharing (ICS) (SharedAccess);IPsec Policy Agent (PolicyAgent);Network Connectivity Assistant (NcaSvc);Routing and Remote Access (RemoteAccess);Windows Defender Antivirus Network Inspection System Driver (WdNisDrv);Windows Defender Firewall (mpssvc);EC
child;ESET Firewall Helper (ekrnEpfw);C
child;IKE and AuthIP IPsec Keying Modules (IKEEXT);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Xbox Live Networking Service (XboxNetApiSvc);
child;Internet Connection Sharing (ICS) (SharedAccess);
child;IPsec Policy Agent (PolicyAgent);C
child;Network Connectivity Assistant (NcaSvc);
child;Routing and Remote Access (RemoteAccess);
child;Windows Defender Antivirus Network Inspection System Driver (WdNisDrv);Windows Defender Antivirus Network Inspection Service (WdNisSvc);E
child;Windows Defender Antivirus Network Inspection Service (WdNisSvc);
child;Windows Defender Firewall (mpssvc);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Xbox Live Networking Service (XboxNetApiSvc);
child;Bluetooth Audio Gateway Service (BTAGService);C
child;Cellular Time (autotimesvc);
child;Certificate Propagation (CertPropSvc);C
child;Client License Service (ClipSVC);
child;CNG Key Isolation (KeyIso);Extensible Authentication Protocol (Eaphost);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Extensible Authentication Protocol (Eaphost);Wired AutoConfig (dot3svc);E
child;Wired AutoConfig (dot3svc);
child;Xbox Live Networking Service (XboxNetApiSvc);
child;COM+ Event System (EventSystem);System Event Notification Service (SENS);EC
child;System Event Notification Service (SENS);COM+ System Application (COMSysApp);Intel(R) HD Graphics Control Panel Service (igfxCUIService2.0.0.0);EC
child;COM+ System Application (COMSysApp);
child;Intel(R) HD Graphics Control Panel Service (igfxCUIService2.0.0.0);C
child;Connected User Experiences and Telemetry (DiagTrack);C
child;CoreMessaging (CoreMessagingRegistrar);C
child;Credential Manager (VaultSvc);C
child;Cryptographic Services (CryptSvc);Application Identity (AppIDSvc);EC
child;Application Identity (AppIDSvc);Smartlocker Filter Driver (applockerfltr);E
child;Smartlocker Filter Driver (applockerfltr);
child;Data Usage (DusmSvc);C
child;Delivery Optimization (DoSvc);C
child;Device Management Enrollment Service (DmEnrollmentSvc);
child;Device Management Wireless Application Protocol (WAP) Push message Routing Service (dmwappushservice);
child;Device Setup Manager (DsmSvc);
child;Diagnostic Execution Service (diagsvc);
child;Display Policy Service (DispBrokerDesktopSvc);C
child;Distributed Link Tracking Client (TrkWks);C
child;Downloaded Maps Manager (MapsBroker);
child;Dropbox Update Service (dbupdate);
child;Dropbox Update Service (dbupdatem);
child;Encrypting File System (EFS);
child;Enterprise App Management Service (EntAppSvc);
child;File History Service (fhsvc);
child;Function Discovery Provider Host (fdPHost);Function Discovery Resource Publication (FDResPub);E
child;Function Discovery Resource Publication (FDResPub);C
child;Geolocation Service (lfsvc);C
child;Google Update Service (gupdate);
child;Google Update Service (gupdatem);
child;Group Policy Client (gpsvc);
child;Intel(R) Content Protection HECI Service (cphs);
child;Link-Layer Topology Discovery Mapper (lltdsvc);
child;Local Session Manager (LSM);C
child;LxssManager (LxssManager);
child;Microsoft Account Sign-in Assistant (wlidsvc);
child;Microsoft Passport (NgcSvc);
child;Microsoft Passport Container (NgcCtnrSvc);
child;Microsoft Software Shadow Copy Provider (swprv);
child;Microsoft Storage Spaces SMP (smphost);
child;Microsoft Store Install Service (InstallService);C
child;Microsoft Windows SMS Router Service. (SmsRouter);
child;Natural Authentication (NaturalAuthentication);
child;Network Connection Broker (NcbService);Connected Devices Platform Service (CDPSvc);EC
child;Connected Devices Platform Service (CDPSvc);C
child;Network Setup Service (NetSetupSvc);
child;Network Store Interface Service (nsi);DHCP Client (Dhcp);DNS Client (Dnscache);IKE and AuthIP IPsec Keying Modules (IKEEXT);IP Translation Configuration Service (IpxlatCfgSvc);Network Connections (Netman);SSDP Discovery (SSDPSRV);Windows Connection Manager (Wcmsvc);Workstation (LanmanWorkstation);EC
child;DHCP Client (Dhcp);Network Location Awareness (NlaSvc);WinHTTP Web Proxy Auto-Discovery Service (WinHttpAutoProxySvc);EC
child;Network Location Awareness (NlaSvc);Network List Service (netprofm);EC
child;Network List Service (netprofm);Microsoft App-V Client (AppVClient);Network Connected Devices Auto-Setup (NcdAutoSetup);EC
child;Microsoft App-V Client (AppVClient);
child;Network Connected Devices Auto-Setup (NcdAutoSetup);C
child;WinHTTP Web Proxy Auto-Discovery Service (WinHttpAutoProxySvc);IP Helper (iphlpsvc);EC
child;IP Helper (iphlpsvc);Network Connectivity Assistant (NcaSvc);EC
child;Network Connectivity Assistant (NcaSvc);
child;DNS Client (Dnscache);debugregsvc (debugregsvc);Network Connectivity Assistant (NcaSvc);Remote Access Connection Manager (RasMan);EC
child;debugregsvc (debugregsvc);
child;Network Connectivity Assistant (NcaSvc);
child;Remote Access Connection Manager (RasMan);Routing and Remote Access (RemoteAccess);EC
child;Routing and Remote Access (RemoteAccess);
child;IKE and AuthIP IPsec Keying Modules (IKEEXT);Xbox Live Networking Service (XboxNetApiSvc);EC
child;Xbox Live Networking Service (XboxNetApiSvc);
child;IP Translation Configuration Service (IpxlatCfgSvc);
child;Network Connections (Netman);
child;SSDP Discovery (SSDPSRV);UPnP Device Host (upnphost);EC
child;UPnP Device Host (upnphost);
child;Windows Connection Manager (Wcmsvc);Windows Mobile Hotspot Service (icssvc);WLAN AutoConfig (WlanSvc);EC
child;Windows Mobile Hotspot Service (icssvc);
child;WLAN AutoConfig (WlanSvc);C
child;Workstation (LanmanWorkstation);Netlogon (Netlogon);Remote Desktop Configuration (SessionEnv);EC
child;Netlogon (Netlogon);
child;Remote Desktop Configuration (SessionEnv);
child;Offline Files (CscService);
child;Optimize drives (defragsvc);
child;Payments and NFC/SE Manager (SEMgrSvc);
child;Performance Counter DLL Host (PerfHost);
child;Performance Logs & Alerts (pla);
child;Phone Service (PhoneSvc);C
child;Portable Device Enumerator Service (WPDBusEnum);
child;Print Spooler (Spooler);Fax (Fax);EC
child;Fax (Fax);
child;Printer Extensions and Notifications (PrintNotify);
child;Program Compatibility Assistant Service (PcaSvc);C
child;Quality Windows Audio Video Experience (QWAVE);
child;Radio Management Service (RmSvc);
child;Recommended Troubleshooting Service (TroubleshootingSvc);
child;Remote Desktop Configuration (SessionEnv);
child;Remote Desktop Services (TermService);Remote Desktop Services UserMode Port Redirector (UmRdpService);E
child;Remote Desktop Services UserMode Port Redirector (UmRdpService);
child;Remote Registry (RemoteRegistry);
child;Security Accounts Manager (SamSs);Distributed Transaction Coordinator (MSDTC);KtmRm for Distributed Transaction Coordinator (KtmRm);Server (LanmanServer);EC
child;Distributed Transaction Coordinator (MSDTC);
child;KtmRm for Distributed Transaction Coordinator (KtmRm);
child;Server (LanmanServer);C
child;Security Center (wscsvc);C
child;Shared PC Account Manager (shpamsvc);
child;Shell Hardware Detection (ShellHWDetection);C
child;Smart Card Removal Policy (SCPolicySvc);C
child;Software Protection (sppsvc);
child;Spatial Data Service (SharedRealitySvc);
child;State Repository Service (StateRepository);AppX Deployment Service (AppXSVC);EC
child;AppX Deployment Service (AppXSVC);
child;Still Image Acquisition Events (WiaRpc);
child;SysMain (SysMain);C
child;System Events Broker (SystemEventsBroker);Task Scheduler (Schedule);EC
child;Task Scheduler (Schedule);Natural Authentication (NaturalAuthentication);EC
child;Natural Authentication (NaturalAuthentication);
child;System Guard Runtime Monitor Broker (SgrmBroker);C
child;Telephony (TapiSrv);Fax (Fax);E
child;Fax (Fax);
child;Touch Keyboard and Handwriting Panel Service (TabletInputService);C
child;Update Orchestrator Service (UsoSvc);C
child;User Profile Service (ProfSvc);Application Information (Appinfo);Natural Authentication (NaturalAuthentication);Shared PC Account Manager (shpamsvc);User Manager (UserManager);EC
child;Application Information (Appinfo);B
child;Natural Authentication (NaturalAuthentication);
child;Shared PC Account Manager (shpamsvc);
child;User Manager (UserManager);Web Account Manager (TokenBroker);Xbox Live Game Save (XblGameSave);EC
child;Web Account Manager (TokenBroker);C
child;Xbox Live Game Save (XblGameSave);
child;Virtual Disk (vds);
child;Volume Shadow Copy (VSS);
child;Volumetric Audio Compositor Service (VacSvc);
child;Web Management (WebManagement);
child;Wi-Fi Direct Services Connection Manager Service (WFDSConMgrSvc);
child;Windows Audio (Audiosrv);C
child;Windows Backup (SDRSVC);
child;Windows Biometric Service (WbioSrvc);C
child;Windows Camera Frame Server (FrameServer);
child;Windows Connect Now - Config Registrar (wcncsvc);C
child;Windows Defender Antivirus Service (WinDefend);
child;Windows Encryption Provider Host Service (WEPHOSTSVC);
child;Windows Image Acquisition (WIA) (stisvc);C
child;Windows Insider Service (wisvc);
child;Windows Installer (msiserver);
child;Windows License Manager Service (LicenseManager);C
child;Windows Management Instrumentation (Winmgmt);IP Helper (iphlpsvc);EC
child;IP Helper (iphlpsvc);Network Connectivity Assistant (NcaSvc);EC
child;Network Connectivity Assistant (NcaSvc);
child;Windows Management Service (WManSvc);
child;Windows Mobile Hotspot Service (icssvc);
child;Windows Perception Service (spectrum);
child;Windows Perception Simulation Service (perceptionsimulation);
child;Windows Push Notifications System Service (WpnService);C
child;Windows PushToInstall Service (PushToInstall);
child;Windows Remote Management (WS-Management) (WinRM);
child;Windows Security Service (SecurityHealthService);C
child;Windows Update (wuauserv);
child;Windows Update Medic Service (WaaSMedicSvc);
child;WWAN AutoConfig (WwanSvc);Local Profile Assistant Service (wlpasvc);E
child;Local Profile Assistant Service (wlpasvc);
child;Xbox Live Auth Manager (XblAuthManager);Xbox Live Game Save (XblGameSave);E
child;Xbox Live Game Save (XblGameSave);
Secondary Logon (seclogon);
Secure Socket Tunneling Protocol Service (SstpSvc);Remote Access Connection Manager (RasMan);EC
child;Remote Access Connection Manager (RasMan);Routing and Remote Access (RemoteAccess);EC
child;Routing and Remote Access (RemoteAccess);
Sensor Data Service (SensorDataService);
Sensor Monitoring Service (SensrSvc);
Sensor Service (SensorService);
Smart Card (SCardSvr);
Smart Card Device Enumeration Service (ScDeviceEnum);
SNMP Trap (SNMPTRAP);
Spot Verifier (svsvc);
Steam Client Service (Steam Client Service);
Storage Service (StorSvc);C
Storage Tiers Management (TieringEngineService);
Sync Host_8f667 (OneSyncSvc_8f667);C
Themes (Themes);C
Time Broker (TimeBrokerSvc);C
User Data Access_8f667 (UserDataSvc_8f667);C
User Data Storage_8f667 (UnistoreSvc_8f667);C
User Experience Virtualization Service (UevAgentService);
Visual Studio Standard Collector Service 150 (VSStandardCollectorService150);
WalletService (WalletService);
WarpJITSvc (WarpJITSvc);
Windows Audio Endpoint Builder (AudioEndpointBuilder);Windows Audio (Audiosrv);EC
child;Windows Audio (Audiosrv);C
Windows Defender Advanced Threat Protection Service (Sense);
Windows Error Reporting Service (WerSvc);
Windows Event Log (EventLog);Network Location Awareness (NlaSvc);Windows Event Collector (Wecsvc);EC
child;Network Location Awareness (NlaSvc);C
child;Windows Event Collector (Wecsvc);
Windows Font Cache Service (FontCache);C
Windows Modules Installer (TrustedInstaller);
Windows Phone IP over USB Transport (IpOverUsbSvc);C
Windows Presentation Foundation Font Cache 3.0.0.0 (FontCache3.0.0.0);C
Windows Push Notifications User Service_8f667 (WpnUserService_8f667);C
Windows Time (W32Time);
WMI Performance Adapter (wmiApSrv);
Xbox Accessory Management Service (XboxGipSvc);
After you have saved the "ServicesTree.txt" file (and placed it in the same folder as your example ahk script), run the example script and click the [Load Layout] button.

In the above example code you can use the context menu to delete entries and then use the buttons to save/load the result.

I hope someone can find this useful :-)

EDIT: If you have specific questions or example requests, post a reply and I'll do my best to elaborate.
Last edited by TheArkive on 20 Sep 2019, 08:56, edited 3 times in total.
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

13 Sep 2019, 08:59

Thanks for the code, I think it could be quite useful!
Q: The format in the .txt file, is it kind of standard or did you invent it for that purpose?

I noticed in the LoadTree() function there should be better:

Code: Select all

    . . . 
    Gui, TreeView, %sTreeName%
    GuiControl, -Redraw, %sTreeName%
    TV_Delete()
    . . .
to delete faster (if the tree is large).

I had the below code already written so I post it too to make your example a bit more elaborated
Spoiler
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

13 Sep 2019, 18:02

rommmcek wrote:
13 Sep 2019, 08:59
Thanks for the code, I think it could be quite useful!
Q: The format in the .txt file, is it kind of standard or did you invent it for that purpose?
I came up with that format just for this purpose. Since the ID's can't be replicated in a different instance of another TreeView, the structure has to be read down in a way that perfectly preserves the structure, so that duplicate values are also reinstated if they exist at any point in the tree.
rommmcek wrote:
13 Sep 2019, 08:59
I noticed in the LoadTree() function there should be better:

Code: Select all

    . . . 
    Gui, TreeView, %sTreeName%
    GuiControl, -Redraw, %sTreeName%
    TV_Delete()
    . . .
to delete faster (if the tree is large).
Yep, I actually had that in there, but I decided to leave it out and do that manually outside the function. There are instances where someone might not want to do that. I just wanted to keep it as simple as possible so people could do as they wish with it.
rommmcek wrote:
13 Sep 2019, 08:59
I had the below code already written so I post it too to make your example a bit more elaborated
Spoiler
Thanks for posting! That will be a good addition to help people with more examples.
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

14 Sep 2019, 05:26

On line 127 and 128, the following can be added to skip out on blank lines. This is mostly for lines that have nothing on them such as a trailing newline at the end of a file or maybe an empty space.

Code: Select all

126		...
127		If (CurLine == "")
128			Continue
129		...
TL;DR: this just skips empty lines.
I would add a way to have comments in the file to read and skip over, as well as a way to read custom files, but I'm too lazy at the moment.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

14 Sep 2019, 07:34

Delta Pythagorean wrote:
14 Sep 2019, 05:26
I would add a way to have comments in the file to read and skip over...
Skipping comments with ";" "#" or "//" is easy enough. What wold be the point though? The format of the file is linear, but the data expresses a structure that is NOT linear. Unless the comments are up top to try and explain something about the content, I don't really see how that would be helpful. How would you use that featue?
Delta Pythagorean wrote:
14 Sep 2019, 05:26
as well as a way to read custom files...
As for reading custom files, the only way to change the parsing and yet keep the accuracy that currently exists in my function, is to just change the separators, that's it. Constructing a parser for another completely different format is its own challenge. What kind of "custom formats" did you have in mind?
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

14 Sep 2019, 13:12

Comments or just empty lines would improve readability of ServiceTree data for sure. The problem is that current code can't keep them after saving. I was thinking about escape character too (for strings with semicolons), but that is not so important.

Here is Ahk site service tree.
Spoiler
The idea is to launch sites from tree. Any time saving idea?
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

14 Sep 2019, 23:36

rommmcek wrote:
14 Sep 2019, 13:12
Comments or just empty lines would improve readability of ServiceTree data for sure.
The data in that file isn't really meant to be ready by human eyes. It's like a binary data file, it's read by a computer / script / program.
rommmcek wrote:
14 Sep 2019, 13:12
The idea is to launch sites from tree. Any time saving idea?
Ok now I understand what you are asking. The problem there is that you cannot attach other attributes to each node. The only attributes I know of for each node are [expanded, checked, bold]. That is a limitation of the basic AutoHotkey GUI syntax. I have 3 thoughts for now:
  1. redo the name of each node like this: node (url)
  2. have a spearate list/catalog that is able to match an item to a URL, capture on single or double click
  3. redo node name like this: node (X) --- X would be a number or arbitrary code to be matched in a catalog/list
So the tree nodes are like this:

Code: Select all

node (http:URL1)
    node (http:URL2)
    
    ------- or ------- 

node 1 (ABC)
    node 2 (DEF)
    
list/catalog:

ABC = URL1
DEF = URL2
...
Capture item/node name on event (single / double click). Then parse the node with "(" as a separator and isolate URL or code/ID. If using code/ID then parse the list/catalog for code/ID match. Would you like a code example of some of these?

I'm afraid my save/load functions can't help with your question. You are talking about a different problem - ie. putting more data in the tree, and processing events (single / double click, or other keyboard events). But if you find a way to put that data in the tree, my save/load script would still be able to save it.
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

15 Sep 2019, 04:26

Thanks for explanation! Now I think I get it. I tried to save tree structure from Ahk Example and your function works great!

Thanks for Ideas too, but don't bother with the exemple, I have to figure it out by myself!
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

16 Sep 2019, 01:59

rommmcek wrote:
15 Sep 2019, 04:26
Thanks for explanation! Now I think I get it. I tried to save tree structure from Ahk Example and your function works great!

Thanks for Ideas too, but don't bother with the exemple, I have to figure it out by myself!
No problem! Glad I could help.

I almost forgot ... try not to put a semicolon (";") in your data. It is used as a separator in the save data. I'll have to see if I can come up with better separators to use that don't exclude any printable text.
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

16 Sep 2019, 11:45

Here is my first attempt for launching Ahk sites via Tree structure (only for Bold Items).
Ready to run script
Supports launching via double click or menu.

P.s: Not happy with double click, cause it interferes with TreeView expand/collapse feature.
Edit: Updated the script to preserve TreeView state after launching the site.
Last edited by rommmcek on 17 Sep 2019, 02:08, edited 1 time in total.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

16 Sep 2019, 18:58

rommmcek wrote:
16 Sep 2019, 11:45
P.s: Not happy with double click, cause it interferes with TreeView expand/collapse feature.
You can force a re-expand with TV_Modify(ID,"Expand Vis") ... or something like that. I've done that on one of my scripts. A little messy, but works.
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

17 Sep 2019, 02:02

I actually came up with this:

Code: Select all

        if IsExpanded := TV_Get(A_EventInfo,"E")
            TV_Modify(A_EventInfo, "-Expand")
        else TV_Modify(A_EventInfo, "Expand")
but it didn't work if doubleClick occurred on +/- sign.
Your one liner works just fine!!!

Launching sites from TreeView is for me very useful especially for very branched sites. With some initial work it offers great overview and easy launching of desired site/subsite for any (default) browser!

Thank you for your functions and for guiding me towards my goal!

P.s.: Updated example above.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Save/Load a TreeView and save Check/Bold/Expanded attributes for each node

23 May 2022, 03:42

@TheArkive - Congratz for :clap: 888 :clap: postings at the AHK Forum :mrgreen: :thumbup:

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 110 guests