Some people have asked questions about why the scale is off when they load the RS Applet. I did that for my client as an example. Here is how you should implement it if you don't want scale issues:
Loader Module:
Code:
Public Function GetRS(ByVal WB As WebBrowser) As IntPtr
Dim sClass As New System.Text.StringBuilder("", 256)
Dim WndList() As IntPtr = GetChildWindows(WB.Handle)
For i = 0 To UBound(WndList)
GetClassName(WndList(i), sClass, 256)
If sClass.ToString = "SunAwtFrame" Then
'Found the RS Applet
Return WndList(i)
Exit Function
End If
Next
Return -1
End Function
Form Code:
Code:
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rWND As System.Drawing.Rectangle
Dim wb As New WebBrowser
Controls.Add(wb)
wb.Navigate("http://www.runescape.com/game.ws?j=1")
Do Until wb.ReadyState = 4
Application.DoEvents()
Loop
RSApplet = GetRS(wb)
If RSApplet = -1 Then
MsgBox("Could not load RS, you fail")
Else
RSlist = GetChildWindows(RSApplet)
GetWindowRect(RSApplet, rWND)
SetParent(RSApplet, Me.Handle)
MoveWindow(RSApplet, 0, 0, rWND.Width, rWND.Height, True)
End If
Controls.Remove(wb)
End Sub