//
// The function of this dialog is to show as much system information available
//
Use LanguageText.Pkg                   // Translation strings

#IFSAME Language$Current Language$English
    Use SysInfo_Language_English.Inc
#ENDIF

#IFSAME Language$Current Language$Nederlands
    Use SysInfo_Language_Nederlands.inc
#ENDIF

#IFSAME Language$Current Language$Svenska
    Use SysInfo_Language_Svenska.inc
#ENDIF

#IFSAME Language$Current Language$Deutsch
    Use SysInfo_Language_Deutsch.inc
#ENDIF

#IFSAME Language$Current Language$Dansk
    Use SysInfo_Language_Dansk.inc
#ENDIF

#IFSAME Language$Current Language$Portugues
    Use SysInfo_Language_Portugues.inc
#ENDIF

#IFSAME Language$Current Language$Francais
    Use SysInfo_Language_Francais.inc
#ENDIF

#IFSAME Language$Current Language$Italiano
    Use SysInfo_Language_Italiano.inc
#ENDIF

Use cVersionInfo.Pkg                   // Version Information functions
Use GetUserName.Pkg                    // GetUserName WinAPI function definition
Use PathFindExtension.Pkg              // PathFindExtension WinAPI function definition
Use PathIsDirectory.Pkg                // PathIsDirectory WinAPI function definition
Use Seq_Chnl.Pkg                       // Sequential channel functions
Use FleXML.Pkg                         // Interface to XML
Use GlobalMemoryStatus.Pkg             // GlobalMemoryStatus WinAPI function definition
Use GetKeyboardType.Pkg                // GetKeyboardType WinAPI function definition
Use GetKeyboardLayoutName.Pkg          // GetKeyboardLayoutName WinAPI function definition
Use GetUserDefaultLangID.Pkg           // GetUserDefaultLangID WinAPI function definition
Use WindowsLocale.Pkg                  // Functions to get various Windows locale information
Use GetSystemDirectory.Pkg             // GetSystemDirectory WinAPI function definition
Use GetTempPath.Pkg                    // GetTempPath WinAPI function definition
Use GetProfilesDirectory.Pkg           // GetProfilesDirectory WinAPI function definition
Use GetAllUsersProfileDirectory.Pkg    // GetAllUsersProfileDirectory WinAPI function definition
Use GetDefaultUserProfileDirectory.Pkg // GetDefaultUserProfileDirectory WinAPI function definition
Use GetShortPathName.Pkg               // GetShortPathName WinAPI function definition
Use GetLongPathName.Pkg                // GetLongPathName WinAPI function definition
Use GetComputerName.Pkg                // GetComputerName WinAPI function definition
Use GetDoubleClickTime.Pkg             // GetDoubleClickTime WinAPI function definition
Use GetLogicalDriveStrings.Pkg         // GetLogicalDriveStrings WinAPI function definition
Use GetDriveType.Pkg                   // GetDriveType WinAPI function definition
Use GetCalendarInfo.Pkg                // GetCalendarInfo WinAPI function definition
Use EnumProcessModules.Pkg             // Functions to enumerate the process modules
Use WinShell.Pkg                       // Path Functions; PathRemoveFileSpec, PathRemoveExtension, PathIsRelative, PathFileExists
//AB-StoreTopEnd

//AB-IgnoreStart

Use DfTreeVw.pkg


//AB-IgnoreEnd

Object oSystemInformationDialog is a ModalPanel
    Set Border_Style to Border_Thick
    Set Label to "System Information"
    // Visual DataFlex 14.0 Client Size Adjuster, modified May 7, 2008: 13:11:33
