Sign in to follow this  
Followers 0
bshellenbaum

Control second monitor w Autoit?

4 posts in this topic

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

Share this post


Link to post
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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Thanks, I'll give it a look.

Bruce

Share this post


Link to post
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
Sign in to follow this  
Followers 0