Jump to content

Control second monitor w Autoit?


Recommended Posts

I've got a doctor client that would like to attach a second monitor to one workstation, facing the other way so patients can see the screen as he shows before/after photos to them. That part is easy.

What they need is a program that will bring the second monitor up, duplicate the desktop to show the pictures and when they exit the pictures, shut off the second monitor so the patient info isn't left on the screen for anyone else to see.

Can autoit be scripted to this level

1) start up the second monitor, duplicating the desktop

2)Start up Irfanview

3)When Irfanview is exited, shut down the second monitor

Thanks

Bruce

Link to comment
Share on other sites

I've got a doctor client that would like to attach a second monitor to one workstation, facing the other way so patients can see the screen as he shows before/after photos to them. That part is easy.

What they need is a program that will bring the second monitor up, duplicate the desktop to show the pictures and when they exit the pictures, shut off the second monitor so the patient info isn't left on the screen for anyone else to see.

Can autoit be scripted to this level

1) start up the second monitor, duplicating the desktop

2)Start up Irfanview

3)When Irfanview is exited, shut down the second monitor

Thanks

Bruce

yes it can, i remember about 7 months ago maybe, someone posted a script to turn off a monitor as an example of dll usage. I'll see if i can't find it and post the code. then you'd just have to put the rest of the script around it, setting the on/off condition
Link to comment
Share on other sites

yes it can, i remember about 7 months ago maybe, someone posted a script to turn off a monitor as an example of dll usage. I'll see if i can't find it and post the code. then you'd just have to put the rest of the script around it, setting the on/off condition

Found it. the part of the code that you'll need is

const $WM_SYSCommand = 274,$SC_MonitorPower = 61808,$Power_On = -1,$Power_Off = 2
$HWND=WinGetHandle(WinGetTitle("",""))
Func MonitorOff()
    DllCall("user32.dll","int","SendMessage","hwnd",$HWND,"int",$WM_SYSCommand,"int",$SC_MonitorPower,"int",$Power_Off)
EndFunc
Func MonitorOn()
    DllCall("user32.dll","int","SendMessage","hwnd",$HWND,"int",$WM_SYSCommand,"int",$SC_MonitorPower,"int",$Power_On)
EndFunc
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...