Jump to content

Open pages and move page to a different screen


Recommended Posts

Noted below is my script what I am wanting to do is move the opened pages to a specific screens.  So I have one computer two screens I would like screen one to show on 0,0 an screen to show on 1080,0. I am not sure how to use the move or if it can be done in AutoIT.   I posted the heading names if anyone has an ideas this it would be much appreciated.

;Loads an HTML page from a scrpt path
Func Page1()

;Title "HAM1-QRQC-5 - Profile 1 - Microsoft? Edge"  /MOV 0 0

Run ('"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" file://c:/script/QRQC/Screen5.html  --start-fullscreen --new-window --force-device-scale-factor=1.15')

EndFunc

;Loads an HTML page from a scrpt path
Func page2()


;Title "HAM1-QRQC-6 - Profile 1 - Microsoft? Edge" /MOV -1080 0

Run ('"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" file://c:/script/QRQC/Screen6.html  --start-fullscreen --new-window --force-device-scale-factor=1.15')

EndFunc

;opens the page
Page1()

;opens the page
page2()


; teminate the application
Func terminate()

EndFunc

 

Edited by MichaelCrawley
Edit Script
Link to comment
Share on other sites

Func Move1()
    $hWind = WinWait("[class:msedge.exe]", "" = 10)
    Local $aPos = WinGetPos($hWnd)


EndFunc

Func Move2()
    $hWind1 = WinWait("[class:msedge.exe]", "" = 10)
    Local $aPos1 = WinGetPos($hWnd1)


EndFunc

So I added this and it opens on two different screens.  I am not sure if I am doing right though.

 

Func Page1()

;opens an HTML page from a scrpt path

Run ('"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" file://c:/script/QRQC/Screen5.html  --start-fullscreen --new-window --force-device-scale-factor=1.15')
WinMove($hWnd, "", 0, 0, 0, 0)

EndFunc

Func page2()

;opens an HTML page from a scrpt path

Run ('"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" file://c:/script/QRQC/Screen6.html  --start-fullscreen --new-window --force-device-scale-factor=1.15')
WinMove($hWnd1, "", 0, 0, 0, 1080)


EndFunc

 

Edited by MichaelCrawley
Added notes
Link to comment
Share on other sites

There are a few problems with the code you posted. If you want to timout after 10 secs in your WinWait, then the code should look like this --

$hWind = WinWait("[class:msedge.exe]", "", 10)

Then you use $hWnd and $hWnd1 in your WinMove, but these weren't previously defined (the first code section uses $hWind & $hWind1).

Have you tried it like this?

$hWnd = WinWait("HAM1-QRQC-5", "", 2)
If $hWnd Then WinMove($hWnd, "", 0, 0)

$hWnd = WinWait("HAM1-QRQC-6", "", 2)
If $hWnd Then WinMove($hWnd, "", 1080, 0)

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...