Scoho2098 Posted October 16, 2016 Share Posted October 16, 2016 PLATFORM: Windows 7, 32bit, Enterprise, 2 55" Monitors as Display units showing active data for a fleet of vehicles that refresh every 30 seconds. #1 Monitor on the right is set as Primary (Start/Task Bar) #2 Monitor on the Left. FACTS: Must load 2 IE Browser Sessions in Full Screen on 2 specific Monitors. One specific URL MUST be on the left The other MUST be on the right Must use IExplore. IExplore does NOT allow 2 Full Screen (F11) Session on 2 session/monitors One Session must be in Kiosk Mode (-k) on the Left Monitor The other Session must be in Full Screen (F11) on the Right Monitor Must load from StartUp Folder automatically when Rebooted or Started without any Keyboard, Mouse or user interaction. Must run as a standalone file, no other apps can be installed! No LogIn is required. Cannot presume to know the last state of the Browser Session! I've built 9 scripts in 12 hours and every one of them have at least one issue that fails to perform the task I've outlined above. I'm a noob with 12 hours of experience on AutoIt. I'm versed in HTML & CSS but AutoIt is a not venture for me. Every one of the scripts I built attempts to mock the actions I take with a keyboard and mouse to produce the results outlined above by hand. Every one of them fails in some way to perform a key function that works by my hand but fails in the script. Please help me figure out the best route to take. What I have struggled with so far is to get a Kiosk Mode Session opened to a specific URL on the Left Monitor (ID #2) regardless of where the last Session State was closed. What I have failed to accomplish is getting Kiosk Mode Session to move to, or guarantee to open in the Left Monitor regardless of other factors. Kiosk mode is opened using: Send("#r") Sleep(500) ; Open iexplore to URL Send("iexplore.exe -k www.google.com{Enter}") Please help me create a working script for this. Any idea is valid to me. If Javascript is a better option, I'll take advice that too! Thanks in advance. Link to comment Share on other sites More sharing options...
Danp2 Posted October 16, 2016 Share Posted October 16, 2016 First, you should get rid of the Send commands and look into the Run command. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
AutoBert Posted October 16, 2016 Share Posted October 16, 2016 (edited) Test this small example: #include <IE.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $oIEL=_IECreate('www.google.com') ConsoleWrite('Google: '&_IEPropertyGet($oIEL,'Title')&@CRLF) $hIEL=WinActivate('Google') ConsoleWrite($hIEL&@TAB&@error&@CRLF) WinMove($hIEL,'',0,0) ;change to your needs $oIER=_IECreate('https://www.autoitscript.com/forum/topic/185062-2-full-screen-ie-sessions-on-2-specific-monitors/') ConsoleWrite('AutoIt: '&_IEPropertyGet($oIER,'Title')&@CRLF) $hIER=WinActivate('AutoIt') ConsoleWrite($hIER&@TAB&@error&@CRLF) WinMove($hIER,'',500,0) ;change to your needs MsgBox(0,'Time to move','Please move your IEs to specific monitor'&@CRLF&@CRLF&'After press ok') WinSetState($hIEL,'',@SW_MAXIMIZE) WinSetState($hIER,'',@SW_MAXIMIZE) _IEPropertySet($oIEL,'theatermode',True) _IEPropertySet($oIER,'theatermode',True) Sleep(10000) $aIEL=WinGetPos($hIEL) ConsoleWrite('Left IE : ' & $aIEL[0]&@TAB&$aIEL[1]&@CRLF) $aIER=WinGetPos($hIER) ConsoleWrite('Right IE : ' & $aIER[0]&@TAB&$aIER[1]&@CRLF) _IEQuit($oIEL) _IEQuit($oIER) After you should all know what is needed to solve. Edited October 16, 2016 by AutoBert bug fix Link to comment Share on other sites More sharing options...
Scoho2098 Posted October 17, 2016 Author Share Posted October 17, 2016 Hi AutoBert. Code looks way more complicated than anything I had going. I just found out I gotta work a double shift through the night so I'm not going to be able to try it out until tomorrow. I'll let you know. Looks awesome! Thanks Link to comment Share on other sites More sharing options...
Scoho2098 Posted October 18, 2016 Author Share Posted October 18, 2016 OK, Finally home and trying this out. I spent some time trying to understand the code and worked out how most of this script worked. This particular script did not take 2 requirements into consideration to my OP list. The message box will have to go as this MUST load from Startup folder as a standalone and run without any user interaction. It literally must work after restarting the computer. There are no Mouse or keyboards available to the people viewing this. IE does not allow 2 IE sessions in Full Screen or TheaterMode, as the script calls it. This is why I must open IE in Kiosk mode! Kiosk mode must be on the left because it would block access to the Start Bar if it were on the Primary (Right) monitor. I must find a way to open the browser in Kiosk mode and guarantee it goes to the Left monitor or 0, 0 coord's. The only way to open IE in Kiosk mode is by running it via the Run box as such: 'iexplore.exe -k about:blank' I'm going to try to use what you put together here to create the needed script but help is still welcomed/needed. Thank You Link to comment Share on other sites More sharing options...
AutoBert Posted October 18, 2016 Share Posted October 18, 2016 2 hours ago, Scoho2098 said: This particular script did not take 2 requirements into consideration to my OP list. This is only a test script giving you the knowledge how to use _IECeate and WinMove. 2 hours ago, Scoho2098 said: The message box will have to go as this MUST load from Startup folder as a standalone and run without any user interaction. It literally must work after restarting the computer. There are no Mouse or keyboards available to the people viewing this. The messagebox is only needed in testscript to give you the time to move and size the IE as they should be shown in your final script. 2 hours ago, Scoho2098 said: IE does not allow 2 IE sessions in Full Screen or TheaterMode, as the script calls it. This is why I must open IE in Kiosk mode! Can't ack (have only 1 monitor). But if it is, than you can use Winmove setting also width and height: #include <IE.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $oIEL=_IECreate('www.google.com') ConsoleWrite('Google: '&_IEPropertyGet($oIEL,'Title')&@CRLF) $hIEL=WinActivate('Google') ConsoleWrite($hIEL&@TAB&@error&@CRLF) WinMove($hIEL,'',0,0,@DesktopWidth/2,@DesktopHeight) ;change to your needs $oIER=_IECreate('https://www.autoitscript.com/forum/topic/185062-2-full-screen-ie-sessions-on-2-specific-monitors/') ConsoleWrite('AutoIt: '&_IEPropertyGet($oIER,'Title')&@CRLF) $hIER=WinActivate('AutoIt') ConsoleWrite($hIER&@TAB&@error&@CRLF) WinMove($hIER,'',@DesktopWidth/2,0,@DesktopWidth/2,@DesktopHeight) ;change to your needs MsgBox(0,'Time to move','Please move and size your IEs to specific monitor'&@CRLF&@CRLF&'After press ok') ;WinSetState($hIEL,'',@SW_MAXIMIZE) ;WinSetState($hIER,'',@SW_MAXIMIZE) ;_IEPropertySet($oIEL,'theatermode',True) ;_IEPropertySet($oIER,'theatermode',True) ;Sleep(10000) $aIEL=WinGetPos($hIEL) ConsoleWrite('needed for Left IE : ' & $aIEL[0]&@TAB&$aIEL[1] & $aIEL[2]&@TAB&$aIEL[3]&@CRLF) $aIER=WinGetPos($hIER) ConsoleWrite('needed for Right IE : ' & $aIER[0]&@TAB&$aIER[1] & $aIER[2]&@TAB&$aIER[3]&@CRLF) MsgBox(0,'New Positions and sizes','look at scite console output') _IEQuit($oIEL) _IEQuit($oIER) Link to comment Share on other sites More sharing options...
Scoho2098 Posted October 18, 2016 Author Share Posted October 18, 2016 OK, so here is the AutoIt Rookie Noob Krazy A$$ script broken down to elementary actions and it still doesn't work. Taking some cues from what seems to be Mad-Krazy skills of AutoBert! This assumes a 1080p resolution! expandcollapse popup#include <IE.au3> #include <AutoItConstants.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Opt("MouseCoordMode", 1) ; 0 = relative coords to the active window, 1 = (default) absolute screen coordinates, 2 = relative coords to the client area of the active window SetLeft() Func SetLeft() ; Start IE. _IECreate('about:blank') ;Identify Page $IELeft=('Blank') ;Give 'er a sec WinWait ($IELeft, '', 5) ; Identify $IELeft & Activate Page WinActivate ($IELeft) ;Give 'er a sec WinWait ($IELeft, '', 5) ; Move to Left Monitor WinMove($IELeft, '', 700, 300, 700, 700, 1) ;Give 'er a sec WinWait ($IELeft, '', 5) ;Let's try simulating the mouse closing the page to remember the last location MouseClickDrag($MOUSE_ClICK_LEFT, 1000, 310, 1000, 0, 10) MouseClick($MOUSE_ClICK_LEFT, 1895, 7, 1, 10) ;Give 'er a sec WinWait ($IELeft, '', 5) EndFunc ;OK, Now lets get the real page opened in Kiosk Mode OPenKiosk() Func OpenKiosk() ; Type Win-R to open Run Dialog Box. Send("#r") Sleep(500) ; Open iexplore to blank page Send("iexplore.exe -k {Enter}") EndFunc This script simply attempts to force Kiosk Mode IE to open in the Left Monitor, I haven't added the scripts to open the left in Full Screen. Ugh, Why is the script affecting the Registry differently, if at all?!?! This script assumes the IE Session remembers the last state of IE Closing and using it to its advantage. Is there another way that AutoIt can Force/Write a last state to the registry to fool it into thinking the last state was on the Left Mon or 0, 0 coords? Here is the problem. The script is NOT setting the Last State of IE in the registry. If I Manually move the IE window to the right Mon and close, the new IE session opens to the right mon. If I run the script to open and move the ie Window to the left Mon and close,It will still open in the MOn that I MANUALLY set! No Matter what I do! I've tried this 6 ways from Sunday! It always remembers the state of the manual action but the scripted session is not remembered! ARRR! I even tried a hack that assuming the Kiosk opened on the right, you can hit SHIFT WIN + LEFT ARROW but... Send("+#{LEFT}") That doesn't work either. I activated first and even waited but this script won't work on Kiosk in a script. It works on all other programs I apply the script to but not Kiosk Mode IE! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now