Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get width() of secondary Monitor. [modified] Pin
Luc Pattyn21-May-10 2:58
sitebuilderLuc Pattyn21-May-10 2:58 
Hi,

AFAIK there are three ways to go:

1.
make some assumptions on the monitor situation; such as they are next to each other, trying to form one larger desktop. Then some simple arithmetic may get you what you want (kind of: x2 stretches from width1 to width1+width2). But that would fail if they were configured vertically.

2.
use GetSystemMetric() to find the size of the desktop; this is the bounding rectangle of all monitors present, however there could be holes in it, when you have a rectangular arrangement (say 3*2) with some monitor missing, or when the resolutions aren't all the same.
see SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN

3.
use some Win32 function, maybe EnumDisplayDevices(), to find out how many monitors there are, whether they all are part of the desktop, and if so, where they are in the uniform coordinate system.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

modified on Friday, May 21, 2010 9:05 AM

QuestionWinlogon and WM_WTSSESSION_CHANGE Pin
gothic_coder21-May-10 1:21
gothic_coder21-May-10 1:21 
AnswerRe: Winlogon and WM_WTSSESSION_CHANGE Pin
gothic_coder24-May-10 23:29
gothic_coder24-May-10 23:29 
Questionsome header files doesn't work in visual studio 2008 Pin
hasani200720-May-10 23:59
hasani200720-May-10 23:59 
AnswerRe: some header files doesn't work in visual studio 2008 Pin
Aescleal21-May-10 0:46
Aescleal21-May-10 0:46 
GeneralRe: some header files doesn't work in visual studio 2008 Pin
Cool_Dev21-May-10 2:08
Cool_Dev21-May-10 2:08 
GeneralRe: some header files doesn't work in visual studio 2008 Pin
Aescleal21-May-10 3:33
Aescleal21-May-10 3:33 
QuestionLoad image Pin
john563220-May-10 22:10
john563220-May-10 22:10 
AnswerRe: Load image Pin
KingsGambit20-May-10 22:21
KingsGambit20-May-10 22:21 
AnswerRe: Load image Pin
Hristo-Bojilov20-May-10 23:59
Hristo-Bojilov20-May-10 23:59 
GeneralRe: Load image Pin
john563221-May-10 0:36
john563221-May-10 0:36 
Questionhow to draw an arc in open gl implemented in visual c++ Pin
nearest20-May-10 21:47
nearest20-May-10 21:47 
AnswerRe: how to draw an arc in open gl implemented in visual c++ Pin
Cedric Moonen20-May-10 22:57
Cedric Moonen20-May-10 22:57 
QuestionProblem with Activex Control property pages Pin
Sreenivas00320-May-10 21:21
Sreenivas00320-May-10 21:21 
Questioncall standard-draw of a control Pin
baerten20-May-10 21:10
baerten20-May-10 21:10 
AnswerRe: call standard-draw of a control Pin
Code-o-mat20-May-10 21:58
Code-o-mat20-May-10 21:58 
GeneralRe: call standard-draw of a control Pin
baerten20-May-10 22:41
baerten20-May-10 22:41 
GeneralRe: call standard-draw of a control Pin
Code-o-mat20-May-10 23:06
Code-o-mat20-May-10 23:06 
QuestionSend and Receive Problem Pin
Member 365375120-May-10 20:53
Member 365375120-May-10 20:53 
AnswerRe: Send and Receive Problem Pin
Richard MacCutchan20-May-10 21:19
mveRichard MacCutchan20-May-10 21:19 
GeneralRe: Send and Receive Problem Pin
Member 365375120-May-10 21:41
Member 365375120-May-10 21:41 
GeneralRe: Send and Receive Problem Pin
Richard MacCutchan21-May-10 2:57
mveRichard MacCutchan21-May-10 2:57 
AnswerRe: Send and Receive Problem Pin
CPallini20-May-10 21:34
mveCPallini20-May-10 21:34 
GeneralRe: Send and Receive Problem Pin
Member 365375120-May-10 22:46
Member 365375120-May-10 22:46 
GeneralRe: Send and Receive Problem Pin
Iain Clarke, Warrior Programmer20-May-10 23:11
Iain Clarke, Warrior Programmer20-May-10 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.