Click here to Skip to main content
15,909,741 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to export a CDialog derived class from a DLL Pin
NILANKARAJA24-Nov-06 1:26
NILANKARAJA24-Nov-06 1:26 
AnswerRe: How to export a CDialog derived class from a DLL Pin
Mark Salsbery24-Nov-06 6:14
Mark Salsbery24-Nov-06 6:14 
QuestionKeyBoard HOOK Pin
priyank_ldce24-Nov-06 1:03
priyank_ldce24-Nov-06 1:03 
AnswerRe: KeyBoard HOOK Pin
CPallini24-Nov-06 1:33
mveCPallini24-Nov-06 1:33 
AnswerRe: KeyBoard HOOK Pin
Rajesh R Subramanian24-Nov-06 2:09
professionalRajesh R Subramanian24-Nov-06 2:09 
QuestionEnumDisplaySettings API [modified] Pin
Bala Indian24-Nov-06 0:36
Bala Indian24-Nov-06 0:36 
AnswerRe: EnumDisplaySettings API Pin
Rajesh R Subramanian24-Nov-06 2:16
professionalRajesh R Subramanian24-Nov-06 2:16 
AnswerRe: EnumDisplaySettings API Pin
Bala Indian26-Nov-06 18:59
Bala Indian26-Nov-06 18:59 
Hi,
The following code is not giving expected result for me.

I need display resolutions from the current monitor settings not from display device.

Problem is dispCurrent.DeviceName is not taken by the EnumDisplaySettings API.

Please tell me where i am going wrong.


int displayNumber=0;
DISPLAY_DEVICE dispDev, dispCurrent;
memset(&dispDev, 0, sizeof(dispDev));
memset(&dispCurrent, 0, sizeof(dispCurrent));
dispDev.cb = sizeof(DISPLAY_DEVICE);
dispCurrent.cb = sizeof(DISPLAY_DEVICE);
EnumDisplayDevices(NULL, displayNumber, &dispDev, 0);
while (EnumDisplayDevices(dispDev.DeviceName,displayNumber,&dispCurrent,0))
{
displayNumber++;
CString MonName = dispCurrent.DeviceName;
if ( (dispCurrent.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) == DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
{
// Get all modes and display them in a listbox
BOOL bRetVal;
CString sDevMode;
CString sDevModeCurr;
CString strRep = "x";
DEVMODE devmode;
DEVMODE devmodeCurr;
DWORD iMode =0;

do
{
bRetVal = EnumDisplaySettings((LPCTSTR)dispCurrent.DeviceName, iMode, &devmode);
iMode++;
if (bRetVal)
{
sDevMode.Format("%dx%d, %d bits %dhtz", devmode.dmPelsWidth,
devmode.dmPelsHeight, devmode.dmBitsPerPel,
devmode.dmDisplayFrequency);

m_sDispRes.AddString(sDevMode);
}
}
while(bRetVal);
}
}

Balamurugan from india chennai

QuestionBuild Count Pin
Waldermort24-Nov-06 0:13
Waldermort24-Nov-06 0:13 
QuestionTransfering an exe file . How ? Pin
Sakthiu23-Nov-06 23:57
Sakthiu23-Nov-06 23:57 
AnswerRe: Transfering an exe file . How ? Pin
Galatei24-Nov-06 1:43
Galatei24-Nov-06 1:43 
AnswerRe: Transfering an exe file . How ? Pin
Mark Salsbery24-Nov-06 6:19
Mark Salsbery24-Nov-06 6:19 
Questionhow can we retrieve selection state of listcontrol Pin
johnalek23-Nov-06 23:50
johnalek23-Nov-06 23:50 
AnswerRe: how can we retrieve selection state of listcontrol Pin
Mila02523-Nov-06 23:58
Mila02523-Nov-06 23:58 
AnswerRe: how can we retrieve selection state of listcontrol Pin
Galatei24-Nov-06 1:52
Galatei24-Nov-06 1:52 
Questionkeyboard focus Pin
priyank_ldce23-Nov-06 22:36
priyank_ldce23-Nov-06 22:36 
AnswerRe: keyboard focus Pin
Nibu babu thomas23-Nov-06 23:10
Nibu babu thomas23-Nov-06 23:10 
QuestionRe: keyboard focus Pin
priyank_ldce23-Nov-06 23:27
priyank_ldce23-Nov-06 23:27 
AnswerRe: keyboard focus Pin
Nibu babu thomas23-Nov-06 23:31
Nibu babu thomas23-Nov-06 23:31 
AnswerRe: keyboard focus Pin
Rajesh R Subramanian23-Nov-06 23:38
professionalRajesh R Subramanian23-Nov-06 23:38 
QuestionBudget Prediction through Networks Pin
Rwabe23-Nov-06 21:48
Rwabe23-Nov-06 21:48 
QuestionHow to know whether the tray of CD drive is open or close? Pin
monkinrain23-Nov-06 21:13
monkinrain23-Nov-06 21:13 
AnswerRe: How to know whether the tray of CD drive is open or close? Pin
Galatei23-Nov-06 22:09
Galatei23-Nov-06 22:09 
AnswerRe: How to know whether the tray of CD drive is open or close? Pin
Nibu babu thomas23-Nov-06 23:15
Nibu babu thomas23-Nov-06 23:15 
AnswerRe: How to know whether the tray of CD drive is open or close? Pin
monkinrain24-Nov-06 0:35
monkinrain24-Nov-06 0:35 

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.