From: Norm on
Mayayana wrote :
>> This problem is kind of like all the trouble
>> everyone seems to have with just getting IE to open maximized. I was
>> surprised to find that using automation with IE that there was no
>> maximized setting. :o)
>>
>
> Almost everything is in there, but it's not all
> ideally designed. There's TheaterMode (but don't
> try to use that in combination with height/width
> values in IE7/8). There are left/top/width/height
> values. The Window object has 2 or 3 methods.
> Etc.
>
> The following simple VBScript demonstrates one
> method:
>
> Dim IE
> Set IE = CreateObject("InternetExplorer.Application")
> IE.Navigate "about:blank"
> Do While IE.ReadyState <> 4
> Loop
> IE.Visible = True
> IE.left = 0
> IE.top = 0
> IE.width = IE.document.parentwindow.screen.availwidth
> IE.height = IE.document.parentwindow.screen.availheight
>
>
> But there are problems with doing IE automation that's
> not targetted to a specific situation. There are 3 distinct
> issues aside from the issue of the DOM complexity:
>
> 1) Different versions of IE are different.
>
> 2) Starting with IE6 MS started trying to plan for security.
> For instance, one used to be able to open a window in
> theatermode (no chrome), set the size, dynamically write
> the document content, and thereby create a msgbox that
> looks just like a system msgbox. One also used to be able
> to open an IE instance offscreen for various purposes. Those
> functions were disabled for security reasons. ...It makes sense,
> but MS makes different changes with each IE version, and
> much of what makes IE automation so flexible involves hacks,
> so the changes often break old code.
> The security changes also involve all sorts of weirdo moves
> like blocking downloads of certain file types even when downloads
> are enabled... or showing the "information bar" to require specifically
> allowing one thing or another... or preventing people from adjusting
> local security settings...etc. As usual, Microsoft approached
> the problem with excessive complexity and poor planning. So now
> IE 7/8 users are free to get attacked by a driveby download --
> and good luck to anyone who wants to adjust the script settings
> that make that possible -- but only the tech-savvy can manage
> to download an unsigned EXE.
> The cookie issues you're running into may be connected with
> security settings that vary by IE version.
>
> 3) Starting with IE6 MS decided to start conforming to basic
> W3C agreement about Document structure. Again, they're
> not consistent from one IE version to another. And now the IE
> DOM in force depends on the content of the webpage loaded!
> If the webpage contains one of several specific DOCTYPE tags
> it will be treated as W3C conforming and the traditional IE
> DOM will be broken. If the necessary DOCTYPE is not present
> the page will be treated with "quirks mode", using the IE5
> DOM, and the W3C methods will be broken. (I think there's also
> a new META option to tell IE which IE version to emulate.)
>
> So to make a long story short, you can do almost anything
> you can think of with IE, but the version, security settings,
> and DOCTYPE can all affect exactly how it's done.

Mike, thanks for the information I will play around with that. I had a
routine to find the available size of the screen and then set the left,
top, width and height of the window. It just seemed really funny that
MS did not have a way to maximize the window. While searching I found a
lot of questions from users trying to get IE to open maximized and what
they were having to go through for something as simple as that.

Mayayana, thanks also for the information. It seems that MS quite often
takes the hard way to do things, and not always the best. :D

I was thinking of trying to make a vb program to play some web games,
but since I am still at the beginner level I am not sure I will be able
to accomplish it, but will probably try. There are a lot of what they
call game cheats out there, but I think most of them are written in
Java, not sure if any are done in vb. But thanks again everyday I learn
something, although some days I think I go backwards. lol

Norm


