|
Prev: SDI no resize
Next: SetPixel and Color
From: Mike Mellen on 16 May 2008 15:47 I have an XP system with two monitors. I am writing an MFC application to display information during a simulated game show that a local community theatre is producing. During the show, one monitor will display the score, the other will display information pertinent to the current game. I have each of the individual display modes (score and game) working. I'm using a CWnd derived class to display full-screen windows and paint/draw the information onto the window. My problem is that I can only get the display to output to one monitor. How do I select or identify a particular monitor as the one to use for display? I've tried playing around with the MoveWindow parameters to move the display to the "right" on the primary monitor enough to push it onto the second monitor, but I get an error if I move it all the way onto the second monitor. Thanks in advance for any suggestions.
From: AliR (VC++ MVP) on 16 May 2008 16:00 What's the error? I don't see why you would get an error. You can enumurate the monitors on a system using EnumDisplayMonitors, and get information (resolution, starting x position...) using GetMonitorInfo. http://msdn.microsoft.com/en-us/library/ms534813(VS.85).aspx Also see this: http://groups.google.com/group/microsoft.public.vc.mfc/browse_thread/thread/a6b7f93e956d02a/495e0d78c9b84174?lnk=gst&q=EnumDisplayMonitors#495e0d78c9b84174 AliR. "Mike Mellen" <Mike.Mellen(a)intellikey.com> wrote in message news:%239w4c24tIHA.2064(a)TK2MSFTNGP05.phx.gbl... >I have an XP system with two monitors. I am writing an MFC application to >display information during a simulated game show that a local community >theatre is producing. During the show, one monitor will display the score, >the other will display information pertinent to the current game. > > I have each of the individual display modes (score and game) working. I'm > using a CWnd derived class to display full-screen windows and paint/draw > the information onto the window. > > My problem is that I can only get the display to output to one monitor. > How do I select or identify a particular monitor as the one to use for > display? I've tried playing around with the MoveWindow parameters to move > the display to the "right" on the primary monitor enough to push it onto > the second monitor, but I get an error if I move it all the way onto the > second monitor. > > Thanks in advance for any suggestions.
From: BobF on 16 May 2008 16:02 Mike Mellen wrote: > I have an XP system with two monitors. I am writing an MFC application > to display information during a simulated game show that a local > community theatre is producing. During the show, one monitor will > display the score, the other will display information pertinent to the > current game. > > I have each of the individual display modes (score and game) working. > I'm using a CWnd derived class to display full-screen windows and > paint/draw the information onto the window. > > My problem is that I can only get the display to output to one monitor. > How do I select or identify a particular monitor as the one to use for > display? I've tried playing around with the MoveWindow parameters to > move the display to the "right" on the primary monitor enough to push it > onto the second monitor, but I get an error if I move it all the way > onto the second monitor. > > Thanks in advance for any suggestions. I assume you're letting Windows place the app window(s) ... It it were me, I would add code to save/restore window layout on exit/start, manually place the app windows where I want them and be done. I suggest this rather than coding window positions as you've described because your user may later decide to use a single monitor with one app window above the other - or something that would require a code change to place the app windows elsewhere.
From: Mike Mellen on 16 May 2008 16:15 Thanks for the info. It looks like I'm on the right track. I'm now thinking the error was caused by something other than the window positioning call. Anyway, this is a "home" project, so I can't try anything out until tonight, but the information you gave me should be a big help. Thanks again, and have a good weekend.
From: Mike Mellen on 16 May 2008 16:48
BobF wrote: > Mike Mellen wrote: >> I have an XP system with two monitors. I am writing an MFC application >> to display information during a simulated game show that a local >> community theatre is producing. During the show, one monitor will >> display the score, the other will display information pertinent to the >> current game. >> >> I have each of the individual display modes (score and game) working. >> I'm using a CWnd derived class to display full-screen windows and >> paint/draw the information onto the window. >> >> My problem is that I can only get the display to output to one >> monitor. How do I select or identify a particular monitor as the one >> to use for display? I've tried playing around with the MoveWindow >> parameters to move the display to the "right" on the primary monitor >> enough to push it onto the second monitor, but I get an error if I >> move it all the way onto the second monitor. >> >> Thanks in advance for any suggestions. > > I assume you're letting Windows place the app window(s) ... > > It it were me, I would add code to save/restore window layout on > exit/start, manually place the app windows where I want them and be done. > > I suggest this rather than coding window positions as you've described > because your user may later decide to use a single monitor with one app > window above the other - or something that would require a code change > to place the app windows elsewhere. If this were production code, I'd definitely be doing something along those lines, but this is a (probably) one-time use application. I'll be there every night to set things up and make sure it's all configured properly. As a result, and due to time constraints, I'm doing some quick and dirty coding - just get the thing working, and not worry about having to maintain it years from now. (and even as I'm typing this, a little voice is saying "that's what you think *now* ...."). |