Dual Monitor support in WinXP (solution?!)

Ben Staab staab at Waisman.Wisc.Edu
Wed Aug 6 17:56:42 UTC 2003


A while ago I had posted a message asking about using Eprime on a computer
with Dual Monitors.  We wanted the initial data collection to occur on one
screen, while the actual experiment ran on the other screen.  Unfortunately
the solutions provided here would not work very well in our lab.  We needed
to stay away from hardware solutions, and there were some options the video
driver just wouldn't let us try (mirroring, etc).  I did finally come up
with a programmatic (yet kludgy!) solution.

Basically it involved two things:
1. A WSH-run vbScript that switches the monitor modes before and after ERun
is *um* run.  At first I had done this using an evaluation version of
UltraMon (http://www.realtimesoft.com/ultramon/).  I setup two ultramon
profiles different only in which monitor was primary, and had the script
launch each profile in turn.  After the trial period expired, I figured
there has to be a way to script that primary switch myself.  There is, but
it isn't pretty.  For posterity's sake, this is the vbscript I came up with
to switch monitor 2 to primary:
	oShell.Run "control desk.cpl,,3"	' open display properties
	Do Until oShell.AppActivate("Display Properties")	' wait for box to show up
	  WScript.Sleep 100
	Loop
	oShell.SendKeys "2%u~" 'send key combo to set display 2 to primary
Of course, using a script to launch ERun had an added advantage: We have
different trial lists that are used for the same experiment.  The script
prompts for which list to use, and copies it to the correct place before
the experiment is run.

2. I rewrote the data collection prompts to use InputBoxes instead of the
stock AskBoxes.  InputBoxes allow you to specify where on the screen the
box comes up.  If two monitors are set side by side, with the right(as in
starboard) being primary, an InputBox set to display at -10080 twips will
show up about in the middle of the left monitor.  In all the log file
juggling this required, I found another blessing in disguise.  I can now
name the logfiles whatever I want.

If anyone would like more detailed information on what exactly I did here,
or would like a peek at the source code, let me know.

Ben Staab
staab at waisman.wisc.edu



More information about the Eprime mailing list