Total members 11872 |It is currently Sun Jan 29, 2023 8:07 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka






 Project Name:   Toggle the Multi Monitor Setting in Windows XP
 Programmer:   Imran Ebrahim
 Type:   Application
 Technology:  JAVA
 IDE:   NONE
 Description:   If you use Windows XP and a dual monitor, this article will prove to be useful. The code will launch the display control 'applet' and send it keystrokes (the same way you would if you use keyboard navigation) to extend the monitor to the secondary attached monitor.
sample code
java code
import java.awt.Robot;
import java.awt.event.KeyEvent;


/**
* @author imran
* Description : Used to toggle the multimonitor display in Win XP.
*/
public class MultiMon {

/**
* @param args
*/
public static void main(String[] args) {
try {
//Invoke the desktop setting applet, the 3rd tab should be selected
Runtime.getRuntime().exec("control.exe desk.cpl,@0,3");

//Pause for a second....
try {
Thread.sleep(1000);
}catch (InterruptedException ex){
}
//Create a new robot that can do the system interaction for us...
Robot robot = new Robot();
//Activate the "Display" field...
robot.keyPress(KeyEvent.VK_D + KeyEvent.ALT_MASK);
//Choose the second monitor
robot.keyPress(KeyEvent.VK_2);
//goto the "Extend my windows desktop" checkbox...
robot.keyPress(KeyEvent.VK_TAB);robot.keyPress(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.VK_TAB);robot.keyPress(KeyEvent.VK_TAB);
robot.keyPress(KeyEvent.ALT_MASK);
robot.keyPress(KeyEvent.VK_E );
//toggle the check box...
robot.keyPress(KeyEvent.VK_ENTER);
//clear references...
robot = null;
//exit the application
System.exit(0);

} catch (Exception e) {
// Things did'nt work out....
e.printStackTrace();
}
}

}

Attachment:
display_settings.PNG
display_settings.PNG [ 29.38 KiB | Viewed 5752 times ]





Attachments:
MultiMon_src.zip [737 Bytes]
Downloaded 1236 times
Multimon_src_bin.zip [1.54 KiB]
Downloaded 970 times

_________________
Please recommend my post if you found it helpful. ,
java,j2ee,ccna ,ccnp certified .
Author:
Expert
User avatar Posts: 838
Have thanks: 2 time

Great Post! For anyone who doesn't understand how to setup , here are a few tips:

The Three main ways to Setup Multiple Monitors

1) You can buy a pre-manufactured multiple monitor computer. The best place to purchase a multiple monitor computer is at:
. They carry a multi-monitor computer line called SUPER-PC that can support from 2 to 12 monitors.

Multi-Screen Computer Systems

Multiple Monitor LCD Displays

2) You can get a USB to VGA Adapter, or USB to DVI Adapter that will allow you to add an extra monitor to your computer
via any USB2.0 Port. You can also add multiple extra monitors by using multiple adapters. This is a great option for viewing
documents, surfing the web, using Microsoft Office and many other business tasks. This is not a good option for intense
graphical situations such as HDTV, Blu-ray, Gaming and 3D / CAD Workstation applications. For those types of scenarios,
it is highly recommended that you purchase a high-powered multi-monitor workstation.



3) You can replace or add an extra video card to your existing computer, depending on how many monitors you wish to support.
Although this sounds easy enough, this is a rather complex solution for a beginner, especially when trying to find a compatible
graphics card. For this reason, I am going to write an entirely seperate post on that topic and will link to it here, very soon.



Once you have your multiple monitor system set up and ready to use, you will need to enable all of your monitors in
your “Display Properties” Control Panel. Here is a great link to a complete and animated walkthrough of how to enable
your multiple monitors in Windows.



This is what it will look like when you are done:



Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time

updated.


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : Toggle the Multi Monitor Setting in Windows XP
 Hide, show and toggle effects with speed control     -  
 Setting a Cookie Value in php     -  
 setting div background position     -  
 Dynamically Setting and Accessing Variables     -  
 Setting maximum height of paragraph -P tag     -  
 (3.0.4) Skymiles Setting Fixed WIDTH     -  
 Multi Thread Program     -  
 Multi colored table rows     -  
 Javascript Multi-dimensional Arrays     -  
 multi-frameset and non-re-sizable html frame pages     -  



Topic Tags

Java Projects







Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com