Configuring Display Settings

  • Thread starter Slobodan Brcin \(eMVP\)
  • Start date
S

Slobodan Brcin \(eMVP\)

Is there a way to preconfigure display setting in XPe?

Yes.

Find your video driver component there you can choose resolution that you need to be set during the FBA.

Regards,
Slobodan
 
M

Maheedhar

Is there a way to preconfigure display setting in XPe?

__________________________________________________________________ Maheedhar
Nallapareddy ICQ#: 206797939 Current ICQ status: + More ways to contact me i
See more about me:
__________________________________________________________________
 
P

Pascal Bouchard

Furthermore, is there a way to configure multiple monitor position and
extension properties; (e.g. I want my own application to be displayed on a
monitor and media player on the other one) ?

To get this, i have to manually enable "Extend my Windows desktop onto this
monitor", an then set the position of my second monitor...
 
P

Pascal Bouchard

I wrote a c++ console win32 application to automate the extension to my
second monitor (also second display adapter); however, i can't enable the
"extend this monitor...."; my program only works if the "Extend this
monitor" is already checked... see below :

....
DEVMODE DevMode;
//DWORD dwflags = CDS_GLOBAL | CDS_UPDATEREGISTRY;
DWORD dwflags = 0;
LONG ret;

memset((void*)&DevMode,0,sizeof(DevMode));

///// Get current Device Mode (Yes DisplayDevice is the name of my second
diplay device)
if (!EnumDisplaySettings(DisplayDevice.DeviceName,ENUM_REGISTRY_SETTINGS,
&DevMode))
{
printf("Incapable d'obtenir le mode actuel\n");
break;
}

DevMode.dmSize = sizeof(DEVMODE);
DevMode.dmDriverExtra = sizeof(DevMode.dmPosition);
DevMode.dmFields = DM_POSITION;
DevMode.dmPosition.x = 800;
DevMode.dmPosition.y = 0;

if ( (ret=ChangeDisplaySettingsEx(DisplayDevice.DeviceName, &DevMode, NULL,
dwflags, NULL)) != DISP_CHANGE_SUCCESSFUL )
{
printf("Changement de parametres d'ecran avec probleme ou demande reset
%0Xh\n",ret);
break;
}

....

ret always returns -1 (FAILED); but when the "Extend...." check box is
already enabled, no error is returned.

What happens ?
 
K

KM

Pascal,
...
DEVMODE DevMode;
//DWORD dwflags = CDS_GLOBAL | CDS_UPDATEREGISTRY;
DWORD dwflags = 0;
LONG ret;

memset((void*)&DevMode,0,sizeof(DevMode));

///// Get current Device Mode (Yes DisplayDevice is the name of my second
diplay device)
if (!EnumDisplaySettings(DisplayDevice.DeviceName,ENUM_REGISTRY_SETTINGS,
&DevMode))
{
printf("Incapable d'obtenir le mode actuel\n");
break;
}

DevMode.dmSize = sizeof(DEVMODE);
DevMode.dmDriverExtra = sizeof(DevMode.dmPosition);

Why do you touch the driver's private data?
DevMode.dmFields = DM_POSITION;
DevMode.dmPosition.x = 800;
DevMode.dmPosition.y = 0;

if ( (ret=ChangeDisplaySettingsEx(DisplayDevice.DeviceName, &DevMode, NULL,
dwflags, NULL)) != DISP_CHANGE_SUCCESSFUL )
{
printf("Changement de parametres d'ecran avec probleme ou demande reset
%0Xh\n",ret);
break;
}

...

ret always returns -1 (FAILED); but when the "Extend...." check box is
already enabled, no error is returned.

What happens ?


Unless you want to restart the device after you call to ChangeDisplaySettingsEx to attach a secondary monitor, you will need to add
a second call to ChangeDisplaySettings(NULL, 0) to update the monitor.

Also, you haven't shown us the code where and how you retrive the DeviceName. You are better use EnumDisplayDevices there.

Read more info and see some code here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;308216

Change the code around the check for DISPLAY_DEVICE_PRIMARY_DEVICE if you want to attach to a primary device.

Regards,
KM
 
P

Pascal Bouchard

I was wrong trying to use driver's private data; i have done so much tries
that i don't remember the reason why it didn't work; i know one thing for
sure is that you cannot set resolution at the same ChangeDisplaySettingsEx()
as the one setting the position (this caused me almost an entire day to find
out).

My application does work now.

The sample you sent me gave me the remaining hints i was looking for.

Very thanks to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top