Sample Internal Webbrowser script

From MediaMonkey Wiki
Jump to: navigation, search
' Sample Internal Webbrowser script

' This auto-script uses the internal webbrowser to show a web page when a custom node is clicked.
' The internal webbrowser control is only visible when the node's OnNodeFocused function is correctly implemented.
' The webbrowser is displayed where the tracks listing is normally located.

Sub OnStartup 
  Dim Tree : Set Tree = SDB.MainTree 

  Dim Node : Set Node = Tree.CreateNode 
  Node.Caption = "MediaMonkey Website" 
  Node.IconIndex = 0 
  Script.RegisterEvent Node, "OnNodeFocused", "NodeFocus" 
  Script.RegisterEvent Tree.Node_Artist, "OnNodeFocused", "NodeFocus" 

  Tree.AddNode Tree.Node_Artist, Node, 1     ' Insert our node below the Artist node 
  Node.HasChildren = False 
End Sub 

Function NodeFocus(Node) 
  NodeFocus = 2 
  SDB.WebControl.Navigate "" 
End Function