Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. VERSION 5.00
  2. Begin VB.Form Form1
  3. Caption = "Form1"
  4. ClientHeight = 3285
  5. ClientLeft = 60
  6. ClientTop = 345
  7. ClientWidth = 10695
  8. LinkTopic = "Form1"
  9. ScaleHeight = 3285
  10. ScaleWidth = 10695
  11. StartUpPosition = 3 'Windows Default
  12. Begin VB.Timer Timer
  13. Interval = 10
  14. Left = 720
  15. Top = 2760
  16. End
  17. Begin VB.ListBox List
  18. Height = 2010
  19. ItemData = "execquery.frx":0000
  20. Left = 240
  21. List = "execquery.frx":0002
  22. TabIndex = 0
  23. Top = 600
  24. Width = 10095
  25. End
  26. End
  27. Attribute VB_Name = "Form1"
  28. Attribute VB_GlobalNameSpace = False
  29. Attribute VB_Creatable = False
  30. Attribute VB_PredeclaredId = True
  31. Attribute VB_Exposed = False
  32. Dim objEnum As ISEnumWbemObject
  33. Private Sub Form_Load()
  34. ' The following sample registers to be informed whenever an instance
  35. ' of the class MyClass is created
  36. Dim objServices As ISWbemServices
  37. Dim objEvent As ISWbemObject
  38. Set objServices = GetObject("cim:root/default")
  39. Set objEnum = objServices.ExecNotificationQuery("select * from __instancecreationevent where targetinstance isa 'MyClass'")
  40. End Sub
  41. Private Sub Timer_Timer()
  42. For Each objEvent In objEnum
  43. List.AddItem "Got an event"
  44. Exit Sub
  45. Next
  46. End Sub