#include #include #include ; Davide Lonardi RotateDisplays.au3 May 2019 ; Calling parameters: is the present cabling situation ; RotateDisplays.exe F ; RotateDisplays.exe R ; F-> Cables = Factory (Lower DVI to Supervisor 10", upper DVI to consumer 15") ; R-> Cables = Rotated (lower DVI to Consumer 15", upper DVI to Supervisor 10") RotateDisplays() Func RotateDisplays() Global $logging = true; Local $iReturn = 0; Global $Factory = false; _log('Entering the RotateDisplays ...') if ( $CmdLine[0] = 0 ) then _log('Program called with no Parameters ...') exit (-1) EndIF if ( $CmdLine[1] = "F" ) then _log('Program called with F Parameter ...') $Factory = true; EndIF If FileExists ( "C:\Diebold\HW\Denver.txt" ) = 1 then _log('The Processor detected is DENVER ...') If FileExists ( "C:\DiLauncher\ShowDkTk.exe" ) = 1 then Run("C:\DiLauncher\ShowDkTk.exe TRUE") _log('After running C:\DiLauncher\ShowDkTk.exe') EndIF sleep(5000) ;---now Click on WINDOWS Start Button _log('before Click on WINDOWS Start Button ...') MouseClick("primary", 25, 584, 1) sleep(5000) ;---now Click on CONTROL PANEL Button _log('before Click on CONTROL PANEL Button ...') MouseClick("primary", 333, 283, 1) sleep(5000) ;---now Click on Adjust screen resolution link _log('before Click Adjust screen resolution link on CONTROL PANEL Window ...') MouseClick("primary", 522, 265, 1) sleep(5000) ;---now Click on Advanced settings link _log('before Click Advanced settings link ...') MouseClick("primary", 640, 400, 1) sleep(5000) ;---now Click on Intel(R) Graphic Media Accelerator Drive TAB _log('before Click Advanced settings link ...') MouseClick("primary", 212, 67, 1) sleep(7000) ;---now Click on Proprietà Grafiche Button _log('before Click on Proprietà Grafiche Button ...') _log('now need a 40 sec timeout for the INTEL GRAPHIC TOOL to show up...') MouseClick("primary", 292, 347, 1) sleep(40000) ;--- On the INTEL GRAPHIC TOOL Window ------------------------------------------------------------------ ;--- Primary Device Drop down Menu opens with click on 393,215 _log('before Click Drop down Menu opens with click on 393,215 ...') MouseClick("primary", 393, 215, 1) sleep(5000) ;--- On the INTEL GRAPHIC TOOL Window --------------------------------------------------------------------------------------------------- ;--- Schermo Primario drop down menu if ( $Factory = false ) then ;--- Schermo Digitale 2 ; change with ;--- Schermo Digitale is 1 position down at 370, 232 _log('When Factory=False select Schermo Digitale at 1 position down at 370, 232...') MouseClick("primary", 370, 232, 1) sleep(7000) EndIF if ( $Factory = true ) then ;--- Schermo Digitale ; change with ;--- Schermo Digitale 2 that is 2 positions down at 370, 243 _log('When Factory=False select Schermo Digitale at 1 position down at 370, 243...') MouseClick("primary", 370, 243, 1) sleep(7000) EndIF ;---------------------------------------------------------------------------------------------------------------------------------------- ;--- On the INTEL GRAPHIC TOOL Window --------------- ;--- Click on APPY at 527, 405 _log('before Click on APPY at 570, 401 ...') MouseClick("primary", 570, 401, 1) ;--- here I need 6000 milliseconds because the Display switch time sleep(10000) ;--- On Dialog with Caption "Confirm the Desktop Change" Window --------------- ;--- Click on OK at 102, 149 _log('before Click Dialog with Caption "Confirm the Desktop Change" at 102, 149 ...') MouseClick("primary", 102, 149, 1) sleep(10000) ;--- Back On the INTEL GRAPHIC TOOL Window --------------- ;--- Click on OK at 356, 401 _log('before final Click lick on OK at 401, 396...') MouseClick("primary", 401, 396) sleep(5000) EndIF ;Sleep(5000) SplashOff() EndFunc ;==>RunBancorInstall Func _log($message) If $logging Then ; global variable where you can globally switch OFF/ON logging FileWriteLine('c:\Agilis\Setuplogs\RotateDisplays.log', @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @SEC & " --> " & $message) EndIf EndFunc