Chris - hope you don't mind but I'm hijacking your KiXomatic code (read stealing) for use in the first forms ListView script. This application really lends itself to this kind of presentation ...
Anyways .. that EnumClasses thingy you wrote ... have you posted that to the UDF forum ... is there already one like it there. Just as an FYI and in terms of experimentation - I modified your function to get make it more generic (passing the class filter as a parm) plus, returning an array of class strings plus - passing a reference to an optional progress bar (instead of hard coding it) ... just thought I would open-up a dialog because I really like your KiXomatic script ...
Usage (Forms 2.1):
code:
For Each $Class In WmiEnumClasses("WIN32_",$Progress)
$Item = $ClassList.Items.Add($Class)
Next
Script:
code:
Function WmiEnumClasses(Optional $Filter, Optional $Progress)
If Not $Filter
$Filter = "WIN32_"
Endif
Dim $WMI,$Class,$Qualifier,$IsQ
Dim $Bounds,$Count,$Increment
Dim $Array[400]
$Count = 0
$Increment = 100
$Bounds = UBound($Array)
$WMI = GetObject("winmgmts:\\.\root\cimv2")
If $Progress
$Progress.Min = 0
$Progress.Max = 0
$Progress.Value = 0
For Each $Class in $WMI.SubclassesOf()
$Progress.Max = $Progress.Max + 1
Next
EndIf
For Each $Class in $WMI.SubclassesOf()
$Progress.Value = $Progress.Value + 1
$IsQ = 0
If Instr($Class.Path_.Class,$Filter);
For Each $Qualifier in $objClass.Qualifiers_
If Instr($Qualifier.Name, "ASSOCIATION")
$IsQ = 1
Endif
Next
If $IsQ = 0
$Array[$count] = $Class.Path_.Class
$Count = $Count + 1
If $Count > $Bounds
$Bounds = $Bounds + $Increment
ReDim Preserve $Array[$Bounds]
EndIf
EndIf
EndIf
Next
If $Count
ReDim Preserve $Array[$Count-1]
EndIf
If $Progress
$Progress.Value = 0
EndIf
$WmiEnumClasses = $Array
$WMI = 0
EndFunction
[ 26. September 2002, 15:23: Message edited by: Shawn ]