Here's kinda where I'm heading with this ... hope it works (if you try it) because I'm running 2.1 here - hope I'm not using any of the new methods or properties ... should work under 2.0
Couple of things ... Its got an embedded progress bar in the status bar (kinda like IE) and its got a realtime clock in the status bar ... other than that ... just lists the WMI classes right now.
code:
Break On
$TITLE = "WmiList"
$WIDTH = 400
$HEIGHT = 300
$MARGIN = 4
$Form = CreateObject("Kixtart.Form")
$Form.ClientWidth = $WIDTH
$Form.ClientHeight = $HEIGHT
$Form.FontSize = 10
$Form.Caption = $TITLE
$Status = $Form.Label()
$Status.Left = $MARGIN
$Status.Top = $Form.ClientHeight - 25
$Status.Width = 0.4 * $Form.ClientWidth
$Status.Height = 20
$Status.BorderStyle = 5
$Status.Text = "Ready..."
$Progress = $Form.ProgressBar()
$Progress.Left = $Status.Right + $MARGIN
$Progress.Top = $Form.ClientHeight - 25
$Progress.Width = 0.4 * $Form.ClientWidth
$Progress.Height = 20
$Progress.BorderStyle = 5
$Progress.ForeColor = 0,200,0 ; Green
$Clock = $Form.Label()
$Clock.Left = $Progress.Right + $MARGIN
$Clock.Top = $Form.ClientHeight - 25
$Clock.Width = $Form.ClientWidth-$Progress.Right-$MARGIN*2
$Clock.Height = 20
$Clock.BorderStyle = 5
$Clock.Text = "Ready..."
$Timer = $Form.Timer(1000)
$Timer.OnTimer = "OnTimer()"
Function OnTimer()
$Clock.Text = @TIME
EndFunction
$List = $Form.ListBox
$List.Sorted = 1
$List.Top = 5
$List.Left = 5
$List.Right = $Form.ClientWidth - $MARGIN
$List.Bottom = $Status.Top - $MARGIN
$Form.Center
$Form.Show
$Form.MousePointer = 11
$Form.Enabled = 0
$Status.Text = "Loading classes..."
$List.List = WmiEnumClasses("WIN32_",$Progress)
$Status.Text = "Ready"
$Form.Enabled = 1
$Form.MousePointer = 0
While $Form.Visible
$= Execute($Form.DoEvents)
Loop
Exit 1
Function WmiEnumClasses(Optional $Filter, Optional $Progress)
If Not $Filer
$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