MichaelCrawley Posted December 4, 2023 Share Posted December 4, 2023 (edited) 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 December 4, 2023 by MichaelCrawley Edit Script Link to comment Share on other sites More sharing options...
Danp2 Posted December 4, 2023 Share Posted December 4, 2023 Have you tried it yourself using WInMove? MichaelCrawley 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MichaelCrawley Posted December 4, 2023 Author Share Posted December 4, 2023 I am not sure I know how to use it but I did find propterties... I will give it a try WinMove ( "title", "text", x, y [, width [, height [, speed]]] ) Link to comment Share on other sites More sharing options...
MichaelCrawley Posted December 4, 2023 Author Share Posted December 4, 2023 (edited) 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 December 4, 2023 by MichaelCrawley Added notes Link to comment Share on other sites More sharing options...
Danp2 Posted December 4, 2023 Share Posted December 4, 2023 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) Latest Webdriver UDF Release Webdriver Wiki FAQs 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