//    Set Size to 191 343
    Set Size to 174 341
    Set Location to 7 45

    //AB-DDOStart


    //AB-DDOEnd

    Object oBox is a Container3d
        Set Size to 150 330
        Set Location to 5 5
        Set peAnchors to anAll
        Set Border_Style to Border_StaticEdge
        Object oSystemInfoImageList is a cImageList
            Set Location to 26 147
            Set piMaxImages to 3

            //AB-StoreStart
            // Define three values to point to the loaded bitmaps
            Enum_List
                Define tvSysInfoBookOpenBmp
                Define tvSysInfoBookClosedBmp
                Define tvSysInfoItemBmp
            End_Enum_List
            
            // When the imagelist is being created we need to load the bitmaps used
            Procedure OnCreate
                Integer iIndex
            
                Get AddTransparentImage "SysInfo.Bmp" clFuchsia to iIndex
                If (iIndex = -1) Begin
                    Error DFERR_OPERATOR (SFormat (C_$CanNotLoadBitmap, "SysInfo.Bmp"))
                End
            End_Procedure // OnCreate
            //AB-StoreEnd

        End_Object    // oSystemInfoImageList

        Object oSystemInfoTreeView is a TreeView
            Set peAnchors to anAll
            Set Size to 140 320
            Set Location to 5 5

            //AB-StoreStart
            // Connect the imagelist object to this treeview
            Set ImageListObject to oSystemInfoImageList
            
            // Keep a property that holds the current root underwhich new treeview items are created
            Property Handle phCurrentRoot
            
            // Create a list of information branch and item specific identifiers
            Enum_List
                Define tiSysInfoUserBranch
                Define tiSysInfoUserBranchItem
                Define tiSysWindowsLocaleBranch
                Define tiSysWindowsLocaleBranchItem
                Define tiSysInfoDataBaseDriversBranch
                Define tiSysInfoDataBaseDriversBranchItem
                Define tiSysInfoVersionBranch
                Define tiSysInfoVersionBranchItem
                Define tiSysInfoVersionsOfBinDirBranch
                Define tiSysInfoVersionsEnumeratedModulesDirBranch
                Define tiSysInfoWorkSpaceBranch
                Define tiSysInfoWorkSpaceBranchItem
                Define tiSysInfoMemoryBranch
                Define tiSysInfoMemoryBranchItem
                Define tiSysInfoFilesDirBranch
                Define tiSysInfoFilesDirBranchItem
                Define tiSysInfoKeyboardBranch
                Define tiSysInfoKeyboardBranchItem
                Define tiSysInfoAccKeysBranch
                Define tiSysInfoAccKeysBranchItem
                Define tiSysInfoRegistrationBranch
                Define tiSysInfoRegistrationBranchItem
                Define tiSysInfoDataBaseServersBranch
                Define tiSysInfoDataBaseServersBranchItem
                Define tiSysInfoGlobalAttributesBranch
                Define tiSysInfoGlobalAttributesBranchItem
                Define tiSysInfoGlobalVariablesBranch
                Define tiSysInfoGlobalVariablesBranchItem
                Define tiSysInfoSystemMetricsBranch
                Define tiSysInfoSystemMetricsBranchItem
                Define tiSysInfoSysConfBranch
                Define tiSysInfoSysConfBranchItem
                Define tiSysInfoDataFilesBranch
                Define tiSysInfoDataFilesFilesBranch
                Define tiSysInfoDataFilesAttributesBranch
                Define tiSysInfoDataFilesFieldsBranch
                Define tiSysInfoDataFilesIndexesBranch
                Define tiSysInfoDataFilesBranchItem
                Define tiSysInfoApplicationBranch
                Define tiSysInfoApplicationBranchItem
            End_Enum_List
            
            // When a root item is created we will fake the treeview by telling there are childitems. This
            // way the tree can be build stepwise and not all on opening this dialog (making sysinfo quite slow)
            Procedure DoAddTreeRootItem String sText Integer iItemData Integer iImage Integer iSelectedImage
                Handle hItem
            
                Get AddTreeItem sText 0 iItemData iImage iSelectedImage to hItem
                Set ItemChildCount hItem to 1
            End_Procedure // DoAddTreeRootItem
            
            // When the treeview is created add a number of root items to explore
            Procedure OnCreateTree
                Forward Send OnCreateTree
            
                Send DoAddTreeRootItem C_$WorkSpace tiSysInfoWorkSpaceBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$Application tiSysInfoApplicationBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$DatabaseDrivers tiSysInfoDataBaseDriversBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$Versions tiSysInfoVersionBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$Memory tiSysInfoMemoryBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$Paths tiSysInfoFilesDirBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$KeyBoard tiSysInfoKeyboardBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$AcceleratorKeys tiSysInfoAccKeysBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$Registration tiSysInfoRegistrationBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$User tiSysInfoUserBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$WindowsLocale tiSysWindowsLocaleBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$GlobalAttributes tiSysInfoGlobalAttributesBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$GlobalVariables tiSysInfoGlobalVariablesBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$SystemMetrics tiSysInfoSystemMetricsBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                Send DoAddTreeRootItem C_$SystemConfiguration tiSysInfoSysConfBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
                // AKE - Fjernet.
                // Send DoAddTreeRootItem C_$DataFiles tiSysInfoDataFilesBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp
            End_Procedure // OnCreateTree
            
            // This method will be called when the workspace object information is being enumerated. When
            // empty data is returned we skip the creation of treeview items
            Procedure DoAddWorkSpaceItems String sText
                Handle hItem
            
                If (sText <> "") Begin
                    Get phCurrentRoot to hItem
                    Get AddTreeItem sText hItem tiSysInfoWorkSpaceBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hItem
                End
            End_Procedure // DoAddWorkSpaceItems

            // AKE - Removes the index with a PSW parameter if present.
            Function RemovePassword String sServerName Returns String
                String sRetVal
                Integer iFromPos iToPos
                Move (Pos("PWD=", sServerName)) to iFromPos
                If (iFromPos = 0) Function_Return sServerName
                Move (Left(sServerName, iFromPos - 1)) to sRetVal
                Move (Mid(sServerName, Length(sServerName), iFromPos)) to sServerName
                Move (Pos(";", sServerName)) to iToPos
                If (iToPos > 0) Move (sRetVal + Mid(sServerName, Length(sServerName), iToPos + 1)) to sRetVal
                Function_Return sRetVal
            End_Function
            
            // Add information about the number of drivers loaded and (if applicable) to which servers the drivers
            // are used.
            Procedure DoAddDriversInfo
                String sDriverName sServerName
                Handle hItem hVoid hDriversRoot
                Integer iNumberOfDrivers iDriverNum iNumberOfServers iServerNum
            
                Get phCurrentRoot to hItem
            
                Get_Attribute DF_NUMBER_DRIVERS to iNumberOfDrivers
                For iDriverNum From 1 to iNumberOfDrivers
                    Get_Attribute DF_DRIVER_NAME of iDriverNum to sDriverName
                    If (sDriverName <> "") Begin
                        Get AddTreeItem sDriverName hItem tiSysInfoDataBaseDriversBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        If (sDriverName <> "DATAFLEX") Begin
                            Get_Attribute DF_DRIVER_NUMBER_SERVERS of iDriverNum to iNumberOfServers
                            If (iNumberOfServers > 0) Begin
                                Get AddTreeItem C_$Servers hItem tiSysInfoDataBaseServersBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hDriversRoot
                                If (hDriversRoot <> 0) Begin
                                    For iServerNum From 1 to iNumberOfServers
                                        Get_Attribute DF_DRIVER_SERVER_NAME of iDriverNum iServerNum to sServerName
                                        Get RemovePassword sServerName to sServerName   // AKE
                                        Get AddTreeItem sServerName hDriversRoot tiSysInfoDataBaseServersBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                                    Loop
                                End
                            End
                        End
                    End
                Loop
            End_Procedure // DoAddDriversInfo
            
            // Add version information stored in the runtime, registry and files from the bindirectory
            Procedure DoAddVersionInfo
                Handle hRoot hVoid
                Integer iVersionMajor iVersionMinor iVersionRelease
                String sVdfServicePackVersion
            
                Version_Information iVersionMajor iVersionMinor iVersionRelease
                Get_Profile_String "" "CurrentVersionDescription" to sVdfServicePackVersion
            
                Get phCurrentRoot to hRoot
            
                Get AddTreeItem (SFormat (C_$RuntimeVersion, String (iVersionMajor) - "." - String (iVersionMinor) - "." - String (iVersionRelease))) hRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$PackageVersion, String (PKG_VERSION) - "." - String (PKG_REVISION) - "." - String (PKG_BUILD))) hRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$FMACVersion, String (FMAC_VERSION) - "." - String (FMAC_REVISION) - "." - String (FMAC_BUILD))) hRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$ServicePack, sVdfServicePackVersion)) hRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Send DoAddBinFiles hRoot
                Send DoAddModuleNamesRoot hRoot
            End_Procedure // DoAddVersionInfo
            
            Procedure DoAddModuleNamesRoot Handle hRootItem
                Handle hTvRoot
            
                Get AddTreeItem C_$ModuleNames hRootItem tiSysInfoVersionsEnumeratedModulesDirBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hTvRoot
                Set ItemChildCount hTvRoot to 1
            End_Procedure // DoAddModuleNamesRoot
            
            Procedure DoAddModuleNames Handle hRootItem
                Integer hoProcessModulesArray iModules iModule hoVersionInfo
                Boolean bOk
                String sModuleName sDirectoryName
            
                Get Create U_cProcessModulesArray to hoProcessModulesArray
                If (hoProcessModulesArray <> 0) Begin
                    Send DoEnumProcessModules of hoProcessModulesArray
                    Move (Item_Count (hoProcessModulesArray) - 1) to iModules
                    If (iModules >= 0) Begin
                        Get Create U_cVersionInfo to hoVersionInfo
                        If (hoVersionInfo <> 0) Begin
                            Move (Item_Count (hoProcessModulesArray) - 1) to iModules
                            For iModule From 0 to iModules
                                Get String_Value of hoProcessModulesArray Item iModule to sModuleName
                                If (sModuleName <> "") Begin
                                    Move sModuleName to sDirectoryName
                                    Move (ExtractFileName (sModuleName)) to sModuleName
                                    Move (PathRemoveFileSpec (AddressOf (sDirectoryName))) to bOk
                                    Move (CString (sModuleName)) to sModuleName
                                    Move (CString (sDirectoryName)) to sDirectoryName
                                    Send DoAddFile hoVersionInfo sDirectoryName sModuleName hRootItem True
                                End
                            Loop
                            Send Destroy of hoVersionInfo
                        End
                    End
                    Send Destroy of hoProcessModulesArray
                End
            End_Procedure // DoAddModuleNames
            
            // This method is called for each file found in a specific directory
            // The file and path are separated specified because we don't want to duplicate the path on each
            // entry in the treeview (too much information)
            Procedure DoAddFile Integer hoVersionInfo String sDirName String sFileName Handle hTvRoot Boolean bShowDirectory
                String sFullFileName sFileDate sFileHour sFileMinute sFileSecond sVersion sFileDateTime
                DateTime dtFileDateTime
                Integer iVersionMajor iVersionMinor iVersionRelease iVersionBuild
                Boolean bIncluded
                Handle hVoid
            
                Move (Trim (sDirName)) to sDirName
                Move (Trim (sFileName)) to sFileName
                If (Right (sDirName, 1) <> SysConf (Sysconf_Dir_Separator)) Begin
                    Move (sDirName - SysConf (Sysconf_Dir_Separator)) to sDirName
                End
                Move (sDirName - sFileName) to sFullFileName
            
                Get_File_Mod_Time sFullFileName to sFileDate sFileHour sFileMinute sFileSecond
                Move sFileDate to dtFileDateTime
                Move (DateSetHour (dtFileDateTime, sFileHour)) to dtFileDateTime
                Move (DateSetMinute (dtFileDateTime, sFileMinute)) to dtFileDateTime
                Move (DateSetSecond (dtFileDateTime, sFileSecond)) to dtFileDateTime
                Move dtFileDateTime to sFileDateTime
            
                Send DoCreate of hoVersionInfo sFullFileName
            
                Get pbIncluded of hoVersionInfo to bIncluded
                If (bIncluded) Begin
                    Get piVersionMajor of hoVersionInfo to iVersionMajor
                    Get piVersionMinor of hoVersionInfo to iVersionMinor
                    Get piVersionRelease of hoVersionInfo to iVersionRelease
                    Get piVersionBuild of hoVersionInfo to iVersionBuild
                    Move (SFormat ("%1.%2.%3.%4", iVersionMajor, iVersionMinor, iVersionRelease, iVersionBuild)) to sVersion
                    If (bShowDirectory) Begin
                        Get AddTreeItem (sFullFileName - ":" * sVersion * "(" - sFileDateTime - ")") hTvRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    End
                    Else Begin
                        Get AddTreeItem (sFileName - ":" * sVersion * "(" - sFileDateTime - ")") hTvRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    End
                End
                Else Begin
                    If (bShowDirectory) Begin
                        Get AddTreeItem (sFullFileName - ": 0.0.0.0 (" - sFileDateTime - ")") hTvRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    End
                    Else Begin
                        Get AddTreeItem (sFileName - ":" * sVersion * "(" - sFileDateTime - ")") hTvRoot tiSysInfoVersionBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    End
                End
            End_Procedure // DoAddFile
            
            // Add an entry to the treeview to make it possible for the user to explore the
            // files from the DataFlex bin directory (specified by VDFROOTDIR).
            Procedure DoAddBinFiles Handle hTvRoot
                String sVdfRootDir
            
                Get_Profile_String "Defaults" "VdfRootDir" to sVdfRootDir
                Move (Trim (sVdfRootDir)) to sVdfRootDir
                If (Right (sVdfRootDir, 1) <> SysConf (Sysconf_Dir_Separator)) Begin
                    Move (sVdfRootDir - SysConf (Sysconf_Dir_Separator)) to sVdfRootDir
                End
                Move (sVdfRootDir - "Bin") to sVdfRootDir
                If (PathIsDirectory (Self, sVdfRootDir)) Begin
                    Get AddTreeItem (SFormat (C_$FilesFrom, sVdfRootDir)) hTvRoot tiSysInfoVersionsOfBinDirBranch tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hTvRoot
                    Set ItemChildCount hTvRoot to 1
                End
            End_Procedure // DoAddBinFiles
            
            // This method will be called when the user clicks on the entry "files from..."
            Procedure DoAddBinFilesInfo
                Handle hRoot
                Integer iChannel hoVersionInfo
                String sVdfRootDir sDirEntry sExtension sInputDirMask
            
                Get phCurrentRoot to hRoot
            
                Get Seq_New_Channel to iChannel
                If (iChannel >= DF_SEQ_CHANNEL_MIN and iChannel <= DF_SEQ_CHANNEL_MAX) Begin
                    Send Cursor_Wait of Cursor_Control
                    Get Create U_cVersionInfo to hoVersionInfo
                    Get ItemLabel hRoot to sVdfRootDir
                    Move (Trim (Right (sVdfRootDir, Length (sVdfRootDir) - Pos (":", sVdfRootDir)))) to sVdfRootDir
                    Move ("DIR:" - sVdfRootDir - "\*.*") to sInputDirMask
                    Direct_Input Channel iChannel sInputDirMask
                    While (not (Seqeof))
                        Readln Channel iChannel sDirEntry
                        If (not (Seqeof) and Left (sDirEntry, 1) <> "[") Begin
                            Get PathFindExtension sDirEntry to sExtension
                            If (".DLL.EXE.DRV" Contains Uppercase (sExtension)) Begin
                                Send DoAddFile hoVersionInfo sVdfRootDir sDirEntry hRoot False
                            End
                        End
                    End
                    Close_Input Channel iChannel
                    Send Destroy of hoVersionInfo
                    Send Seq_Release_Channel iChannel
                    Send Cursor_Ready of Cursor_Control
                End
            End_Procedure // DoAddBinFilesInfo
            
            // Add information about the amount of available memory and the usage according to windows
            Procedure DoAddMemoryInfo
                String sMemoryStatus
                Integer iVoid iMemAvail
                DWord dwMemoryLoad dwTotalPhys dwAvailPhys dwTotalPageFile dwAvailPageFile dwTotalVirtual dwAvailVirtual
                Handle hItem hVoid
            
                Get phCurrentRoot to hItem
            
                ZeroType MEMORYSTATUS to sMemoryStatus
                Put MEMORYSTATUS_Size to sMemoryStatus At MEMORYSTATUS.dwLength
            
                Move (WinAPI_GlobalMemoryStatus (AddressOf (sMemoryStatus))) to iVoid
            
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwMemoryLoad to dwMemoryLoad
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwTotalPhys to dwTotalPhys
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwAvailPhys to dwAvailPhys
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwTotalPageFile to dwTotalPageFile
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwAvailPageFile to dwAvailPageFile
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwTotalVirtual to dwTotalVirtual
                GetBuff From sMemoryStatus At MEMORYSTATUS.dwAvailVirtual to dwAvailVirtual
            
                Get AddTreeItem (SFormat (C_$MemoryUtilization, dwMemoryLoad)) hItem tiSysInfoMemoryBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AvailablePhysicalMemory, dwAvailPhys / dwTotalPhys * 100.0)) hItem tiSysInfoMemoryBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AvailablePagefileSpace, dwAvailPageFile / dwTotalPageFile * 100.0)) hItem tiSysInfoMemoryBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AvailableVirtualMemory, dwAvailVirtual / dwTotalVirtual * 100.0)) hItem tiSysInfoMemoryBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Memory iMemAvail
                Get AddTreeItem (SFormat (C_$AvailableMemoryBytes, iMemAvail)) hItem tiSysInfoMemoryBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddMemoryInfo
            
            // This method fills the treeview with information about the current directory, the windows directory
            // and the current filelist. Especially usefull when there is no use of workspaces
            Procedure DoAddFilesAndDirInfo
                String sDirectory sFilename sLogicalDrivesString sDriveId
                Integer iLogicalDrivesStringLength iDriveNum iDriveType
                Handle hItem hVoid hChildItem
            
                Get phCurrentRoot to hItem
            
                Get_Current_Directory to sDirectory
                Get AddTreeItem C_$WindowsCurrentDirectory hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get_Windows_Directory to sDirectory
                Get AddTreeItem C_$WindowsBaseDirectory hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get GetSystemDirectory to sDirectory
                Get AddTreeItem C_$SystemDirectory hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get GetTempPath to sDirectory
                Get AddTreeItem C_$TempPath hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                If (PathIsDirectory (Self, sDirectory)) Begin
                    Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
                Else Begin
                    Get AddTreeItem (SFormat (C_$NotValidDirectory, sDirectory)) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
            
                If (SysConf (SYSCONF_OS_MAJOR_REV) >= 5) Begin
                    Get AddTreeItem C_$ProfilesDirectory hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                    Get GetProfilesDirectory to sDirectory
                    Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                    Get AddTreeItem C_$AllUsersProfileDirectory hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                    Get GetAllUsersProfileDirectory to sDirectory
                    Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                    Get AddTreeItem C_$DefaultUserProfileDirectory hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                    Get GetDefaultUserProfileDirectory to sDirectory
                    Get AddTreeItem sDirectory hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sDirectory))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
            
                Get AddTreeItem C_$CurrentFilelistCFG hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                Get_Attribute Df_Filelist_Name to sFilename
                Get AddTreeItem sFilename hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameShort, GetShortPathName (Self, sFilename))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirNameLong, GetLongPathName (Self, sFilename))) hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem C_$LogicalDrives hItem tiSysInfoFilesDirBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildItem
                Get VO_GetLogicalDriveStrings to sLogicalDrivesString
                Move (Length (sLogicalDrivesString)) to iLogicalDrivesStringLength
                For iDriveNum From 1 to iLogicalDrivesStringLength
                    Move (Mid (sLogicalDrivesString, 3, iDriveNum)) to sDriveId
                    Get GetDriveType sDriveId to iDriveType
                    Get AddTreeItem (sDriveId * "(" - DriveType2Descr(Self, iDriveType) - ")") hChildItem tiSysInfoFilesDirBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Move (iDriveNum + 3) to iDriveNum 
                Loop
            End_Procedure // DoAddFilesAndDirInfo
            
            // This method finds out what kind of keyboard is attached, how many functionkeys are available
            // and what the name of keyboard layout is.
            Procedure DoAddKeyboardInfo
                Integer iKeyboardType
                String sKeyBoardType
                Handle hRoot hVoid
            
                Get phCurrentRoot to hRoot
            
                Move (GetKeyboardType (Self, Keyboard_Type)) to iKeyboardType
                Case Begin
                    Case (iKeyboardType = IBM_PC_XT_Or_Compatible_Keyboard)
                        Move C_$IBMPCXTCompatibleKeyboard to sKeyBoardType
                        Case Break
                    Case (iKeyboardType = Olivetti_ICO_Keyboard)
                        Move C_$OlivettiICOKeyboard to sKeyBoardType
                        Case Break
                    Case (iKeyboardType = IBM_PC_AT_Or_Similar_Keyboard)
                        Move C_$IBMPCATOrSimilarKeyboard to sKeyBoardType
                        Case Break
                    Case (iKeyboardType = IBM_Enhanced_Keyboard)
                        Move C_$IBMEnhancedKeyboard to sKeyBoardType
                        Case Break
                    Case (iKeyboardType = Nokia_1050_And_Similar_Keyboards)
                        Move C_$Nokia1050AndSimilarKeyboards to sKeyBoardType
                        Case Break
                    Case (iKeyboardType = Nokia_9140_And_Similar_Keyboards)
                        Move C_$Nokia9140AndSimilarKeyboards to sKeyBoardType
                        Case Break
                    Case (iKeyboardType = Japanese_Keyboard)
                        Move C_$JapaneseKeyboards to sKeyBoardType
                        Case Break
                    Case Else
                        Move (SFormat (C_$KeyboadUndefined, iKeyboardType)) to sKeyBoardType
                        Case Break
                Case End
            
                Get AddTreeItem (SFormat (C_$KeyBoardType, sKeyBoardType)) hRoot tiSysInfoKeyboardBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$KeyboardFunctionKeys, GetKeyboardType (Self, Keyboard_Function_Key_Count))) hRoot tiSysInfoKeyboardBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$KeyboardLayoutName, GetKeyboardLayoutName (Self))) hRoot tiSysInfoKeyboardBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddKeyboardInfo
            
            // The following definitions make is possible for us to find out if the defined physical key connected
            // to a DataFlex accelerator key is a function key, whether the shift, alt or ctrl is active.
            Define Alt_Key      For |CI$0200
            Define Shift_Key    For |CI$0400
            Define Ctrl_Key     For |CI$0800
            Define Function_Key For |CI$1000
            
            // This object contains the names of the physical keys.
            // It is an internal object used by the function AccKeyName
            Object oPhysicalKeys is An Array
                Set Array_Value Item  1 to C_$EnterKey
                Set Array_Value Item  2 to C_$TabKey
                Set Array_Value Item  3 to C_$BackspaceKey
                Set Array_Value Item  4 to C_$EscKey
                Set Array_Value Item  5 to C_$UpArrowKey
                Set Array_Value Item  6 to C_$DownArrowKey
                Set Array_Value Item  7 to C_$LeftArrowKey
                Set Array_Value Item  8 to C_$RightArrowKey
                Set Array_Value Item  9 to C_$HomeKey
                Set Array_Value Item 10 to C_$EndKey
                Set Array_Value Item 11 to C_$PgUpKey
                Set Array_Value Item 12 to C_$PgDnKey
                Set Array_Value Item 13 to C_$InsKey
                Set Array_Value Item 14 to C_$DelKey
                Set Array_Value Item 16 to C_$F1Key
                Set Array_Value Item 17 to C_$F2Key
                Set Array_Value Item 18 to C_$F3Key
                Set Array_Value Item 19 to C_$F4Key
                Set Array_Value Item 20 to C_$F5Key
                Set Array_Value Item 21 to C_$F6Key
                Set Array_Value Item 22 to C_$F7Key
                Set Array_Value Item 23 to C_$F8Key
                Set Array_Value Item 24 to C_$F9Key
                Set Array_Value Item 25 to C_$F10Key
                Set Array_Value Item 26 to C_$F11Key
                Set Array_Value Item 27 to C_$F12Key
            End_Object // oPhysicalKeys
            
            // This function translates a given keyvalue (kPrint_Screen for example) into a physical key
            // and from there to a keyname.
            // It is an internal function called from DoAddAccKey
            Function AccKeyName Integer iKeyVal Returns String
                Integer iBaseKey
                String sKey sKeycap
            
                If (iKeyVal = 0) Begin
                    Function_Return C_$AccKeyUndefined
                End
            
                Move (Key_Physical (iKeyVal)) to iKeyVal
                Move (iKeyVal iand $FF) to iBaseKey
                Case Begin
                    Case ((iKeyVal iand Ctrl_Key) = Ctrl_Key)
                        Move C_$KeyCtrlAnd to sKey
                        Case Break
                    Case ((iKeyVal iand Shift_Key) = Shift_Key)
                        Move C_$KeyShiftAnd to sKey
                        Case Break
                    Case ((iKeyVal iand Alt_Key) = Alt_Key)
                        Move C_$KeyAltAnd to sKey
                        Case Break
                Case End
            
                If ((iKeyVal iand Function_Key) = Function_Key) Begin
                    Get String_Value of oPhysicalKeys iBasekey to sKeyCap
                End
                Else Begin
                    If ((iBasekey < $20) = True) Begin
                        Move (iBasekey ior $40) to iBasekey
                    End
                    Move (Character (iBasekey)) to sKeycap
                    Case Begin
                        Case (sKeycap = " ")
                            Move C_$KeySpace to sKeycap
                            Case Break
                        Case (sKeycap = "+")
                            Move C_$KeyAdd to sKeycap
                            Case Break
                        Case (sKeycap = "-")
                            Move C_$KeySubtract to sKeycap
                            Case Break
                        Case Else
                            Move (Uppercase (sKeycap)) to sKeycap
                            Case Break
                    Case End
                End
            
                Function_Return (sKey - sKeyCap)
            End_Function // AccKeyName
            
            // This method will add an accelerator key as description, keyname and functionkey name to the treeview
            // It is an internal function called from DoAddAccKeyInfo
            Procedure DoAddAccKey Handle hRoot String sFunctionName String sKeyName Integer iAccKeyNumber
                Handle hItem hVoid
            
                Get AddTreeItem sFunctionName hRoot tiSysInfoAccKeysBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hItem
                Get AddTreeItem (SFormat (C_$KeyName, sKeyName)) hItem tiSysInfoAccKeysBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$FunctionKey, AccKeyName (Self, iAccKeyNumber))) hItem tiSysInfoAccKeysBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddAccKey
            
            // This method will be called when the user explore the accelerator keynames treeview branch
            // and will add keyname and identifier code to the treeview for all DataFlex accelerator keys
            Procedure DoAddAccKeyInfo
                Handle hRoot
            
                Get phCurrentRoot to hRoot
            
                Send DoAddAccKey hRoot C_$PrintScreen C_$kPrintScreen kPrint_Screen
                Send DoAddAccKey hRoot C_$Escape C_$kCancel kCancel
                Send DoAddAccKey hRoot C_$LeftArrow C_$kLeftArrow kLeftArrow
                Send DoAddAccKey hRoot C_$RightArrow C_$kRightArrow kRightArrow
                Send DoAddAccKey hRoot C_$PreviousItem C_$kPreviousItem kPrevious_Item
                Send DoAddAccKey hRoot C_$Find C_$kFind kFind
                Send DoAddAccKey hRoot C_$SuperFind C_$kSuperFind kSuper_Find
                Send DoAddAccKey hRoot C_$Saverecord C_$kSaveRecord  kSave_Record
                Send DoAddAccKey hRoot C_$DeleteRecord C_$kDeleteRecord kDelete_Record
                Send DoAddAccKey hRoot C_$Calculate C_$kCalculate kCalculate
                Send DoAddAccKey hRoot C_$UserDefined1 C_$kUser kUser
                Send DoAddAccKey hRoot C_$ClearPanel C_$kClear kClear
                Send DoAddAccKey hRoot C_$FindPrevious C_$kFindPrevious kFind_Previous
                Send DoAddAccKey hRoot C_$FindNext C_$kFindNext kFind_Next
                Send DoAddAccKey hRoot C_$UpArrow C_$kUpArrow kUpArrow
                Send DoAddAccKey hRoot C_$DownArrow C_$kDownArrow kDownArrow
                Send DoAddAccKey hRoot C_$Help C_$kHelp kHelp
                Send DoAddAccKey hRoot C_$UserDefined2 C_$kUser2 kUser2
                Send DoAddAccKey hRoot C_$Insert C_$kInsert kInsert
                Send DoAddAccKey hRoot C_$DeleteCharacter C_$kDeleteCharacter kDelete_Character
                Send DoAddAccKey hRoot C_$Backspace C_$kBack_Space kBack_Space
                Send DoAddAccKey hRoot C_$ClearAndReturn C_$kClearAndReturn kClear_And_Return
                Send DoAddAccKey hRoot C_$ClearAndBackspace C_$kClEOW kClEOW
                Send DoAddAccKey hRoot C_$ExitFunction C_$kExitFunction kExit_Function
                Send DoAddAccKey hRoot C_$ExitApplication C_$kExitApplication kExit_Application
                Send DoAddAccKey hRoot C_$Prompt C_$kPrompt kPrompt
                Send DoAddAccKey hRoot C_$RefreshScreen C_$kRefreshScreen kRefresh_Screen
                Send DoAddAccKey hRoot C_$SwitchToNextPanel C_$kSwitch kSwitch
                Send DoAddAccKey hRoot C_$SwitchToPreviousPanel C_$kSwitchBack kSwitch_Back
                Send DoAddAccKey hRoot C_$SuperfindPrevious C_$kSuperFindPrevious kSuper_Find_Previous
                Send DoAddAccKey hRoot C_$SuperfindNext C_$kSuperFind_Next kSuper_Find_Next
                Send DoAddAccKey hRoot C_$SwitchToActionBar C_$kActionBar kAction_Bar
                Send DoAddAccKey hRoot C_$ScrollPageUp C_$kScrollBack kScroll_Back
                Send DoAddAccKey hRoot C_$ScrollPageDown C_$kScrollForward kScroll_Forward
                Send DoAddAccKey hRoot C_$ScrollPageLeft C_$kScrollLeft kScroll_Left
                Send DoAddAccKey hRoot C_$ScrollPageRight C_$kScrollRight kScroll_Right
                Send DoAddAccKey hRoot C_$BeginOfLine C_$kBeginOfLine kBegin_Of_Line
                Send DoAddAccKey hRoot C_$EndOfLine C_$kEndOfLine kEnd_Of_Line
                Send DoAddAccKey hRoot C_$NextItem C_$kNextItem kNext_Item
                Send DoAddAccKey hRoot C_$EraseToEndOfLine C_$kEraseEndOfLine kErase_End_Of_Line
                Send DoAddAccKey hRoot C_$BeginOfPanel C_$kBeginOfPanel kBegin_Of_Panel
                Send DoAddAccKey hRoot C_$EndOfPanel C_$kEndOfPanel kEnd_Of_Panel
                Send DoAddAccKey hRoot C_$BeginOfData C_$kBeginOfData kBegin_Of_Data
                Send DoAddAccKey hRoot C_$EndOfData C_$kEndOfData kEnd_Of_Data
                Send DoAddAccKey hRoot C_$SkipWordLeft C_$kWordLeft kWord_Left
                Send DoAddAccKey hRoot C_$SkipWordRight C_$kWordRight kWord_Right
                Send DoAddAccKey hRoot C_$AddMode C_$kAddMode kAdd_Mode
                Send DoAddAccKey hRoot C_$Paste C_$kPaste kPaste
                Send DoAddAccKey hRoot C_$Copy C_$kCopy kCopy
                Send DoAddAccKey hRoot C_$Cut C_$kCut kCut
                Send DoAddAccKey hRoot C_$ClearAllPanels C_$kClearAll kClear_All
                Send DoAddAccKey hRoot C_$Mark C_$kMark kMark
                Send DoAddAccKey hRoot C_$Zoom C_$kZoom kZoom
                Send DoAddAccKey hRoot C_$ClosePanel C_$kClosePanel kClose_Panel
            End_Procedure // DoAddAccKeyInfo
            
            // Report the DataFlex serialnumber and registration name
            Procedure DoAddRegistrationInfo
                String sRegName
                Integer iSerialNr
                Handle hItem hVoid
            
                Get phCurrentRoot to hItem
            
                Registration sRegName iSerialNr
            
                Get AddTreeItem (SFormat (C_$Serial, iSerialNr)) hItem tiSysInfoRegistrationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$RegName, sRegName)) hItem tiSysInfoRegistrationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddRegistrationInfo
            
            // Add information belonging to the currently logged in user
            Procedure DoAddUserInfo
                Handle hRoot hVoid
                Integer iUserDefaultLangID
            
                Get phCurrentRoot to hRoot
            
                Get AddTreeItem (SFormat (C_$UserName, GetUserName (Self))) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (SFormat (C_$ComputerName, GetComputerName (Self))) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (SFormat (C_$DoubleClickTime, GetDoubleClickTime (Self), C_$Milliseconds)) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get GetUserDefaultLangID to iUserDefaultLangID
                Get AddTreeItem (SFormat (C_$LanguageIDAndName, iUserDefaultLangID, LanguageId2Name (Self, iUserDefaultLangID))) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddUserInfo
            
            // Report all windows locale information. The function do simply return what is stored and make no
            // decisions on this. So when the function says 1 and this has an explanation the Windows doc should
            // be read
            Procedure DoAddWindowsLocaleInfo
                Handle hRoot hVoid hChildRoot hNamesRoot hChildChildRoot hCalendarRoot
                Integer iCalendarType
                Boolean bPreviousOemTranslate
            
                Get phCurrentRoot to hRoot
            
                Get Oem_Translate_State to bPreviousOemTranslate
                Set Oem_Translate_State to False
            
                Get AddTreeItem (SFormat (ToAnsi (C_$ListSeparator), WindowsLocaleValue (Self, LOCALE_SLIST, 4))) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MeasureId), WindowsLocaleValue (Self, LOCALE_IMEASURE, 2))) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$PaperSize), WindowsLocaleValue (Self, LOCALE_IPAPERSIZE, 10))) hRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Numbers)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$DecimalSeparator), WindowsLocaleValue (Self, LOCALE_SDECIMAL, 5))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$WindowsLocaleThousandsSeparator), WindowsLocaleValue (Self, LOCALE_STHOUSAND, 5))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$DecimalGrouping), WindowsLocaleValue (Self, LOCALE_SGROUPING, 10))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Digits), WindowsLocaleValue (Self, LOCALE_IDIGITS, 3))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LeadingZeroes), WindowsLocaleValue (Self, LOCALE_ILZERO, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$NegativeNumberMode), WindowsLocaleValue (Self, LOCALE_INEGNUMBER, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$NativeDigits), WindowsLocaleValue (Self, LOCALE_SNATIVEDIGITS, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Language)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$LanguageId), WindowsLocaleValue (Self, LOCALE_ILANGUAGE, 5))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LanguageName), WindowsLocaleValue (Self, LOCALE_SLANGUAGE, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LanguageISOName), WindowsLocaleValue (Self, LOCALE_SENGLANGUAGE, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LanguageAbbreviatedName), WindowsLocaleValue (Self, LOCALE_SABBREVLANGNAME, 3))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LanguageNativeName), WindowsLocaleValue (Self, LOCALE_SNATIVELANGNAME, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Currency)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$CurrencyLocalSymbol), WindowsLocaleValue (Self, LOCALE_SCURRENCY, 6))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$IntlSymbol), WindowsLocaleValue (Self, LOCALE_SINTLSYMBOL, 4))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetaryDecimalSeparator), WindowsLocaleValue (Self, LOCALE_SMONDECIMALSEP, 4))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetaryThousandsSeparator), WindowsLocaleValue (Self, LOCALE_SMONTHOUSANDSEP, 4))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetaryGrouping), WindowsLocaleValue (Self, LOCALE_SMONGROUPING, 4))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LocalDigits), WindowsLocaleValue (Self, LOCALE_ICURRDIGITS, 3))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$IntlDigits), WindowsLocaleValue (Self, LOCALE_IINTLCURRDIGITS, 3))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$PositiveMode), WindowsLocaleValue (Self, LOCALE_ICURRENCY, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$NegativeMode), WindowsLocaleValue (Self, LOCALE_INEGCURR, 3))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$PositiveSign), WindowsLocaleValue (Self, LOCALE_SPOSITIVESIGN, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$NegativeSign), WindowsLocaleValue (Self, LOCALE_SNEGATIVESIGN, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$FormattingIndexForPositiveValues), WindowsLocaleValue (Self, LOCALE_IPOSSIGNPOSN, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$FormattingIndexForNegativeValues), WindowsLocaleValue (Self, LOCALE_INEGSIGNPOSN, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetarySymbolPositionInAPositiveValue), WindowsLocaleValue (Self, LOCALE_IPOSSYMPRECEDES, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetarySymbolSeparationInAPositiveValue), WindowsLocaleValue (Self, LOCALE_IPOSSEPBYSPACE, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetarySymbolPositionInANegativeValue), WindowsLocaleValue (Self, LOCALE_INEGSYMPRECEDES, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MonetarySymbolSeparationInANegativeValue), WindowsLocaleValue (Self, LOCALE_INEGSEPBYSPACE, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Time)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$Separator), WindowsLocaleValue (Self, LOCALE_STIME, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Format), WindowsLocaleValue (Self, LOCALE_STIMEFORMAT, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$PeriodeFormat), WindowsLocaleValue (Self, LOCALE_ITIME, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$MarkerPosition), WindowsLocaleValue (Self, LOCALE_ITIMEMARKPOSN, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$UseLeadingZeroes), WindowsLocaleValue (Self, LOCALE_ITLZERO, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$AMDesignator), WindowsLocaleValue (Self, LOCALE_S1159, 10))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$PMDesignator), WindowsLocaleValue (Self, LOCALE_S2359, 10))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Date)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Move (WindowsLocaleValue (Self, LOCALE_ICALENDARTYPE, 2)) to iCalendarType
                Get AddTreeItem (SFormat (ToAnsi (C_$Calendartype), iCalendarType)) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hCalendarRoot
                If (SysConf (SYSCONF_OS_MAJOR_REV) >= 5) Begin
                    Set ItemImage hCalendarRoot to tvSysInfoBookClosedBmp
                    Set ItemSelectedImage hCalendarRoot to tvSysInfoBookClosedBmp
                    Get AddTreeItem (SFormat (ToAnsi (C_$WindowsEpoch), GetCalendarInfo (Self, LOCALE_USER_DEFAULT, iCalendarType, CAL_ITWODIGITYEARMAX))) hCalendarRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
                Move (WindowsLocaleValue (Self, LOCALE_IOPTIONALCALENDAR, 2)) to iCalendarType
                Get AddTreeItem (SFormat (ToAnsi (C_$AdditionalCalendartype), iCalendarType)) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hCalendarRoot
                If (SysConf (SYSCONF_OS_MAJOR_REV) >= 5) Begin
                    Set ItemImage hCalendarRoot to tvSysInfoBookClosedBmp
                    Set ItemSelectedImage hCalendarRoot to tvSysInfoBookClosedBmp
                    Get AddTreeItem (SFormat (ToAnsi (C_$WindowsEpoch), GetCalendarInfo (Self, LOCALE_USER_DEFAULT, iCalendarType, CAL_ITWODIGITYEARMAX))) hCalendarRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
                Get AddTreeItem (SFormat (ToAnsi (C_$Separator), WindowsLocaleValue (Self, LOCALE_SDATE, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$YearMonthFormat), WindowsLocaleValue (Self, LOCALE_SYEARMONTH, 10))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$ShortFormat), WindowsLocaleValue (Self, LOCALE_SSHORTDATE, 25))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LongFormat), WindowsLocaleValue (Self, LOCALE_SLONGDATE, 50))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$ShortDateFormatOrdering), WindowsLocaleValue (Self, LOCALE_IDATE, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$LongDateFormatOrdering), WindowsLocaleValue (Self, LOCALE_ILDATE, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Full4DigitCentury), WindowsLocaleValue (Self, LOCALE_ICENTURY, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$UseLeadingZeroesInDayFields), WindowsLocaleValue (Self, LOCALE_IDAYLZERO, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$UseLeadingZeroesInMonthFields), WindowsLocaleValue (Self, LOCALE_IMONLZERO, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$FirstDayOfWeek), WindowsLocaleValue (Self, LOCALE_IFIRSTDAYOFWEEK, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$FirstWeekOfYear), WindowsLocaleValue (Self, LOCALE_IFIRSTWEEKOFYEAR, 2))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$DayNames)) hChildRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hNamesRoot
                Get AddTreeItem (ToAnsi (C_$Long)) hNamesRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 1, WindowsLocaleValue (Self, LOCALE_SDAYNAME1, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 2, WindowsLocaleValue (Self, LOCALE_SDAYNAME2, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 3, WindowsLocaleValue (Self, LOCALE_SDAYNAME3, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 4, WindowsLocaleValue (Self, LOCALE_SDAYNAME4, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 5, WindowsLocaleValue (Self, LOCALE_SDAYNAME5, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 6, WindowsLocaleValue (Self, LOCALE_SDAYNAME6, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 7, WindowsLocaleValue (Self, LOCALE_SDAYNAME7, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (ToAnsi (C_$Short)) hNamesRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 1, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME1, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 2, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME2, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 3, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME3, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 4, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME4, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 5, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME5, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 6, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME6, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Day), 7, WindowsLocaleValue (Self, LOCALE_SABBREVDAYNAME7, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Monthnames)) hChildRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hNamesRoot
                Get AddTreeItem (ToAnsi (C_$Long)) hNamesRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 1, WindowsLocaleValue (Self, LOCALE_SMONTHNAME1, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 2, WindowsLocaleValue (Self, LOCALE_SMONTHNAME2, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 3, WindowsLocaleValue (Self, LOCALE_SMONTHNAME3, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 4, WindowsLocaleValue (Self, LOCALE_SMONTHNAME4, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 5, WindowsLocaleValue (Self, LOCALE_SMONTHNAME5, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 6, WindowsLocaleValue (Self, LOCALE_SMONTHNAME6, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 7, WindowsLocaleValue (Self, LOCALE_SMONTHNAME7, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 8, WindowsLocaleValue (Self, LOCALE_SMONTHNAME8, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 9, WindowsLocaleValue (Self, LOCALE_SMONTHNAME9, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 10, WindowsLocaleValue (Self, LOCALE_SMONTHNAME10, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 11, WindowsLocaleValue (Self, LOCALE_SMONTHNAME11, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 12, WindowsLocaleValue (Self, LOCALE_SMONTHNAME12, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 13, WindowsLocaleValue (Self, LOCALE_SMONTHNAME13, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (ToAnsi (C_$Short)) hNamesRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 1, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME1, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 2, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME2, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 3, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME3, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 4, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME4, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 5, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME5, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 6, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME6, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 7, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME7, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 8, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME8, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 9, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME9, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 10, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME10, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 11, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME11, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 12, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME12, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Month), 13, WindowsLocaleValue (Self, LOCALE_SABBREVMONTHNAME13, 25))) hChildChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Country)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$CountryId), WindowsLocaleValue (Self, LOCALE_ICOUNTRY, 6))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$CountryName), WindowsLocaleValue (Self, LOCALE_SCOUNTRY, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$EnglishName), WindowsLocaleValue (Self, LOCALE_SENGCOUNTRY, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$AbbreviatedName), WindowsLocaleValue (Self, LOCALE_SABBREVCTRYNAME, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$NativeName), WindowsLocaleValue (Self, LOCALE_SNATIVECTRYNAME, 100))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (ToAnsi (C_$Defaults)) hRoot tiSysInfoUserBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hChildRoot
                Get AddTreeItem (SFormat (ToAnsi (C_$DefaultsCountryId), WindowsLocaleValue (Self, LOCALE_IDEFAULTCOUNTRY, 6))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$DefaultsLanguageId), WindowsLocaleValue (Self, LOCALE_IDEFAULTLANGUAGE, 5))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$ANSICodepage), WindowsLocaleValue (Self, LOCALE_IDEFAULTANSICODEPAGE, 6))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (ToAnsi (C_$Codepage), WindowsLocaleValue (Self, LOCALE_IDEFAULTCODEPAGE, 6))) hChildRoot tiSysInfoUserBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Set Oem_Translate_State to bPreviousOemTranslate
            End_Procedure // DoAddWindowsLocaleInfo
            
            // This method will add the current information from the DataFlex runtime attributes
            Procedure DoAddGlobalAttributesInfo
                Integer iThousandsSeparator iDecimalSeparator iDateSeparator iDateFormat iStrictAttrib
                Integer iRuntimeProgressFrequency iReportUnsupportedAttributes
                Integer iLockTimeOut iLockDelay iHighDataIntegrity iEpochValue
                Boolean bSysdate4State bDate4State
                String sDateFormat sOpenPath
                Handle hItem hVoid
            
                Get phCurrentRoot to hItem
            
                Get_Attribute DF_THOUSANDS_SEPARATOR to iThousandsSeparator
                Get_Attribute DF_DECIMAL_SEPARATOR to iDecimalSeparator
                Get_Attribute DF_DATE_SEPARATOR to iDateSeparator
                Get_Attribute DF_DATE_FORMAT to iDateFormat
                Get_Attribute DF_STRICT_ATTRIBUTES to iStrictAttrib
                Get_Attribute DF_RUNTIME_PROGRESS_FREQUENCY to iRuntimeProgressFrequency
                Get_Attribute DF_REPORT_UNSUPPORTED_ATTRIBUTES to iReportUnsupportedAttributes
                Get_Attribute DF_LOCK_TIMEOUT to iLockTimeOut
                Get_Attribute DF_LOCK_DELAY to iLockDelay
                Get_Attribute DF_HIGH_DATA_INTEGRITY to iHighDataIntegrity
                Get_Attribute DF_OPEN_PATH to sOpenPath
            
                Get_Date_Attribute SYSDATE4_STATE to bSysdate4State
                Get_Date_Attribute DATE4_STATE to bDate4State
                Get_Date_Attribute EPOCH_VALUE to iEpochValue
            
                Case Begin
                    Case (iDateFormat = DF_DATE_USA)
                        Move C_$USA to sDateFormat
                        Case Break
                    Case (iDateFormat = DF_DATE_EUROPEAN)
                        Move C_$European to sDateFormat
                        Case Break
                    Case (iDateFormat = DF_DATE_MILITARY)
                        Move C_$Military to sDateFormat
                        Case Break
                Case End
            
                Get AddTreeItem (SFormat (C_$ThousandsSeparator, Character (iThousandsSeparator), iThousandsSeparator)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DecimalSeparatorChar, Character (iDecimalSeparator), iDecimalSeparator)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DateSeparator, Character (iDateSeparator), iDateSeparator)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DateFormat, sDateFormat)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$StrictAttributes, If (iStrictAttrib, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$ReportUnsupportedAttributes, If (iReportUnsupportedAttributes, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$RuntimeProgressFrequencyInterval, iRuntimeProgressFrequency, C_$Milliseconds)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$LockTimeOut, iLockTimeOut, C_$Milliseconds)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$LockDelay, iLockDelay, C_$Milliseconds)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$HighDataIntegrity, If (iHighDataIntegrity, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$OpenPath, sOpenPath)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            
                Get AddTreeItem (SFormat (C_$Sysdate4State, If (bSysdate4State, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$Date4State, If (bDate4State, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$Epoch, iEpochValue)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddGlobalAttributesInfo
            
            // This method will add some of the DataFlex global variables to the tree. If you want to see
            // more you can simply extend the list.
            Procedure DoAddGlobalVariablesInfo
                Handle hItem hVoid
            
                Get phCurrentRoot to hItem
            
                Get AddTreeItem (SFormat (C_$PageEnd, PageEnd)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$PageFeed, PageFeed)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$PageCount, PageCount)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$LineCount, LineCount)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$FlxRevision, Flx_Revision)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$ConstrainTestsCount, Constrain_Tests_Count)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$ConstrainFoundCount, Constrain_Found_Count)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$LastErr, LastErr)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$ChainDepth, Chain_Depth)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$TotalResources, Total_Resources)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$TotalObjects, Total_Objects)) hItem tiSysInfoGlobalVariablesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddGlobalVariablesInfo
            
            // This method will add some of the system metrics information to the tree. If you want to see
            // more you can simply extend the list. Look in WINUSER.PKG for other system metrics constants.
            Procedure DoAddSystemMetricsInfo
                Handle hItem hVoid
                Boolean bMousePresent
                Integer iCleanBoot
            
                Get phCurrentRoot to hItem
            
                Define SM_MOUSEWHEELPRESENT For 75
                Define SM_CXVIRTUALSCREEN   For 78
                Define SM_CYVIRTUALSCREEN   For 79
                Define SM_CMONITORS         For 80
                Define SM_REMOTESESSION     For |CI$1000
            
                Get AddTreeItem (SFormat (C_$VideoResolution, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfArrowBitmapOnHorizontalScrollbar, GetSystemMetrics (SM_CXHSCROLL), GetSystemMetrics (SM_CYHSCROLL))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$HeightOfCaptionbar, GetSystemMetrics (SM_CYCAPTION))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfArrowBitmapOnVerticalScrollbar, GetSystemMetrics (SM_CXVSCROLL), GetSystemMetrics (SM_CYVSCROLL))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$MidleEastEnabled, If (GetSystemMetrics (SM_MIDEASTENABLED), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfCursor, GetSystemMetrics (SM_CXCURSOR), GetSystemMetrics (SM_CYCURSOR))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfWindowClientAreaForFullScreenWindow, GetSystemMetrics (SM_CXFULLSCREEN), GetSystemMetrics (SM_CYFULLSCREEN))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfBitmapsContainedInTheTitleBar, GetSystemMetrics (SM_CXSIZE), GetSystemMetrics (SM_CYSIZE))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Move (GetSystemMetrics (SM_MOUSEPRESENT)) to bMousePresent
                Get AddTreeItem (SFormat (C_$MousePresent, If (bMousePresent, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                If (bMousePresent) Begin
                    Get AddTreeItem (SFormat (C_$MouseWheelPresent, If (GetSystemMetrics (SM_MOUSEWHEELPRESENT), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$MouseButtons, GetSystemMetrics (SM_CMOUSEBUTTONS))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
                Get AddTreeItem (SFormat (C_$DebugVersionOfUserExe, If (GetSystemMetrics (SM_DEBUG), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$MenuDropAlignment, If (GetSystemMetrics (SM_MENUDROPALIGNMENT), C_$Left, C_$Right))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$PenWindowsInstalled, If (GetSystemMetrics (SM_PENWINDOWS), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (If (GetSystemMetrics (SM_REMOTESESSION), C_$CallingProcessIsTerminalServicesClientSession, C_$CallingProcessIsTerminalServerConsoleSession)) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SecurityPresent, If (GetSystemMetrics (SM_SECURE), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$NetWorkPresent, If (GetSystemMetrics (SM_NETWORK) iand |CI00000001, C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$NumberOfDisplayMonitors, GetSystemMetrics (SM_CMONITORS))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Move (GetSystemMetrics (SM_CLEANBOOT)) to iCleanBoot
                Get AddTreeItem (SFormat (C_$CleanBoot, If (iCleanBoot = 0, C_$Normal, If (iCleanBoot = 1, C_$FailSafe, C_$FailSafeWithNetwork)))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$LeftAndRightMouseButtonsAreSwapped, If (GetSystemMetrics (SM_SWAPBUTTON), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfThumbBoxOnVerticalScrollbar, GetSystemMetrics (SM_CXHTHUMB), GetSystemMetrics (SM_CYVTHUMB))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$RectangleAroundTheLocationOfAFirstClickInADoubleClickSequence, GetSystemMetrics (SM_CXDOUBLECLK), GetSystemMetrics (SM_CYDOUBLECLK))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SizeOfVirtualScreen, GetSystemMetrics (SM_CXVIRTUALSCREEN), GetSystemMetrics (SM_CYVIRTUALSCREEN))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DoubleByteCharacterSetUserExeInstalled, If (GetSystemMetrics (SM_DBCSENABLED), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$ComputerHasALowEndSlowProcessor, If (GetSystemMetrics (SM_SLOWMACHINE), C_$Yes, C_$No))) hItem tiSysInfoGlobalAttributesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddSystemMetricsInfo
            
            // This method will add all the system configuration values to the tree. It is the result of the
            // various SYSCONF function calls.
            Procedure DoAddSysConfInfo
                Handle hItem hVoid
            
                Get phCurrentRoot to hItem
            
                Define SYSCONF_RUNTIME_NAME For 11
                Define SYSCONF_UTC_TIME_OFFSET For 12
            
                Get AddTreeItem (SFormat (C_$NumberOfVDFTimerObjectEventsPerSecond, SysConf (SYSCONF_TIMER_RESOLUTION))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DirectorySeparator, SysConf (SYSCONF_DIR_SEPARATOR))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$OSShortName, SysConf (SYSCONF_OS_SHORT_NAME))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$OSMajorRevision, SysConf (SYSCONF_OS_MAJOR_REV))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$OSMinorRevision, SysConf (SYSCONF_OS_MINOR_REV))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$OSName, SysConf (SYSCONF_OS_NAME))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$MachineName, SysConf (SYSCONF_MACHINE_NAME))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$FileMask, SysConf (SYSCONF_FILE_MASK))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$DataFlexRevision, SysConf (SYSCONF_DATAFLEX_REV))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$SystemName, SysConf (SYSCONF_SYSTEM_NAME))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$PathSeparator, SysConf (SYSCONF_PATH_SEPARATOR))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$RuntimeName, SysConf (SYSCONF_RUNTIME_NAME))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$TimeOffsetFromMeridian, SysConf (SYSCONF_UTC_TIME_OFFSET))) hItem tiSysInfoSysConfBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddSysConfInfo
            
            // Test for each index between first and last known index number if the index exists and if so
            // return the count
            Function NumberOfIndexes Integer iFile Returns Integer
                Integer iLastIndex iIndexNum iNumberOfSegments iIndexes
            
                Get_Attribute DF_FILE_LAST_INDEX_NUMBER of iFile to iLastIndex
                For iIndexNum From 1 to iLastIndex
                    Get_Attribute DF_INDEX_NUMBER_SEGMENTS of iFile iIndexNum to iNumberOfSegments
                    If (iNumberOfSegments > 0) Begin
                        Increment iIndexes
                    End
                Loop
            
                Function_Return iIndexes
            End_Function // NumberOfIndexes
            
            // For all open files report the file attributes, the fieldnames and the indexes
            Procedure DoAddDataFilesInfo
                Integer iMaxSlots iFile iFields
                Boolean bOpened
                String sRootName sDisplayName sLogicalName sPhysicalName
                Handle hItem hVoid hFileItem
            
                Get phCurrentRoot to hItem
            
                Define DF_NUMBER_FILES_SUPPORTED For |CI27
            
                Get_Attribute DF_NUMBER_FILES_SUPPORTED to iMaxSlots
                If (iMaxSlots <= 255) Begin
                    Move 250 to iMaxSlots
                End
            
                For iFile From 1 to iMaxSlots
                    Get_Attribute DF_FILE_OPENED of iFile to bOpened
                    If (bOpened) Begin
                        Get_Attribute DF_FILE_ROOT_NAME of iFile to sRootName
                        Get_Attribute DF_FILE_DISPLAY_NAME of iFile to sDisplayName
                        Get_Attribute DF_FILE_LOGICAL_NAME of iFile to sLogicalName
                        Get_Attribute DF_FILE_PHYSICAL_NAME of iFile to sPhysicalName
            
                        Get AddTreeItem sPhysicalName hItem tiSysInfoDataFilesBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hFileItem
                        If (hFileItem <> 0) Begin
                            Get AddTreeItem (SFormat (C_$FileNumber, iFile)) hFileItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get AddTreeItem (SFormat (C_$RootName, sRootName)) hFileItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get AddTreeItem (SFormat (C_$DisplayName, sDisplayName)) hFileItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get AddTreeItem (SFormat (C_$LogicalName, sLogicalName)) hFileItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get AddTreeItem C_$Attributes hFileItem ((iFile * 65536) + tiSysInfoDataFilesAttributesBranch) tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hVoid
                            Set ItemChildCount hVoid to 1
                            Get_Attribute DF_FILE_NUMBER_FIELDS of iFile to iFields
                            Get AddTreeItem (SFormat (C_$Fields, iFields + 1)) hFileItem ((iFile * 65536) + tiSysInfoDataFilesFieldsBranch) tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hVoid
                            Set ItemChildCount hVoid to 1
                            Get AddTreeItem (SFormat (C_$Indexes, NumberOfIndexes (Self, iFile))) hFileItem ((iFile * 65536) + tiSysInfoDataFilesIndexesBranch) tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hVoid
                            Set ItemChildCount hVoid to 1
                        End
                    End
                Loop
            End_Procedure // DoAddDataFilesInfo
            
            // Internal method used by DoAddDataFilesInfo to add file attributes to the tree. Splitting in multiple
            // methods makes the code better to read.
            Procedure DoAddAttributesInfo Handle hAttributesItem Integer iFile
                Integer iRecordIdentityField iRecordLength iRecordLengthUsed iRecordsUsed
                Integer iFileOpenMode iFileAlias iFileCompression iOldState iMaxRecords
                Integer iFileMultiUser iFileIntegrityCheck iFileIsSystemFile iFileLockType
                Integer iFileReuseDeletedSpace iFileTransactionMode
                String sFileLogin sFileOwner sFileDriverName sFileRevision sFieldName
                Handle hVoid
            
                Get_Attribute DF_FILE_REVISION of iFile to sFileRevision
                Get AddTreeItem (SFormat (C_$Revision, sFileRevision)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_RECORD_IDENTITY of iFile to iRecordIdentityField
                Get_Attribute DF_FIELD_NAME of iFile iRecordIdentityField to sFieldName
                Get AddTreeItem (SFormat (C_$RecordIdentityField, iRecordIdentityField, sFieldName)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_RECORD_LENGTH of iFile to iRecordLength
                Get AddTreeItem (SFormat (C_$RecordLength, iRecordLength)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_RECORD_LENGTH_USED of iFile to iRecordLengthUsed
                Get AddTreeItem (SFormat (C_$RecordLengthUsed, iRecordLengthUsed)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_OPEN_MODE of iFile to iFileOpenMode
                Get AddTreeItem (SFormat (C_$FileOpenMode, If (iFileOpenMode = DF_SHARE, C_$Shared, C_$Exclusive))) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_ALIAS of iFile to iFileAlias
                Case Begin
                    Case (iFileAlias = DF_FILE_ALIAS_DEFAULT)
                        Get AddTreeItem (SFormat (C_$AliasAttribute, C_$NotSet)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileAlias = DF_FILE_IS_MASTER)
                        Get AddTreeItem (SFormat (C_$AliasAttribute, C_$Master)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileAlias = DF_FILE_IS_ALIAS)
                        Get AddTreeItem (SFormat (C_$AliasAttribute, C_$Alias)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                Case End
                Get_Attribute DF_FILE_COMPRESSION of iFile to iFileCompression
                Case Begin
                    Case (iFileCompression = DF_FILE_COMPRESS_NONE)
                        Get AddTreeItem (SFormat (C_$Compression, C_$None)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileCompression = DF_FILE_COMPRESS_FAST)
                        Get AddTreeItem (SFormat (C_$Compression, C_$FastRLE)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileCompression = DF_FILE_COMPRESS_STANDARD)
                        Get AddTreeItem (SFormat (C_$Compression, C_$StandardHuffman)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileCompression = DF_FILE_COMPRESS_CUSTOM)
                        Get AddTreeItem (SFormat (C_$Compression, C_$CustomHuffman)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                Case End
                Get_Attribute DF_FILE_DRIVER of iFile to sFileDriverName
                Get AddTreeItem (SFormat (C_$FileDatabaseDriver, sFileDriverName)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_RECORDS_USED of iFile to iRecordsUsed
                Get AddTreeItem (SFormat (C_$RecordsUsed, iRecordsUsed)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_REUSE_DELETED of iFile to iFileReuseDeletedSpace
                Get AddTreeItem (SFormat (C_$ReuseDeletedSpace, If (iFileReuseDeletedSpace = DF_FILE_DELETED_NOREUSE, C_$No, C_$Yes))) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_MAX_RECORDS of iFile to iMaxRecords
                Get AddTreeItem (SFormat (C_$MaxRecords, iMaxRecords)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_INTEGRITY_CHECK of iFile to iFileIntegrityCheck
                Get AddTreeItem (SFormat (C_$IntegrityCheck, If (iFileIntegrityCheck, C_$Yes, C_$No))) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_IS_SYSTEM_FILE of iFile to iFileIsSystemFile
                Get AddTreeItem (SFormat (C_$Systemfile, If (iFileIsSystemFile, C_$Yes, C_$No))) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_MULTIUSER of iFile to iFileMultiUser
                Get AddTreeItem (SFormat (C_$MultiUser, If (iFileMultiUser = DF_FILE_USER_MULTI, C_$Yes, C_$No))) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_TRANSACTION of iFile to iFileTransactionMode
                Case Begin
                    Case (iFileTransactionMode = DF_FILE_TRANSACTION_NONE)
                        Get AddTreeItem (SFormat (C_$TransactionTracking, C_$None)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileTransactionMode = DF_FILE_TRANSACTION_CLIENT_ATOMIC)
                        Get AddTreeItem (SFormat (C_$TransactionTracking, C_$ClientAtomic)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileTransactionMode = DF_FILE_TRANSACTION_SERVER_ATOMIC)
                        Get AddTreeItem (SFormat (C_$TransactionTracking, C_$ServerAtomic)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileTransactionMode = DF_FILE_TRANSACTION_SERVER_LOGGED)
                        Get AddTreeItem (SFormat (C_$TransactionTracking, C_$ServerLogged)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                Case End
                Get_Attribute DF_FILE_LOCK_TYPE of iFile to iFileLockType
                Case Begin
                    Case (iFileLockType = DF_LOCK_TYPE_FILE)
                        Get AddTreeItem (SFormat (C_$LockType, C_$File)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileLockType = DF_LOCK_TYPE_RECORD)
                        Get AddTreeItem (SFormat (C_$LockType, C_$Record)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFileLockType = DF_LOCK_TYPE_NONE)
                        Get AddTreeItem (SFormat (C_$LockType, C_$None)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                Case End
                Get_Attribute DF_REPORT_UNSUPPORTED_ATTRIBUTES to iOldState
                Set_Attribute DF_REPORT_UNSUPPORTED_ATTRIBUTES to False
                Get_Attribute DF_FILE_LOGIN of iFile to sFileLogin
                Get AddTreeItem (SFormat (C_$Login, sFileLogin)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FILE_OWNER of iFile to sFileOwner
                Get AddTreeItem (SFormat (C_$Owner, sFileOwner)) hAttributesItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Set_Attribute DF_REPORT_UNSUPPORTED_ATTRIBUTES to iOldState
            End_Procedure // DoAddAttributesInfo
            
            Procedure DoAddFieldInfo Handle hFieldItem Integer iFile Integer iFieldNum
                Integer iFieldRelatedFile iFieldRelatedField iFieldOffset
                Integer iFieldLength iFieldPrecision iFieldMainIndex iFieldType
                String sFileName sFieldName
                Boolean bOpened
                Handle hVoid
            
                Get_Attribute DF_FIELD_LENGTH of iFile iFieldNum to iFieldLength
                Get AddTreeItem (SFormat (C_$FieldLength, iFieldLength)) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FIELD_TYPE of iFile iFieldNum to iFieldType
                Case Begin
                    Case (iFieldType = DF_ASCII)
                        Get AddTreeItem (SFormat (C_$Type, "DF_ASCII")) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFieldType = DF_BCD)
                        Get AddTreeItem (SFormat (C_$Type, "DF_BCD")) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Get_Attribute DF_FIELD_PRECISION of iFile iFieldNum to iFieldPrecision
                        Get AddTreeItem (SFormat (C_$Precision, iFieldPrecision)) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFieldType = DF_DATE)
                        Get AddTreeItem (SFormat (C_$Type, "DF_DATE")) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFieldType = DF_OVERLAP)
                        Get AddTreeItem (SFormat (C_$Type, "DF_OVERLAP")) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFieldType = DF_BINARY)
                        Get AddTreeItem (SFormat (C_$Type, "DF_BINARY")) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                    Case (iFieldType = DF_TEXT)
                        Get AddTreeItem (SFormat (C_$Type, "DF_TEXT")) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                        Case Break
                Case End
                Get_Attribute DF_FIELD_OFFSET of iFile iFieldNum to iFieldOffset
                Get AddTreeItem (SFormat (C_$Offset, iFieldOffset)) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get_Attribute DF_FIELD_INDEX of iFile iFieldNum to iFieldMainIndex
                If (iFieldMainIndex <> 0) Begin
                    Get AddTreeItem (SFormat (C_$Mainindex, iFieldMainIndex)) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
                Get_Attribute DF_FIELD_RELATED_FILE of iFile iFieldNum to iFieldRelatedFile
                If (iFieldRelatedFile <> 0) Begin
                    Get_Attribute DF_FIELD_RELATED_FIELD of iFile iFieldNum to iFieldRelatedField
                    Get_Attribute DF_FILE_OPENED of iFieldRelatedFile to bOpened
                    If (bOpened) Begin
                        Get_Attribute DF_FILE_PHYSICAL_NAME of iFieldRelatedFile to sFileName
                        Get_Attribute DF_FIELD_NAME of iFieldRelatedFile iFieldRelatedField to sFieldName
                    End
                    Else Begin
                        Move C_$NotAvailable to sFileName
                        Move C_$NotAvailable to sFieldName
                    End
                    Get AddTreeItem (SFormat (C_$RelatesToFile, iFieldRelatedFile, sFileName)) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                    Get AddTreeItem (SFormat (C_$RelatesToField, iFieldRelatedField, sFieldName)) hFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                End
            End_Procedure // DoAddFieldInfo
            
            // Internal method used by DoAddDataFilesInfo to add file attributes to the tree. Splitting in multiple
            // methods makes the code better to read.
            Procedure DoAddFieldsInfo Handle hFieldsItem Integer iFile
                Integer iFieldNum iFields
                String sFieldName
                Handle hFieldItem
            
                Get_Attribute DF_FILE_NUMBER_FIELDS of iFile to iFields
                For iFieldNum From 0 to iFields
                    Get_Attribute DF_FIELD_NAME of iFile iFieldNum to sFieldName
                    Get AddTreeItem sFieldName hFieldsItem tiSysInfoDataFilesBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hFieldItem
                    If (hFieldItem <> 0) Begin
                        Send DoAddFieldInfo hFieldItem iFile iFieldNum
                    End
                Loop
            End_Procedure // DoAddFieldsInfo
            
            // Internal method used by DoAddDataFilesInfo to add file attributes to the tree. Splitting in multiple
            // methods makes the code better to read.
            Procedure DoAddIndexInfo Handle hIndexesItem Integer iFile
                Integer iLastIndex iIndexNum iNumberOfSegments iIndexSegmentNum iFieldNum
                Integer iSegmentCase iSegmentDirection iNumberOfBuffers iIndexType
                Integer iNumberOfLevels iIndexKeyLength
                Handle hIndexItem hIndexFieldItem hVoid
                String sFieldName
            
                Get_Attribute DF_FILE_LAST_INDEX_NUMBER of iFile to iLastIndex
                For iIndexNum From 1 to iLastIndex
                    Get_Attribute DF_INDEX_NUMBER_SEGMENTS of iFile iIndexNum to iNumberOfSegments
                    If (iNumberOfSegments <> 0) Begin
                        Get AddTreeItem (SFormat (C_$Index, iIndexNum)) hIndexesItem tiSysInfoDataFilesBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hIndexItem
                        If (hIndexItem <> 0) Begin
                            Get_Attribute DF_INDEX_NUMBER_BUFFERS of iFile iIndexNum to iNumberOfBuffers
                            Get AddTreeItem (SFormat (C_$Buffers, iNumberOfBuffers)) hIndexItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get_Attribute DF_INDEX_TYPE of iFile iIndexNum to iIndexType
                            Get AddTreeItem (SFormat (C_$Indextype, If (iIndexType = DF_INDEX_TYPE_ONLINE, C_$Online, C_$Batch))) hIndexItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get_Attribute DF_INDEX_LEVELS of iFile iIndexNum to iNumberOfLevels
                            Get AddTreeItem (SFormat (C_$Levels, iNumberOfLevels)) hIndexItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get_Attribute DF_INDEX_KEY_LENGTH of iFile iIndexNum to iIndexKeyLength
                            Get AddTreeItem (SFormat (C_$KeyLength, iIndexKeyLength)) hIndexItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                            Get AddTreeItem (SFormat (C_$Segments, iNumberOfSegments)) hIndexItem tiSysInfoDataFilesBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hIndexItem
                            For iIndexSegmentNum From 1 to iNumberOfSegments
                                Get_Attribute DF_INDEX_SEGMENT_FIELD of iFile iIndexNum iIndexSegmentNum to iFieldNum
                                Get_Attribute DF_FIELD_NAME of iFile iFieldNum to sFieldName
                                Get AddTreeItem sFieldName hIndexItem tiSysInfoDataFilesBranchItem tvSysInfoBookClosedBmp tvSysInfoBookClosedBmp to hIndexFieldItem
                                If (hIndexFieldItem <> 0) Begin
                                    Get_Attribute DF_INDEX_SEGMENT_CASE of iFile iIndexNum iIndexSegmentNum to iSegmentCase
                                    Get AddTreeItem (If (iSegmentCase = DF_CASE_USED, "", C_$not) * C_$CaseSensitive) hIndexFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                                    Get_Attribute DF_INDEX_SEGMENT_DIRECTION of iFile iIndexNum iIndexSegmentNum to iSegmentDirection
                                    Get AddTreeItem (If (iSegmentDirection = DF_ASCENDING, C_$Ascending, C_$Descending)) hIndexFieldItem tiSysInfoDataFilesBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                                    Send DoAddFieldInfo hIndexFieldItem iFile iFieldNum
                                End
                            Loop
                        End
                    End
                Loop
            End_Procedure // DoAddIndexInfo
            
            // Add values (properties) from the ghoApplication object
            Procedure DoAddApplicationInfo
                Handle hItem hVoid
                String sHelpType
                Integer eHelpType
            
                Get peHelpType of ghoApplication to eHelpType
                Case Begin
                    Case (eHelpType = htWinHelp)
                        Move C_$HelpTypeWinHelp to sHelpType
                        Case Break
                    Case (eHelpType = htHTMLHelp)
                        Move C_$HelpTypeHTMLHelp to sHelpType
                        Case Break
                    Case (eHelpType = htNoHelp)
                        Move C_$HelpTypeNoHelp to sHelpType
                        Case Break
                Case End
            
                Get phCurrentRoot to hItem
                Get AddTreeItem (SFormat (C_$EnterKeyNavForward, If (pbEnterKeyAsTabKey (ghoApplication), C_$True, C_$False))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$HelpFile, psHelpFile (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$HelpType, sHelpType)) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppCompanyName, psCompany (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppProduct, psProduct (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppVersion, psVersion (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppProgram, psProgram (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppPreserveEnvironment, If (pbPreserveEnvironment (ghoApplication), C_$True, C_$False))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppRegistryKeyString, RegistryKeyString (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppFileName, GetApplicationFileName (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppPath, GetApplicationPath (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
                Get AddTreeItem (SFormat (C_$AppName, GetApplicationName (ghoApplication))) hItem tiSysInfoApplicationBranchItem tvSysInfoItemBmp tvSysInfoItemBmp to hVoid
            End_Procedure // DoAddApplicationInfo
            
            // When the user clicks on the "+" symbol in the tree we need to figure out if the
            // childitems need to be created or not. If not just quit and let Windows open the tree.
            // If the items need to be created call one of the above methods to fill its part of the
            // treeview.
            Procedure OnItemExpanding Handle hItem
                Integer iItemData iType iData hoWorkSpace
            
                Set phCurrentRoot to hItem
                Get ItemData hItem to iItemData
                Move (Low (iItemData)) to iType
                Move (Hi (iItemData)) to iData
            
                If (ItemImage (Self, hItem) = tvSysInfoBookClosedBmp) Begin
                    Set ItemSelectedImage hItem to tvSysInfoBookOpenBmp
                    Set ItemImage hItem to tvSysInfoBookOpenBmp
                End
            
                Case Begin
                    Case (iType = tiSysInfoWorkSpaceBranch)
                        If (ghoApplication <> 0) Begin
                            Get phoWorkSpace of ghoApplication to hoWorkSpace
                            If (hoWorkSpace <> 0) Begin
                                Register_Procedure EnumerateWorkspaceData Integer hObjId Integer hmMessId
                                Send EnumerateWorkspaceData of hoWorkSpace Self Msg_DoAddWorkSpaceItems
                            End
                        End
                        Case Break
                    Case (iType = tiSysInfoApplicationBranch)
                        Send DoAddApplicationInfo
                        Case Break
                    Case (iType = tiSysInfoDataBaseDriversBranch)
                        Send DoAddDriversInfo
                        Case Break
                    Case (iType = tiSysInfoMemoryBranch)
                        Send DoAddMemoryInfo
                        Case Break
                    Case (iType = tiSysInfoVersionBranch)
                        Send DoAddVersionInfo
                        Case Break
                    Case (iType = tiSysInfoVersionsOfBinDirBranch)
                        Send DoAddBinFilesInfo
                        Case Break
                    Case (iType = tiSysInfoVersionsEnumeratedModulesDirBranch)
                        Send DoAddModuleNames hItem
                        Case Break
                    Case (iType = tiSysInfoFilesDirBranch)
                        Send DoAddFilesAndDirInfo
                        Case Break
                    Case (iType = tiSysInfoKeyboardBranch)
                        Send DoAddKeyboardInfo
                        Case Break
                    Case (iType = tiSysInfoAccKeysBranch)
                        Send DoAddAccKeyInfo
                        Case Break
                    Case (iType = tiSysInfoRegistrationBranch)
                        Send DoAddRegistrationInfo
                        Case Break
                    Case (iType = tiSysInfoUserBranch)
                        Send DoAddUserInfo
                        Case Break
                    Case (iType = tiSysWindowsLocaleBranch)
                        Send DoAddWindowsLocaleInfo
                        Case Break
                    Case (iType = tiSysInfoGlobalAttributesBranch)
                        Send DoAddGlobalAttributesInfo
                        Case Break
                    Case (iType = tiSysInfoGlobalVariablesBranch)
                        Send DoAddGlobalVariablesInfo
                        Case Break
                    Case (iType = tiSysInfoSystemMetricsBranch)
                        Send DoAddSystemMetricsInfo
                        Case Break
                    Case (iType = tiSysInfoDataFilesBranch)
                        Send DoAddDataFilesInfo
                        Case Break
                    Case (iType = tiSysInfoDataFilesAttributesBranch)
                        Send DoAddAttributesInfo hItem iData
                        Case Break
                    Case (iType = tiSysInfoDataFilesFieldsBranch)
                        Send DoAddFieldsInfo hItem iData
                        Case Break
                    Case (iType = tiSysInfoDataFilesIndexesBranch)
                        Send DoAddIndexInfo hItem iData
                        Case Break
                    Case (iType = tiSysInfoSysConfBranch)
                        Send DoAddSysConfInfo
                        Case Break
                Case End
            
                //Set ExpandedOnceState hItem To False
            End_Procedure // OnItemExpanding
            
            // Internal method used by OnItemCollapsed to delete all the child items of the
            // the item that is just collapsed.
            Procedure DoDeleteChildItems Handle hItem
                Handle hNextItem
            
                Get ChildItem hItem to hItem
                While (hItem <> 0)
                    Get NextSiblingItem hItem to hNextItem
                    Send DoDeleteItem hItem
                    Move hNextItem to hItem
                End
            End_Procedure // DoDeleteChildItems
            
            // When the user closes a branch in the tree we want to delete the child items
            // of some treetypes. This is usefull when the information can change before
            // the next time it is opened. So the data will be more accurate.
            Procedure OnItemCollapsed Handle hItem
                Set ItemSelectedImage hItem to tvSysInfoBookClosedBmp
                Set ItemImage hItem to tvSysInfoBookClosedBmp
                Send DoDeleteChildItems hItem
            End_Procedure // OnItemCollapsed
            
            // This function enumerates the whole treeview and exports the item label of each treeview item
            // into an xml object. The recursionlevel and the itemtype are exported as attributes
            Procedure DoEnumerateTreeForXMLExport Handle hItem Integer iRecurseLevel Integer hoXMLRoot
                Handle hChildItem
                Integer hoXMLChildRoot hoElement iItemType
                String sItemLabel
            
                If (hoXMLRoot <> 0) Begin
                    Move (WindowsMessage (TVM_GETNEXTITEM, TVGN_CHILD, hItem)) to hChildItem
                    If (hChildItem <> 0) Begin
                        Move (Low (ItemData (Self, hItem))) to iItemType
                        Get ItemLabel hItem to sItemLabel
                        Get AddElement of hoXMLRoot C_$Item sItemLabel to hoXMLChildRoot
                        If (hoXMLChildRoot <> 0) Begin
                            Send AddAttribute of hoXMLChildRoot C_$Itemtype iItemType
                            Send DoEnumerateTreeForXMLExport hChildItem (iRecurseLevel + 1) hoXMLChildRoot
                            Send Destroy of hoXMLChildRoot
                        End
                    End
                    Else Begin
                        If (hoXMLRoot <> 0) Begin
                            Move (Low (ItemData (Self, hItem))) to iItemType
                            Get ItemLabel hItem to sItemLabel
                            Get AddElement of hoXMLRoot C_$Item sItemLabel to hoElement
                            If (hoElement <> 0) Begin
                                Send AddAttribute of hoElement C_$Itemtype iItemType
                                Send Destroy of hoElement
                            End
                        End
                    End
            
                    Move (WindowsMessage (TVM_GETNEXTITEM, TVGN_NEXT, hItem)) to hItem
                    If (hItem <> 0) Begin
                        Send DoEnumerateTreeForXMLExport hItem iRecurseLevel hoXMLRoot
                    End
                End
            End_Procedure // DoEnumerateTreeForXMLExport
            
            Procedure DoAddMetaData Integer hoDocumentRoot
                Integer hoElement hoItemTypeElement
            
                Get AddElement of hoDocumentRoot C_$Metadata "" to hoElement
                If (hoElement <> 0) Begin
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoUserBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoUserBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoUserBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoUserBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysWindowsLocaleBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysWindowsLocaleBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysWindowsLocaleBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysWindowsLocaleBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataBaseDriversBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataBaseDriversBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataBaseDriversBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataBaseDriversBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoVersionBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoVersionBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoVersionBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoVersionBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoVersionsOfBinDirBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoVersionsOfBinDirBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoVersionsEnumeratedModulesDirBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoVersionsEnumeratedModulesDirBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoWorkSpaceBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoWorkSpaceBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoWorkSpaceBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoWorkSpaceBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoMemoryBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoMemoryBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoMemoryBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoMemoryBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoFilesDirBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoFilesDirBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoFilesDirBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoFilesDirBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoKeyboardBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoKeyboardBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoKeyboardBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoKeyboardBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoAccKeysBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoAccKeysBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoAccKeysBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoAccKeysBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoRegistrationBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoRegistrationBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement "itemtype" "tiSysInfoRegistrationBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoRegistrationBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataBaseServersBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataBaseServersBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataBaseServersBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataBaseServersBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoGlobalAttributesBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoGlobalAttributesBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoGlobalAttributesBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoGlobalAttributesBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoGlobalVariablesBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoGlobalVariablesBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoGlobalVariablesBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoGlobalVariablesBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoSystemMetricsBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoSystemMetricsBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoSystemMetricsBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoSystemMetricsBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoSysConfBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoSysConfBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoSysConfBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoSysConfBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataFilesBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataFilesBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataFilesFilesBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataFilesFilesBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataFilesAttributesBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataFilesAttributesBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataFilesFieldsBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataFilesFieldsBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataFilesIndexesBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataFilesIndexesBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoDataFilesBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoDataFilesBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoApplicationBranch" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoApplicationBranch
                        Send Destroy of hoItemTypeElement
                    End
                    Get AddElement of hoElement C_$Itemtype "tiSysInfoApplicationBranchItem" to hoItemTypeElement
                    If (hoItemTypeElement <> 0) Begin
                        Send AddAttribute of hoItemTypeElement C_$Value tiSysInfoApplicationBranchItem
                        Send Destroy of hoItemTypeElement
                    End
                    Send Destroy of hoElement
                End
            End_Procedure // DoAddMetaData
            
            // This method is called to export all treeview information in a XML document. To do this we
            // need to open all treeview items first. The filename will be always sysinfo.xml stored in the
            // first directory of the datapath. If there is no workspace object the file will be created in
            // the current windows directory.
            Procedure DoExportToXML
                Handle hRootItem
                Integer hoXML hoDocumentRoot hoProcessInstructionNode iResult hoCommentNode hoWorkSpace
                String sDataPath
                Boolean bErr
            
                Get Create U_cXMLDomDocument to hoXML
                If (hoXML <> 0) Begin
                    If (ghoApplication <> 0) Begin
                        Get phoWorkSpace of ghoApplication to hoWorkSpace
                    End
                    If (hoWorkSpace <> 0) Begin
                        Get psDataPath of hoWorkSpace to sDataPath
                        If (sDataPath <> "") Begin
                            Get PathAtIndex of hoWorkSpace sDataPath 1 to sDataPath
                            Move (Trim (sDataPath)) to sDataPath
                            If (Right (sDataPath, 1) <> SysConf (SYSCONF_DIR_SEPARATOR)) Begin
                                Move (sDataPath - SysConf (SYSCONF_DIR_SEPARATOR)) to sDataPath
                            End
                        End
                    End
                    Set psDocumentName of hoXML to (Trim (sDataPath) - "SysInfo.XML")
                    Get CreateDocumentElement of hoXML C_$XMLExportSysteminfo to hoDocumentRoot
                    If (hoDocumentRoot <> 0) Begin
                        Get CreateChildProcessingInstruction of hoDocumentRoot "xml" 'version="1.0" encoding="UTF-8" standalone="yes"' to hoProcessInstructionNode
                        If (hoProcessInstructionNode <> 0) Begin
                            Get InsertBeforeNode of hoXML hoProcessInstructionNode hoDocumentRoot to iResult
                            Send Destroy of hoProcessInstructionNode
                        End
                        Get CreateChildComment of hoXML (SFormat (C_$SysInfoXMLExportComment, String (CurrentDateTime ()))) to hoCommentNode
                        If (hoCommentNode <> 0) Begin
                            Get InsertBeforeNode of hoXML hoCommentNode hoDocumentRoot to iResult
                            Send Destroy of hoCommentNode
                        End
                        Get RootItem to hRootItem
                        Send DoEnumerateTree Msg_OnItemExpanding hRootItem 0
                        Send DoAddMetaData hoDocumentRoot
                        Send DoEnumerateTreeForXMLExport hRootItem 0 hoDocumentRoot
                        Send DoEnumerateTree Msg_OnItemCollapsed hRootItem 0
                        Send Destroy of hoDocumentRoot
                        Get SaveXMLDocument of hoXML to bErr
                        If (not (bErr)) Begin
                            Send Info_Box (SFormat (C_$XMLExportTo, psDocumentName (hoXML), C_$Successfull))
                        End
                        Else Begin
                            Send Stop_Box (SFormat (C_$XMLExportTo, psDocumentName (hoXML), C_$NotSuccessfull))
                        End
                    End
                    Send Destroy of hoXML
                End
            End_Procedure // DoExportToXML
            //AB-StoreEnd

        End_Object    // oSystemInfoTreeView


        //AB-StoreStart
        // Since the real export takes place in the treeview we will redirect this message to
        // export to the treeview.
        Procedure DoRequestExportToXML
            Send DoExportToXML of oSystemInfoTreeView
        End_Procedure // DoRequestExportToXML
        //AB-StoreEnd

    End_Object    // oBox

    Object oXMLExportButton is a Button
        Set Label to "&XML export"
        Set Location to 157 230
        Set peAnchors to anBottomRight

        //AB-StoreStart
        // Start the XML export of the treeview data. Tell the user to be patient by changing the
        // cursor shape.
        Procedure OnClick
            Integer hoCursorControl
        
            Move Cursor_Control to hoCursorControl
            Send Cursor_Wait of hoCursorControl
            Send DoRequestExportToXML of oBox
            Send Cursor_Ready of hoCursorControl
        End_Procedure // OnClick
        //AB-StoreEnd

    End_Object    // oXMLExportButton

    Object oOkButton is a Button
        Set Label to "&OK"
        Set Location to 157 285
        Set peAnchors to anBottomRight
        Set Default_State to True

        //AB-StoreStart
        // Just close the systeminfo panel
        Procedure OnClick
            Send Close_Panel
        End_Procedure // OnClick
        //AB-StoreEnd

    End_Object    // oOkButton


    //AB-StoreStart
    // Tell the object what to do if the following keys are pressed.
    On_Key kCancel Send KeyAction of oOkButton
    On_Key Key_Alt+Key_O Send KeyAction of oOkButton
    On_Key Key_Alt+Key_X Send KeyAction of oXMLExportButton
    
    // Make the panel show centered on the screen
    Set Locate_Mode to CENTER_ON_SCREEN
    //AB-StoreEnd

End_Object    // oSystemInformationDialog


//AB-StoreStart

//AB-StoreEnd

//AB/ End_Object    // prj