This is an example script file I'd like to use to be shipped with the plugin, which is an Internet Explorer object:
- Code: Select all
Set Screen = CreateObject("InternetExplorer.Application")
Screen.FullScreen = True
Screen.TheaterMode = True
ScreenWidth = Screen.Width
ScreenHeight = Screen.Height
Screen.Quit
Set objShell = CreateObject("Wscript.Shell")
Set IE = CreateObject("InternetExplorer.Application")
Sub CheckIt
If IE.document.parentWindow.event.keycode = 27 Then bEsc = True
End Sub
With IE
.FullScreen = False
.TheaterMode = False
.MenuBar = False
.StatusBar = False
.ToolBar = False
.Resizable = False
.Width = 640
.Height = 480
.ClientToWindow .Width, .Height
.Left = (ScreenWidth / 2) - (.Width / 2)
.Top = (ScreenHeight / 2) - (.Height / 2)
.Navigate "http://www.yoyogames.com/"
.Visible = True
Set Processes = GetObject("winmgmts:").InstancesOf("Win32_Process")
intProcessId = ""
For Each Process In Processes
If StrComp(Process.Name, "iexplore.exe", vbTextCompare) = 0 Then
intProcessId = Process.ProcessId
Exit For
End If
Next
If Len(intProcessId) > 0 Then
objShell.AppActivate intProcessId
End If
If .FullScreen = True Or .TheaterMode = True Then
Do While bEsc = False And (err.number = 0)
Do While .Busy
Dim dteWait
dteWait = DateAdd("s", 0.000001, Now())
Do Until (Now() > dteWait)
Loop
Loop
Set .document.body.onkeypress = GetRef("CheckIt")
For i = 1 To 100
If (err.number <> 0) Or bEsc Then Exit Do
Next
Loop
.Visible = False
.Quit
End If
End With
However, the ClientToWindow method doesn't appear to be working. It's supposed to convert the client area, (not including the window border), to equal 640x480, but it doesn't seem to be doing that, or anything, for that matter. The entire window, (including the border), is 640x480, so it's not the right size.
Anyone with experience in regular VBScript know what I'm doing wrong or how to solve this?
Thanks!
Samuel