From: Mike S on
On 7/29/2010 1:38 PM, Norm wrote:
> Mayayana wrote :
>>> This problem is kind of like all the trouble
>>> everyone seems to have with just getting IE to open maximized. I was
>>> surprised to find that using automation with IE that there was no
>>> maximized setting. :o)
>>>
>>
>> Almost everything is in there, but it's not all
>> ideally designed. There's TheaterMode (but don't
>> try to use that in combination with height/width
>> values in IE7/8). There are left/top/width/height
>> values. The Window object has 2 or 3 methods.
>> Etc.
>>
>> The following simple VBScript demonstrates one
>> method:
>>
>> Dim IE
>> Set IE = CreateObject("InternetExplorer.Application")
>> IE.Navigate "about:blank"
>> Do While IE.ReadyState <> 4
>> Loop
>> IE.Visible = True
>> IE.left = 0
>> IE.top = 0
>> IE.width = IE.document.parentwindow.screen.availwidth
>> IE.height = IE.document.parentwindow.screen.availheight
>>
>>
>> But there are problems with doing IE automation that's
>> not targetted to a specific situation. There are 3 distinct
>> issues aside from the issue of the DOM complexity:
>>
>> 1) Different versions of IE are different.
>>
>> 2) Starting with IE6 MS started trying to plan for security.
>> For instance, one used to be able to open a window in
>> theatermode (no chrome), set the size, dynamically write
>> the document content, and thereby create a msgbox that
>> looks just like a system msgbox. One also used to be able
>> to open an IE instance offscreen for various purposes. Those
>> functions were disabled for security reasons. ...It makes sense,
>> but MS makes different changes with each IE version, and
>> much of what makes IE automation so flexible involves hacks,
>> so the changes often break old code.
>> The security changes also involve all sorts of weirdo moves
>> like blocking downloads of certain file types even when downloads
>> are enabled... or showing the "information bar" to require specifically
>> allowing one thing or another... or preventing people from adjusting
>> local security settings...etc. As usual, Microsoft approached
>> the problem with excessive complexity and poor planning. So now
>> IE 7/8 users are free to get attacked by a driveby download --
>> and good luck to anyone who wants to adjust the script settings
>> that make that possible -- but only the tech-savvy can manage
>> to download an unsigned EXE.
>> The cookie issues you're running into may be connected with
>> security settings that vary by IE version.
>>
>> 3) Starting with IE6 MS decided to start conforming to basic
>> W3C agreement about Document structure. Again, they're
>> not consistent from one IE version to another. And now the IE
>> DOM in force depends on the content of the webpage loaded!
>> If the webpage contains one of several specific DOCTYPE tags
>> it will be treated as W3C conforming and the traditional IE
>> DOM will be broken. If the necessary DOCTYPE is not present
>> the page will be treated with "quirks mode", using the IE5
>> DOM, and the W3C methods will be broken. (I think there's also
>> a new META option to tell IE which IE version to emulate.)
>>
>> So to make a long story short, you can do almost anything
>> you can think of with IE, but the version, security settings,
>> and DOCTYPE can all affect exactly how it's done.
>
> Mike, thanks for the information I will play around with that. I had a
> routine to find the available size of the screen and then set the left,
> top, width and height of the window. It just seemed really funny that MS
> did not have a way to maximize the window. While searching I found a lot
> of questions from users trying to get IE to open maximized and what they
> were having to go through for something as simple as that.
>
> Mayayana, thanks also for the information. It seems that MS quite often
> takes the hard way to do things, and not always the best. :D
>
> I was thinking of trying to make a vb program to play some web games,
> but since I am still at the beginner level I am not sure I will be able
> to accomplish it, but will probably try. There are a lot of what they
> call game cheats out there, but I think most of them are written in
> Java, not sure if any are done in vb. But thanks again everyday I learn
> something, although some days I think I go backwards. lol
>
> Norm

Norm, Apologies, I overlooked using the IE.hwnd - this works for me:

Option Explicit

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long,
ByVal nCmdShow As Long) As Long

Private Const SW_MAXIMIZE = 3

Public IE As Object

Private Sub btnOpenNewIE_Click()
Dim oCol As IHTMLElementCollection
Dim oElement As IHTMLElement
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate2 "http://my.msn.com/"
Do While IE.ReadyState <> READYSTATE_COMPLETE
Sleep 100
DoEvents
Loop
ShowWindow IE.hwnd, SW_MAXIMIZE
Set oCol = IE.Document.All.tags("INPUT")
For Each oElement In oCol
Debug.Print oElement.Classname & " " & oElement.Name & " " &
oElement.innerHTML
Next
End Sub

