Source code of Windows XP (NT5)
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.

52 lines
1.0 KiB

  1. '
  2. L_Welcome_MsgBox_Message_Text = "This script demonstrates how to manipulate MMC Application visibility."
  3. L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample"
  4. Call Welcome()
  5. ' ********************************************************************************
  6. Dim mmc
  7. set mmc = wscript.CreateObject("MMC20.Application")
  8. bVisible = mmc.Visible
  9. For i = 0 To 10 Step 1
  10. If bVisible Then
  11. ' If UserControl == True, below hide will fail
  12. mmc.Hide
  13. Else
  14. mmc.Show
  15. End If
  16. If mmc.UserControl Then
  17. mmc.UserControl = False
  18. mmc.Hide
  19. Else
  20. mmc.UserControl = True
  21. End If
  22. bVisible = mmc.Visible
  23. Next
  24. set mmc = Nothing
  25. ' ********************************************************************************
  26. ' *
  27. ' * Welcome
  28. ' *
  29. Sub Welcome()
  30. Dim intDoIt
  31. intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
  32. vbOKCancel + vbInformation, _
  33. L_Welcome_MsgBox_Title_Text )
  34. If intDoIt = vbCancel Then
  35. WScript.Quit
  36. End If
  37. End Sub