AW: Internet Explorer maximieren
08.07.2004 00:04:52
Philipp
Hallo Folker
Ich habe eine Lösung gebastelt, die das IE-Fenster zwar nicht maximiert, aber wenigstens unter Berücksichtigung der Auflösung bildschirmfüllend anzeigt.
Option Explicit
Declare
Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Declare
Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Declare
Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Const HORZRES = 8
Const VERTRES = 10
Function GetScreenRes()
Dim lRval As Long
Dim lDc As Long
Dim lHSize As Long
Dim lVSize As Long
lDc = GetDC(0&)
lHSize = GetDeviceCaps(lDc, HORZRES)
lVSize = GetDeviceCaps(lDc, VERTRES)
lRval = ReleaseDC(0, lDc)
GetScreenRes = lHSize & "x" & lVSize
End Function
Sub RunIE()
Dim strSize As String
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Visible = True
.AddressBar = True
strSize = GetScreenRes
.Width = Left(strSize, InStr(strSize, "x") - 1)
.Height = Right(strSize, Len(strSize) - InStr(strSize, "x"))
.Left = 0
.Top = 0
.Navigate <a href=""http://xxx.de"">"http://xxx.de"</a>
End With
Do Until objIE.ReadyState = 1
DoEvents
Loop
End Sub
Übrigens erhältst du den Handle der IE-Instanz mit objIE.Hwnd.
Gruss
Philipp
¦¦¦ xlam - Excel and more!
¦¦¦ http://195.186.84.74/index.htm