473,387 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

dual monitor.............in vb.net or c#

Hi,

I am running my application in two minitors.In one monitor.............if it is idle for some time the screensaver wil come(I wrote the code for this using system dll functions) .

Now my problem is that if i keep the mouse on monitor1 and i clicked on this monitor1..........this key press events should not work for second monitor.if i clicked on the first monitor ..............the screensaver is disappearing in the second monitor.

Means my query is it has to work according to mouse if the mouse is on ist monitor ,the key press events should work for this monitor only...............


Please help using vb.net or c#



Thanks Ramesh d
Jun 2 '07 #1
3 3617
kenobewan
4,871 Expert 4TB
Welcome to the site. How are you distinguishing in code between the two monitors?
Jun 3 '07 #2
Welcome to the site. How are you distinguishing in code between the two monitors?
Hi kenobewan ,
thx for responding to my query.........i am searching in different sites....but i did not get..

Here i wil explain..

please go through it..

for the cpu...i connected the monitors..using a circuit..it gives the no to each monitor..

In my project i have the two applications..one should run on first monitor...second should run on the second monitor.
for that..i wrote the code..like this i have 2 forms..like
frmpatient.cs (1 monitor)and
frmphysician.cs(second monitor).
and i created a class is


using System.Data;
using Microsoft.Win32;

namespace ECSPatient
{
/// <summary>
/// Summary description for CoreApplication.
/// </summary>
public class CoreApplication
{
#region Main Function

[STAThread]

static void Main(string[] args)
{


//XmlWriteKeyboard();

try
{


Thread thirdThread = new Thread(new ThreadStart(RunfrmPatient));
thirdThread.Start();


// Thread secondThread = new Thread(new ThreadStart(RunfrmApplication));
// secondThread.Start();

// secondThread.Priority = ThreadPriority.Highest;

}
catch(Exception ex)
{
MessageBox.Show("Exception main : " + ex.Message);
}
}
#endregion




#region XmlWriteKeyboard
//
// public static void XmlWriteKeyboard()
// {
// XmlDocument xmlConfigDoc=new XmlDocument();
//
// xmlConfigDoc.Load(AppDomain.CurrentDomain.BaseDire ctory + "\\status.xml");
//
// XmlNode xnDevice=xmlConfigDoc.DocumentElement.SelectSingle Node("//Xml");
//
// foreach (XmlNode node in xnDevice)
// {
// if(node.Name=="keyboard")
// node.ChildNodes[0].Value=strKeyStatus;
// }
// xmlConfigDoc.Save(AppDomain.CurrentDomain.BaseDire ctory + "\\status.xml");
// }
//
#endregion


#region Run OHM Application
/* Name : RunOHMApplication
* Purpose : Function which displays the forms of both Presentation 1 and Presentation 2
*
* */
protected static void RunfrmPatient()
{

// change the frmhome(1) to frmhome(0) while working in the local system.
//While doing install shield set it to frmhome(1) to run the patient application in the second monitor.
System.Windows.Forms.Application.Run(new frmpatient(0));
//System.Windows.Forms.Application.Run(new frmOHMPresentationA(0, contentCollection, strFirstLoopStatus));

}

#endregion
and in the frmpatient.cs code in the constructor is

#region "Overwrite the construction to identify which screen the patient appln should show
public frmpatient(int intScreen)
{
InitializeComponent();
ScreenNumber = intScreen;

}
#endregion

and this is in pageload
this.Bounds =Screen.AllScreens[ScreenNumber].Bounds;

please go through this

THANKS Ramesh d
Jun 4 '07 #3
Plater
7,872 Expert 4TB
Is this some sort of embeded environment?
Check System.Windows.Forms.Screen
It provides a basic interface into the screen/monitor objects. You should be able to pull X,Y coordinates that can be used to tell if your mouse is in the first monitor and not the second.
Jun 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: KJM | last post by:
How can I detect if the user has dual monitors and then how do I control which monitor a form is displayed on. Currently my forms always come up on my right monitor. What if I want to have it...
1
by: Patrick | last post by:
I need some code for getting screenshots from the secondary monitor on dual monitor display. Here's a bit of the code for a screen from the primary monitor. Bitmap MyImage = new...
1
by: Patrick | last post by:
need some code for getting screenshots from the secondary monitor on dual monitor display. Here's a bit of the code for a screen from the primary monitor. Bitmap MyImage = new...
0
by: davsun55 | last post by:
I'm looking for a C# code example that show use of a dual monitor. My application will have a control console running on the main monitor (a la powerpoint slideshow), with a display window showing...
3
by: Frank Rizzo | last post by:
Is there anyway to be able to split vs.net between 2 monitors? For instance, on one monitor, I'd like to have the form in design mode, while the other monitor would have the code for the form. ...
2
by: Mark | last post by:
Experts - I have a laptop running XP docked to a dual monitor setup. I find it quite annoying that even when I undock, I am still on dual monitor setting, which means some of my apps are on the...
3
by: fournij | last post by:
Hi I'm writing a MFC C++ application using Visual .NET. I'm using a Dual Head video card with 2 monitors. I want to start my application in the first monitor but open a dialog box in the...
8
by: Sheldon | last post by:
I just received a 2nd (configured as a dual) monitor but, for Access only, I can't seem to figure out, if it's possible, to view, say, Table1 on one monitor and Table2 on the other monitor. If I...
0
by: praveenhathwar | last post by:
I ve developed an application. My client has two monitors for a single PC. He wants to display a video clip in the second monitor continuosly (Repeatedly) and when the application in runs in Primay...
1
by: nanban4u | last post by:
Hi, Programming Language - HTML, JavaScript Web server : IIS 6 Browser : IE 6 + I am working in a Dual Monitor screen setup. I have a scenario some times the user move the IE screen from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.