Mike
From: Norm on
Mike S formulated on Thursday :
> On 7/29/2010 1:38 PM, Norm wrote:
>> Mayayana wrote :
>>>> This problem is kind of like all the trouble
>>>> everyone seems to have with just getting IE to open maximized. I was
>>>> surprised to find that using automation with IE that there was no
>>>> maximized setting. :o)
>>>>
>>>
>>> Almost everything is in there, but it's not all
>>> ideally designed. There's TheaterMode (but don't
>>> try to use that in combination with height/width
>>> values in IE7/8). There are left/top/width/height
>>> values. The Window object has 2 or 3 methods.
>>> Etc.
>>>
>>> The following simple VBScript demonstrates one
>>> method:
>>>
>>> Dim IE
>>> Set IE = CreateObject("InternetExplorer.Application")
>>> IE.Navigate "about:blank"
>>> Do While IE.ReadyState <> 4
>>> Loop
>>> IE.Visible = True
>>> IE.left = 0
>>> IE.top = 0
>>> IE.width = IE.document.parentwindow.screen.availwidth
>>> IE.height = IE.document.parentwindow.screen.availheight
>>>
>>>
>>> But there are problems with doing IE automation that's
>>> not targetted to a specific situation. There are 3 distinct
>>> issues aside from the issue of the DOM complexity:
>>>
>>> 1) Different versions of IE are different.
>>>
>>> 2) Starting with IE6 MS started trying to plan for security.
>>> For instance, one used to be able to open a window in
>>> theatermode (no chrome), set the size, dynamically write
>>> the document content, and thereby create a msgbox that
>>> looks just like a system msgbox. One also used to be able
>>> to open an IE instance offscreen for various purposes. Those
>>> functions were disabled for security reasons. ...It makes sense,
>>> but MS makes different changes with each IE version, and
>>> much of what makes IE automation so flexible involves hacks,
>>> so the changes often break old code.
>>> The security changes also involve all sorts of weirdo moves
>>> like blocking downloads of certain file types even when downloads
>>> are enabled... or showing the "information bar" to require specifically
>>> allowing one thing or another... or preventing people from adjusting
>>> local security settings...etc. As usual, Microsoft approached
>>> the problem with excessive complexity and poor planning. So now
>>> IE 7/8 users are free to get attacked by a driveby download --
>>> and good luck to anyone who wants to adjust the script settings
>>> that make that possible -- but only the tech-savvy can manage
>>> to download an unsigned EXE.
>>> The cookie issues you're running into may be connected with
>>> security settings that vary by IE version.
>>>
>>> 3) Starting with IE6 MS decided to start conforming to basic
>>> W3C agreement about Document structure. Again, they're
>>> not consistent from one IE version to another. And now the IE
>>> DOM in force depends on the content of the webpage loaded!
>>> If the webpage contains one of several specific DOCTYPE tags
>>> it will be treated as W3C conforming and the traditional IE
>>> DOM will be broken. If the necessary DOCTYPE is not present
>>> the page will be treated with "quirks mode", using the IE5
>>> DOM, and the W3C methods will be broken. (I think there's also
>>> a new META option to tell IE which IE version to emulate.)
>>>
>>> So to make a long story short, you can do almost anything
>>> you can think of with IE, but the version, security settings,
>>> and DOCTYPE can all affect exactly how it's done.
>>
>> Mike, thanks for the information I will play around with that. I had a
>> routine to find the available size of the screen and then set the left,
>> top, width and height of the window. It just seemed really funny that MS
>> did not have a way to maximize the window. While searching I found a lot
>> of questions from users trying to get IE to open maximized and what they
>> were having to go through for something as simple as that.
>>
>> Mayayana, thanks also for the information. It seems that MS quite often
>> takes the hard way to do things, and not always the best. :D
>>
>> I was thinking of trying to make a vb program to play some web games,
>> but since I am still at the beginner level I am not sure I will be able
>> to accomplish it, but will probably try. There are a lot of what they
>> call game cheats out there, but I think most of them are written in
>> Java, not sure if any are done in vb. But thanks again everyday I learn
>> something, although some days I think I go backwards. lol
>>
>> Norm
>
> Norm, Apologies, I overlooked using the IE.hwnd - this works for me:
>
> Option Explicit
>
> Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
> Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal
> nCmdShow As Long) As Long
>
> Private Const SW_MAXIMIZE = 3
>
> Public IE As Object
>
> Private Sub btnOpenNewIE_Click()
> Dim oCol As IHTMLElementCollection
> Dim oElement As IHTMLElement
> Set IE = CreateObject("InternetExplorer.Application")
> IE.Visible = True
> IE.Navigate2 "http://my.msn.com/"
> Do While IE.ReadyState <> READYSTATE_COMPLETE
> Sleep 100
> DoEvents
> Loop
> ShowWindow IE.hwnd, SW_MAXIMIZE
> Set oCol = IE.Document.All.tags("INPUT")
> For Each oElement In oCol
> Debug.Print oElement.Classname & " " & oElement.Name & " " &
> oElement.innerHTML
> Next
> End Sub
>
> Mike

Mike,

No problem, I had already figured that out as at one time I had used
the Ie.hwnd for SetForegroundWindow.

Sometimes the days are just too long. :D

Norm