RunProgram> ignores RP_WINDOWMODE=0 with IE11

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

RunProgram> ignores RP_WINDOWMODE=0 with IE11

Post by jpuziano » Wed Apr 08, 2015 10:15 pm

Hi Marcus and everyone,

I just observed the following in Macro Scheduler 14.2.03...

In the RunProgram> command...

By setting the RP_WINDOWMODE variable programs can be executed minimized, maximised, hidden or normal. RP_WINDOWMODE can be one of the following :

0: Hidden
1: Normal (default)
2: Minimized
3: Maximized

...so I use the following to open a new browser window hidden...

Code: Select all

//make the window hidden
Let>RP_WINDOWMODE=0

//line below will instantiate a new IE window which will be hidden and NOT EVEN FLASH 
Run>C:\Program Files\Internet Explorer\iexplore.exe about:blank

//reset to normal
Let>RP_WINDOWMODE=1
The above works fine on a machine with IE8 installed as the default browser... the IE window is created hidden so there is no annoying flashing of the window and I work with it further using VBScript.

Then I tried the exact same code on a machine with IE11 installed as the default browser and it does not work the same. The new IE11 browser window does get created however it is not hidden!

Marcus is this a bug with the RunProgram> command wrt IE11? If so, please fix as it would be great if this worked as well with IE11 as it does with IE8.


So then I tried to achieve this using the new native IE commands... I came up with the following:

Code: Select all

//Create new IE instance and return new IE instance handle in IE[0] variable
IECreate>IE[0]

//Hide IE[0] instance as fast as we can!
IEShowIE>IE[0],0

MDL>New IE window should be hidden but did it flash? Click OK and I will show it...

//Show IE[0] instance
IEShowIE>IE[0],1
The above does work but unfortunately... IECreate> will by default create the new IE window in visible mode... and IEShowIE> must be run to change it to hidden mode... so we end up seeing a FLASHING of the window because we just can't hide it fast enough.

Marcus, is there any way to change the behavior of IECreate> so that it could open a new IE window in HIDDEN mode instead?

Another IECreate> parameter maybe?

Or even a new System Variable (directive) we could set to control this... so if we did the following...

Let>IE_CREATE_HIDDEN=1

...then IECreate> would then create the new IE window as hidden.

I believe this would be a good feature as often its nice to be able to re-size, position and navigate a browser window to a particular page BEFORE showing it to a user... so if we could create them hidden in the first place we could do all this and show them when ready... and no flashing would be seen.

Of course if RunProgram> could be fixed so that it honors RP_WINDOWMODE=0 then that would also work as well.

Or... if someone out there know how to achieve this with IE11 installed as the default browser and NO flashing, then please share.

Thanks and take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: RunProgram> ignores RP_WINDOWMODE=0 with IE11

Post by Marcus Tettmar » Fri Apr 10, 2015 8:57 am

Unfortunately we have no control over how other apps behave. Would seem IE11 is ignoring Window's own instructions to start hidden. We can't change that. It's not a bug I'm afraid. Not with Macro Scheduler anyway. IE11 is just not obeying the instruction being sent to it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts